You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This plugin installs some schematics which automate slicing your Nx workspace into domains and layers according to Nrwl's best practices and our ideas about [client-side DDD with Angular](https://www.softwarearchitekt.at/aktuelles/sustainable-angular-architectures-1/):
4
+
5
+

6
+
7
+
The generated access restrictions prevent unwanted access between libraries respecting layers and domains:
To see that the skeleton works end-to-end, call the generated feature component in your ``app.component.html``:
47
+
48
+
```html
49
+
<booking-search></booking-search>
50
+
```
51
+
52
+
You don't need any TypeScript or Angular imports. The plugin already took care about that. After running the example, you should see something like this:
53
+
54
+

55
+
56
+
## Generated Structure
57
+
58
+
The included schematics generate a folder for each domain. This folder contains feature libs as well as a library with the domain logic:
59
+
60
+

-**application:** Contains application services. This is a DDD term for what we call facades in Angular nowadays. They orchestrate everything for a use case given so that a feature component only needs to communicate with one such facade. Also, it hides details for state management. While the generates facades just use a ``BehaviorSubject``, feel free to add a library like NGRX underneath. As such a modifications changes nothing from the component's perspective, you can use facades to introduce NGRX later on demand.
69
+
-**entities:** Client-side data model including logic operating on it (like validations).
70
+
-**infrastructure:** Services for communicating with the backend.
As the access restrictions defined with Nx use linting, you can check against them at the command line too. Hence, you might consider including this into your automated build process.
75
+
76
+

77
+
78
+
## Example Application
79
+
80
+
see https://github.com/angular-architects/ddd-demo
81
+
82
+
## Credits
83
+
84
+
-[Nx](https://nx.dev/web)
85
+
-[Nrwl's eBook about monorepos and best practices](https://go.nrwl.io/angular-enterprise-monorepo-patterns-new-book)
86
+
-[Recording of session about this architecture](https://www.youtube.com/watch?v=94HFD391zkE&t=1s)
87
+
-[Article series about DDD with Angular](https://www.softwarearchitekt.at/aktuelles/sustainable-angular-architectures-1/)
88
+
-[Our eBook about this architecture](https://leanpub.com/enterprise-angular)
89
+
-[Thomas Burlison's article about facades in Angular](https://medium.com/@thomasburlesonIA/push-based-architectures-with-rxjs-81b327d7c32d)
0 commit comments