Design Architecture¶
Menoreh library use the design pattern SOLID Principle.
We split the project into multiple packages in order to maintain explicit dependencies for each package with clear boundaries that enforce the single responsibility principle. Modularizing our project like this has many benefits including but not limited to:
- Easy to reuse packages across multiple projects
- CI/CD improvements in terms of efficiency (run checks on only the code that has changed)
- Easy to maintain the packages in isolation with their dedicated test suites, semantic versioning, and release cycle/cadence
Layering our code is incredibly important and helps us iterate quickly and with confidence. Each layer has a single responsibility and can be used and tested in isolation. This allows us to keep changes contained to a specific layer in order to minimize the impact on the entire application. In addition, layering our application allows us to easily reuse libraries across multiple projects (especially with respect to the data layer).[1]
To use this library you have to understand
Architecture¶
Feature Layer¶
Feature Layers a design pattern that separates a software application's architecture into two layers: a feature layer and a solid layer. The feature layer contains the application's business logic and user interface, while the solid layer contains the application's infrastructure, such as data access and security. This separation allows for greater flexibility and maintainability of the application, as changes to the feature layer will not affect the solid layer, and vice versa.
├── lib
│ ├── core
│ │ ├── extensions
│ │ ├── languages
│ │ ├── themes
│ │ ├── utils
│ │ └── values
│ └── presentation
│ ├── routes
│ ├── widgets
│ ├── bloc
│ └── pages
│ ├── main
│ └── app
├── packages
│ ├── menoreh_domain
│ └── menoreh_data
├── assets
└── test
Domain layer¶
Domain Layer is the topmost layer of the architecture, which contains the business logic of the application. It is responsible for implementing the rules and logic that govern the application's domain, such as validation and business rules. The Domain Layer is isolated from other layers such as the data access and presentation layers, which allows for greater flexibility and maintainability of the application. This separation allows changes to be made to the Domain Layer without affecting the other layers, and also allows for testability of the Domain Layer in isolation.
Data layer¶
Data Layer is the layer of the architecture that is responsible for managing the application's data. It provides an abstraction over the data storage mechanism, whether it be a relational database, a NoSQL database, or a file system. The Data Layer is responsible for performing CRUD (Create, Read, Update, Delete) operations on the data, as well as any necessary data mapping or data validation.
├── lib
│ ├── core
│ │ ├── config
│ │ ├── exception
│ │ ├── failure
│ │ ├── usecase
│ │ └── values
│ ├── helper
│ ├── service
│ └── src
│ ├── datasource
│ ├── models
│ └── repositories
└── test