cross-posted from: https://programming.dev/post/54023908
Hi!
I’ve never read any of Uncle Bob’s books. But I have taken interest in “Clean Architecture” as it seems like a good solution to make mid to large sized projects simple to understand and maintain.
I think MVC gets too much coupling and fails at larger projects, same with n-tier. But I’m not sure about anything right now (software design is a very complicated problem after all).
So I was wondering if you friends who have used Clean Architecture in production can share your knowledge and experience with me about this design?
Is it actually good and worth investing in?
Footnote:
I’m especially weighing this architecture because Uncle Bob’s writings are really hit and miss. I don’t see him as a master or guru so I take everything he says with a grain of salt.


The less you read of Uncle Bobs writings the better but Clean Architecture isn’t really his idea(the original was called Ports and Adapters) its just a name that he coined and it unfortunately stuck.
I think Clean Architecture is quite useful for the kinds of long-lived application development projects that you will usually encounter in larger companies. Its main appeal in my opinion is that it prevents your domain logic from becoming entangled with implementation details of the environment in which the software will run. This makes changing out dependencies easier in case you need to switch out some 3rd party services.
Another benefit of using such a well-known architecture in general is that you will have an easier time on-boarding new developers. In a clean architecture project it should be no question where to find, for example, the database context because it will obviously live in the infrastructure layer.
A drawback of this approach is that it can make an application more complex than it needed to be, especially if you are writing a smallish CRUD application that has little to no domain logic.
To me the clean architecture is a good default to start with for monolithic business applications, where requirements might change drastically in the future, but as with anything else it doesn’t fit every use case. So, don’t try to write the next high performance game engine with it.
Thank you for your explanation.
My work revolves mostly around large enterprise software, so I guess this fits me.
But can you elaborate why not write a game engine with it? Game engines are also very complex.
Do you say because of the performance hit of multiple layers of abstractions?
Yes, performance is one reason. Clean architecture uses indirect calls a lot. This doesn’t really matter if you are doing IO bound work like reading files and calling databases, but games do a lot of CPU bound work as well to simulate physics and update game state where all that indirection will waste CPU cycles.
I also can’t really think about a part of a game engine that I would put into the domain layer. The domain layer is the whole reason this architectural pattern exists and if you can’t define that clearly there isn’t a reason to use clean architecture.