Summarized Clean Code Architecture

The people who know about the “The Clean Code Architecture” might be very well aware of Robert Cecil Martin, popularly known as Uncle Bob

Uncle Bob is an American Software Engineer, a man with a mind behind several software design principles. He is one of the author of the book “Agile Manifesto”

Before moving forward and explaining about Clean code architecture it was an important thing to tell about Uncle Bob because he is the man behind Clean code architecture too.

Uncle Bob explained about Clean Architecture in one of his book “Clean Architecture: A Craftsman’s Guide to Software Structure and Design”

Where he explains architecture with segregated layers which will help in independent testing, and independent framework, databases, and interfaces

As per Uncle Bob’s Architecture, we can segregate our code in four layers :

  • Entities/domain: Entity layers consist of business logic which remains intact the entire time.
  • Use Cases/ Application: This layer contains application-specific business rules and implements use cases for business logic
  • Controller/Presentation/Adapters: In this layer, The software 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
  • Framework & Driver/Details: This layer is generally composed of frameworks tools such as the Database, the Web Framework, etc.

The Dependency Rule for Clean Code Architecture explained by Uncle Bob says -

Different areas of the software are represented by concentric circles.
Where, Inner circles are “Policies” and Outer circles are “ Mechanism”

The overriding rule that makes this architecture work is The Dependency Rule.

The rule says that source code dependencies can only point inwards.

Things in the inner circle will be unknown about the things in an outer circle i.e Nothing in an inner circle can know anything at all about something in an outer circle.

Uncle Bob also mentioned “You may find that you need more than just these four. There’s no rule that says you must always have just these four”

However, the only rule that applies is, Source code dependencies should always point inwards, and as you go inwards there is an increase in the level of abstraction. And low-level concrete details are in the outermost circle. Software grows more abstract as you go inwards, and higher-level policies are encapsulated.

Clean Code architecture is used when dealing with large project, In order to keep business logic intact and separating the files or classes into components that can change independently of other components

References :

https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html

--

--

--

𝘾𝙊𝙊 @ 𝙂𝙤𝙡𝙖𝙣𝙜 𝙎𝙥𝙚𝙘𝙞𝙖𝙡𝙞𝙨𝙚𝙙 𝘿𝙚𝙫𝙚𝙡𝙤𝙥𝙢𝙚𝙣𝙩 𝘾𝙤𝙢𝙥𝙖𝙣𝙮- Scalent.io

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Download YouTube video using Python in just 4 lines of code

How to Create a Dev Environment in Windows 10: Part 1

Retrofit — Common Errors Solved

Annotation Helper Attributes in TestNG

Best Online Video Editor: Lumen5

Observability using Elasticsearch and Neo4j

Crypto Hodlers NFT — Dev. Update 16.05.2022

TWiGCP “Back from Next ’19 !” #171

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
Reemi Shirsath

Reemi Shirsath

𝘾𝙊𝙊 @ 𝙂𝙤𝙡𝙖𝙣𝙜 𝙎𝙥𝙚𝙘𝙞𝙖𝙡𝙞𝙨𝙚𝙙 𝘿𝙚𝙫𝙚𝙡𝙤𝙥𝙢𝙚𝙣𝙩 𝘾𝙤𝙢𝙥𝙖𝙣𝙮- Scalent.io

More from Medium

How to explain the benefits of code reviews to non-tech people?

Liskov Substitution Principle

What is the clean code? (Part2)

Spend your time in Code Reviews, not in writing Tests