Layered Libraries
The 'L' of MonoLISA.
MonoLISA achieves separation of concerns (SoC) with:
-
Layers to separate technical concerns.
-
Libraries to separate the concerns of actors.
Layers
Define a layer for each high-level technical concern.
Domain (business rules), API (endpoints), database (repositories), and integration (to downstream services) are examples of backend layers.
Create a folder for each layer in the libs folder. For example:
libs
- domain
- api
- db
- integration
Libraries
Create libraries for actors within the layers.
Actors
An actor is a role a user plays the moment they act on the system.
For example, if you are developing an email app, the user could be seen as an ‘inbox viewer’ actor when they view the inbox and a ‘draft editor’ when they write an email.
libs
- domain (layer)
- inbox (lib)
- draft-editor (lib)
- api (layer)
- inbox (lib)
- draft-editor (lib)
etc.