• 114 Posts
  • 613 Comments
Joined 2 years ago
cake
Cake day: April 21st, 2024

help-circle
















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



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