This is an app for taking inventory which can later on be sold and produces records of sales. It is implemented as an offline system as of now.
- Room Persistence library - An ORM library used for data persistence
- Coroutines & Flow API
- MVVM Clean Architecture - A way to structure a project to support scalability and testability
- SOLID principles - Design concepts to maintain clean code.
- Dependency Injection with Dagger Hilt
The figure below depicts the moving parts of a clean architecture system
- Presentation : This is the layer that bundles the UI related components. In our app, all our fragments, activities and their activities are packaged into this layer.
- Data : Whatever source of data our application is going to use will all be abstracted in this layer.
- Domain : This layer maintains the business rules and logic for our application.
- Greater decoupling of code which in turn enhances testing and reusability.
- The project is more understandable even to visitors.
-
Single Responsibility Principle (SRP) Every software artifact should have only one single responsibility - reason to change. Code that is depended upon by other artifacts should be separated.
-
Open-Closed Principle A software artifact should be open for extension but should be closed for modification.
-
Liskov Substitution If you have class B which inherits class A, wherever class A is being used, you should be able to use class B without breaking the flow.
-
Interface Segregation To prevent a class from implementing methods it does not even need, it is best to many small small interfaces that the class can implement according to its functionality.
-
Dependency Inversion Artifacts should depend on abstractions rather than concrete implementations.