Skip to content

Commit c817eb3

Browse files
committed
fix(docs): add diagrams to concepts
1 parent 535f775 commit c817eb3

File tree

8 files changed

+56
-38
lines changed

8 files changed

+56
-38
lines changed

docs/site/Behind-the-scene.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
lang: en
3+
title: 'Components'
4+
keywords: LoopBack 4.0, LoopBack 4
5+
sidebar: lb4_sidebar
6+
permalink: /doc/en/lb4/Behind-the-scene.html
7+
---
8+
9+
Here are the infrastructure that get all the artifacts working together:
10+
11+
- [Context](Context.md): An abstraction of states and dependencies in your
12+
application that LoopBack uses to manage everything. It’s a global registry
13+
for everything in your app (configurations, state, dependencies, classes and
14+
so on).
15+
- [Binding](Binding.md): An abstraction of items managed by a context. Each
16+
binding has a unique key within the context and a value provider to resolve
17+
the key to a value.
18+
- [Dependency Injection](Dependency-injection.md): The technique used to
19+
separate the construction of dependencies of a class or function from its
20+
behavior to keep the code loosely coupled.
21+
- [Component](Components.md): A package that bundles one or more LoopBack
22+
extensions.

docs/site/Concepts.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ sidebar: lb4_sidebar
66
permalink: /doc/en/lb4/Concepts.html
77
---
88

9-
LoopBack 4 introduces some new concepts that are important to understand:
9+
LoopBack 4 defines some key building blocks to represent different
10+
responsibilities for typical API and/or Microservice applications.
11+
12+
![Key concepts overview diagram](imgs/key-concepts-overview-diagram.png)
1013

1114
- [**Application**](Application.md): The central class for setting up all of
1215
your module’s components, controllers, servers and bindings. The Application
@@ -18,19 +21,6 @@ LoopBack 4 introduces some new concepts that are important to understand:
1821
typically listens on a specific endpoint (protocol/host/port), handles
1922
incoming requests, and then returns appropriate responses.
2023

21-
- [**Context**](Context.md): An abstraction of states and dependencies in your
22-
application that LoopBack uses to manage everything. It's a global registry
23-
for everything in your app (configurations, state, dependencies, classes and
24-
so on).
25-
26-
- [**Binding**](Binding.md): An abstraction of items managed by a context. Each
27-
binding has a unique key within the context and a value provider to resolve
28-
the key to a value.
29-
30-
- [**Dependency Injection**](Dependency-injection.md): The technique used to
31-
separate the construction of dependencies of a class or function from its
32-
behavior to keep the code loosely coupled.
33-
3424
- [**Controller**](Controllers.md): A class that implements operations defined
3525
by the application’s REST API. It implements an application’s business logic
3626
and acts as a bridge between the HTTP/REST API and domain/database models. A
@@ -65,6 +55,3 @@ LoopBack 4 introduces some new concepts that are important to understand:
6555

6656
- [**Decorator**](Decorators.md): The pattern used to annotate or modify your
6757
class declarations and their members with metadata.
68-
69-
- [**Component**](Components.md): A package that bundles one or more LoopBack
70-
extensions.

docs/site/DataSources.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ A `DataSource` in LoopBack 4 is a named configuration for a Connector instance
1212
that represents data in an external system. The Connector is used by
1313
`legacy-juggler-bridge` to power LoopBack 4 Repositories for Data operations.
1414

15+
![Datasource diagram](imgs/datasource.png)
16+
1517
### Creating a DataSource
1618

1719
It is recommended to use the [`lb4 datasource` command](DataSource-generator.md)

docs/site/Repositories.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ A `Repository` represents a specialized `Service` interface that provides
1010
strong-typed data access (for example, CRUD) operations of a domain model
1111
against the underlying database or service.
1212

13+
![Relationship among Repository, DataSource and Model](imgs/repository-datasource-model.png)
14+
1315
{% 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." %}
1416

1517
{% include tip.html content="A single model can be used with multiple different Repositories." %}

docs/site/imgs/datasource.png

56.7 KB
Loading
202 KB
Loading
51.8 KB
Loading

docs/site/sidebars/lb4_sidebar.yml

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,10 @@ children:
3232
url: Server.html
3333
output: 'web, pdf'
3434

35-
- title: 'Context'
36-
url: Context.html
37-
output: 'web, pdf'
38-
39-
- title: 'Binding'
40-
url: Binding.html
41-
output: 'web, pdf'
42-
43-
- title: 'Dependency injection'
44-
url: Dependency-injection.html
45-
output: 'web, pdf'
46-
children:
47-
48-
- title: 'Reserved binding keys'
49-
url: Reserved-binding-keys.html
50-
output: 'web, pdf'
51-
5235
- title: 'Controllers'
5336
url: Controllers.html
5437
output: 'web, pdf'
5538

56-
- title: 'Components'
57-
url: Components.html
58-
output: 'web, pdf'
59-
6039
- title: 'Interceptors'
6140
url: Interceptors.html
6241
output: 'web, pdf'
@@ -200,6 +179,32 @@ children:
200179
url: Serving-static-files.html
201180
output: 'web, pdf'
202181

182+
- title: 'Behind the Scene'
183+
url: Behind-the-scene.html
184+
output: 'web, pdf'
185+
children:
186+
187+
- title: 'Context'
188+
url: Context.html
189+
output: 'web, pdf'
190+
191+
- title: 'Binding'
192+
url: Binding.html
193+
output: 'web, pdf'
194+
195+
- title: 'Dependency Injection'
196+
url: Dependency-injection.html
197+
output: 'web, pdf'
198+
children:
199+
200+
- title: 'Reserved binding keys'
201+
url: Reserved-binding-keys.html
202+
output: 'web, pdf'
203+
204+
- title: 'Components'
205+
url: Components.html
206+
output: 'web, pdf'
207+
203208
- title: 'Booting an Application'
204209
url: Booting-an-Application.html
205210
output: 'web, pdf'

0 commit comments

Comments
 (0)