What do you understand by Clean Architecture approach?
What do you understand by Clean Architecture approach?
Clean Architecture is a software design philosophy that emphasizes the separation of concerns among the components of a software system. This approach was popularized by Robert C. Martin (Uncle Bob) and is intended to make software systems more maintainable, testable, and adaptable to changes in technology and business requirements.
Independent of Frameworks: The architecture does not depend on the existence of some library of feature-laden software. This allows you to use such frameworks as tools, rather than having to cram your system into their limited constraints.
Testable: The business rules can be tested without the UI, database, web server, or any other external element.
Independent of UI: The UI can change easily, without changing the rest of the system. A web UI could be replaced with a console UI, for example, without changing the business rules.
Independent of Database: You can swap out Oracle or SQL Server, for MongoDB, BigTable, CouchDB, or something else. Your business rules are not bound to the database.
Independent of any external agency: In fact, your business rules simply don’t know anything at all about the outside world.
Clean Architecture organizes a system into layers with distinct responsibilities, which are:
Entities: These are the business objects of the application. They encapsulate enterprise-wide business rules.
Use Cases (Interactors): These encapsulate application-specific business rules. They orchestrate the flow of data to and from the entities and direct those entities to use their enterprise-wide business rules to achieve the goals of the use case.
Interface Adapters: These convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as a database or the web.
Frameworks and Drivers: This is where all the details go: things like the UI, databases, frameworks, etc. This layer is kept separate from the business rules.
junior
Gợi ý câu hỏi phỏng vấn
Chưa có bình luận nào