Câu hỏi phỏng vấn Software Architecture
Câu hỏi

What do you understand by Clean Architecture approach?

Câu trả lời

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.

Core Principles of Clean Architecture

  1. 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.

  2. Testable: The business rules can be tested without the UI, database, web server, or any other external element.

  3. 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.

  4. 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.

  5. Independent of any external agency: In fact, your business rules simply don’t know anything at all about the outside world.

Layers in Clean Architecture

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.

Benefits of Clean Architecture

  • Maintainability: By separating the software into layers, Clean Architecture allows for easier maintenance...
junior

junior

Gợi ý câu hỏi phỏng vấn

expert

Why is writing software difficult? What makes maintaining software hard?

senior

What is the Dependency Inversion Principle (DIP) and why is it
important?

expert

What are heuristic exceptions?

Bình luận

Chưa có bình luận nào

Chưa có bình luận nào