Update the docs to fix into width of 80
This commit is contained in:
parent
28ef0becd4
commit
7cb271477e
|
@ -6,10 +6,9 @@
|
||||||
|
|
||||||
###Model
|
###Model
|
||||||
|
|
||||||
LoopBack is centered around models. A model is an object that
|
LoopBack is centered around models. A model is an object that encapsulates
|
||||||
encapsulates data. A model is usually named after its
|
data. A model is usually named after its real life counterpart. Like its real
|
||||||
real life counterpart. Like its real life counterpart, a model has
|
life counterpart, a model has some properties. Each property has a name, a type,
|
||||||
some properties. Each property has a name, a type,
|
|
||||||
and other attributes. For example,
|
and other attributes. For example,
|
||||||
|
|
||||||
model: Person
|
model: Person
|
||||||
|
@ -18,9 +17,9 @@ and other attributes. For example,
|
||||||
- a Person model has properties such as First Name, Last Name and Birthday.
|
- a Person model has properties such as First Name, Last Name and Birthday.
|
||||||
- First Name and Last Name are strings while Birthday is date.
|
- First Name and Last Name are strings while Birthday is date.
|
||||||
|
|
||||||
A model can also do things as actions and behaviors. Some actions
|
A model can also do things as actions and behaviors. Some actions are common to
|
||||||
are common to all instances of the same model while
|
all instances of the same model while others are specific to a given instance.
|
||||||
others are specific to a given instance. For example,
|
For example,
|
||||||
|
|
||||||
model: Person
|
model: Person
|
||||||
|
|
||||||
|
@ -28,26 +27,23 @@ others are specific to a given instance. For example,
|
||||||
- a Person model can say his/her Full Name (relying on a given instance)
|
- a Person model can say his/her Full Name (relying on a given instance)
|
||||||
- a Person model can find people by Last Name (independent of instances)
|
- a Person model can find people by Last Name (independent of instances)
|
||||||
|
|
||||||
Models are the vehicle for data exchange and data representation
|
Models are the vehicle for data exchange and data representation across
|
||||||
across different layers in LoopBack. For example, the
|
different layers in LoopBack. For example, the Person model is available as
|
||||||
Person model is available as database tables, Node.js classes, REST
|
database tables, Node.js classes, REST resources, and mobile SDK objects.
|
||||||
resources, and mobile SDK objects.
|
|
||||||
|
|
||||||
When developing your mobile applications, think of models being the
|
When developing your mobile applications, think of models being the "M" in your
|
||||||
"M" in your MVC framework. Models in LoopBack have
|
MVC framework. Models in LoopBack have backend connectivity built in already,
|
||||||
backend connectivity built in already, so that you can save data
|
so that you can save data back to your backend and call actions or functions run
|
||||||
back to your backend and call actions or functions run
|
|
||||||
on the backend seamlessly from your mobile application.
|
on the backend seamlessly from your mobile application.
|
||||||
|
|
||||||
###LoopBack Definition Language (LDL)
|
###LoopBack Definition Language (LDL)
|
||||||
|
|
||||||
All models in LoopBack can be described as JSON objects. LoopBack
|
All models in LoopBack can be described as JSON objects. LoopBack has utilized
|
||||||
has utilized and extended JSON to define a model's properties and
|
and extended JSON to define a model's properties and structure. The JSON that is
|
||||||
structure. The JSON that is utilized to help define a model's
|
utilized to help define a model's properties and structure or schema is called
|
||||||
properties and structure or schema is called LoopBack Definition
|
LoopBack Definition Language (LDL). LDL is simple DSL to define data models in
|
||||||
language (LDL). LDL is a simple DSL to define data models in
|
JavaScript or plain JSON. The model definitions establish common knowledge of
|
||||||
JavaScript or plain JSON. The model definitions establish common
|
data in LoopBack. For example,
|
||||||
knowledge of data in LoopBack. For example,
|
|
||||||
|
|
||||||
model: Person
|
model: Person
|
||||||
|
|
||||||
|
@ -62,26 +58,23 @@ For more information, please read [LoopBack Definition Language Guide](/loopback
|
||||||
|
|
||||||
###Datasources and Connectors
|
###Datasources and Connectors
|
||||||
|
|
||||||
LoopBack allows you to connect to many sources of data and services
|
LoopBack allows you to connect to many sources of data and services in the cloud
|
||||||
in the cloud and on premise in your data center.
|
and on premise in your data center. These sources of data and services are
|
||||||
These sources of data and services are called DataSources.
|
called DataSources. DataSources are accessed through a plugin called a Connector
|
||||||
DataSources are accessed through a plugin called a Connector
|
in LoopBack. Plugins are highly customizable and extensible. Unlike other
|
||||||
in LoopBack. Plugins are highly customizable and extensible.
|
mobile backend, LoopBack can leverage your existing data and organize them in
|
||||||
Unlike other mobile backend, LoopBack can leverage your existing
|
the form of models.
|
||||||
data and organize them in the form of models.
|
|
||||||
|
|
||||||
The concept of DataSource is introduced to encapsulate business
|
The concept of DataSource is introduced to encapsulate business logic to
|
||||||
logic to exchange data between models and various data sources.
|
exchange data between models and various data sources. Data sources are
|
||||||
Data sources are typically databases that provide create, retrieve,
|
typically databases that provide create, retrieve, update, and delete (CRUD)
|
||||||
update, and delete (CRUD) functions. LoopBack also generalize
|
functions. LoopBack also generalize other backend services, such as REST APIs,
|
||||||
other backend services, such as REST APIs, SOAP Web Services, and Storage Services, as data sources.
|
SOAP Web Services, and Storage Services, as data sources.
|
||||||
|
|
||||||
Data sources are backed by connectors which implement the data
|
Data sources are backed by connectors which implement the data exchange logic
|
||||||
exchange logic using database drivers or other client APIs.
|
using database drivers or other client APIs. In general, connectors are not used
|
||||||
In general, connectors are not used directly by application code.
|
directly by application code. The DataSource class provides APIs to configure
|
||||||
The DataSource class provides APIs to configure the
|
the underlying connector and exposes functions via DataSource or model classes.
|
||||||
underlying connector and exposes functions via DataSource or model
|
|
||||||
classes.
|
|
||||||
|
|
||||||
#### LoopBack Connector Modules
|
#### LoopBack Connector Modules
|
||||||
|
|
||||||
|
@ -96,13 +89,13 @@ For more information, please read [LoopBack DataSource and Connector Guide](/loo
|
||||||
|
|
||||||
### REST
|
### REST
|
||||||
|
|
||||||
Everything defined in LoopBack is available to you as a REST
|
Everything defined in LoopBack is available to you as a REST endpoint. For
|
||||||
endpoint. For every model that is created in LoopBack, a
|
every model that is created in LoopBack, a REST endpoint is automatically
|
||||||
REST endpoint is automatically created for you. You can see and
|
created for you. You can see and experiment with your REST api using the
|
||||||
experiment with your REST api using the [LoopBack API Explorer](http://localhost:3000/explorer/).
|
[LoopBack API Explorer](http://localhost:3000/explorer/).
|
||||||
|
|
||||||
LoopBack also supports other protocols for your API as well. Socket.
|
LoopBack also supports other protocols for your API as well. Socket.io is
|
||||||
io is another protocol that is currently being developed.
|
another protocol that is currently being developed.
|
||||||
|
|
||||||
For more information, please read [Model REST APIs](#model-rest-api).
|
For more information, please read [Model REST APIs](#model-rest-api).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue