diff --git a/docs/site/Model.md b/docs/site/Model.md index 29ca59b6fa59..94df9fa4d095 100644 --- a/docs/site/Model.md +++ b/docs/site/Model.md @@ -12,6 +12,10 @@ A model describes business domain objects, for example, `Customer`, `Address`, and `Order`. It usually defines a list of properties with name, type, and other constraints. +{% include note.html content="Models describe the shape of data. Behavior like CRUD operations is added by repositories. This is different from LoopBack 3.x where models implement behavior too." %} + +{% include tip.html content="A single model can be used with multiple different Repositories." %} + Models can be used for data exchange on the wire or between different systems. For example, a JSON object conforming to the `Customer` model definition can be passed in REST/HTTP payload to create a new customer or stored in a document diff --git a/docs/site/Repositories.md b/docs/site/Repositories.md index 488ebe24be1e..c7346b2570a1 100644 --- a/docs/site/Repositories.md +++ b/docs/site/Repositories.md @@ -10,6 +10,10 @@ A `Repository` represents a specialized `Service` interface that provides strong-typed data access (for example, CRUD) operations of a domain model against the underlying database or service. +{% include note.html content="Repositories are adding behavior to Models. Models describe the shape of data, Repositories provide behavior like CRUD operations. This is different from LoopBack 3.x where models implement behavior too." %} + +{% include tip.html content="A single model can be used with multiple different Repositories." %} + A `Repository` can be defined and implemented by application developers. LoopBack ships a few predefined `Repository` interfaces for typical CRUD and KV operations. These `Repository` implementations leverage `Model` definition and