[TIL-5] The Clean Architecture

Entities

Entities encapsulate Enterprise wide business rules. An entity can be an object with methods, or it can be a set of data structures and functions. It doesn’t matter so long as the entities could be used by many different applications in the enterprise.

Use Case Layer

The software in this layer contains application specific business rules. It encapsulates and implements all of the use cases of the system

Controller

The software in this layer is a set of adapters that convert data from the format most convenient for the use cases and entities, to the format most convenient for some external agency such as the Database or the Web

Frameworks and Drivers layer

The outermost layer is generally composed of frameworks and tools such as the Database, the Web Framework, etc.This layer is where all the details go.

Real example

Conclusion

The center of your application is not the database. Nor is it one or more of the frameworks you may be using. The center of your application is the use cases of your application — Unclebob (source)

References

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store