Questions tagged [clean-architecture]

Clean Architecture is a book by Robert C. Martin that contains solutions to architecting software solutions. Collectively these concepts are referred to as "Clean Architecture".

Filter by
Sorted by
Tagged with
120 votes
7 answers
62k views

Clean Architecture: Use case containing the presenter or returning data?

The Clean Architecture suggests to let a use case interactor call the actual implementation of the presenter (which is injected, following the DIP) to handle the response/display. However, I see ...
  • 1,335
40 votes
5 answers
22k views

Is "Clean Architecture" by Bob Martin a rule of thumb for all architectures or is it just one of the options?

I really liked the concepts in the video The Principles of Clean Architecture by Uncle Bob Martin. But I feel like this pattern is like a combination of Abstract Factory and Builder patterns at its ...
9 votes
4 answers
3k views

What should presenters return in Clean Architecture?

In Clean Architecture, a use-case calls a presenter, based on the agreed output object. When the presenter is called, it returns a ViewModel used by the view. That is fine until you have more than two ...
49 votes
3 answers
8k views

Using a "Pass-through (God) Service" is bad, right? [duplicate]

My team has developed a new service layer in our application. They created a bunch of services that implement their interfaces (E.g., ICustomerService, IUserService, etc). That's pretty good so far. ...
14 votes
1 answer
6k views

Clean Architecture: Should each view have its own presenter and viewmodel?

I am still thinking about clean architecture and just ran into a question regarding the higher levels (Views and Presenters) I am posting Uncle Bobs picture first here that you remember what I am ...
8 votes
3 answers
5k views

Clean Architecture: Dependency Rule and Libraries/Frameworks

In Clean Architecture by Robert C. Martin the dependency rule points strictly from the outermost layer/ring to the innermost. As an example a Dependency Injection Framework should lie on the ...
8 votes
2 answers
9k views

Doesn't repository pattern in clean architecture violate Dependency inversion principle?

From what I have read and seen clean architecture assumes that you have some entities which know nothing about persistence though at the same layer as they reside there might be an interface which has ...
  • 191
6 votes
3 answers
365 views

Where to convert primitive types in meaningful types in Clean Architecture / Onion Architecture

The book "Implementing Domain Driven Design" (page 361) suggests to use special types to distinguish several kinds of IDs, e. g. using BookId(1) instead of just 1 of type Int or Long. In my Clean ...
  • 816
4 votes
1 answer
3k views

Clean Architecture use case testing

Use case interactors in the Clean Architecture consists of the application specific business rules. Interactors uses the Data Access Interface to fetch the required data from the data access layer. ...
user avatar
1 vote
1 answer
280 views

In which layer should I load views on a Clean(ish) architecture?

I am trying to organize my architecture following the clean architecture while using some common practices/frameworks. I'm writing in PHP, but have no problem with other languages. The flow of my app ...
0 votes
1 answer
252 views

Clean Architecture: How to decouple the Repository from a CommandHandler?

We are just starting with event driven (and clean) architecture. So far we have two main entrypoints, a consumer (reader from a Redis Stream / Kafka Topic), and an API. As this is almost a modular ...
0 votes
2 answers
69 views

Which Clean Architecture Areas do Gateways interfaces and their implementations belong to?

Talking about gateways from the Clean Architecture, it is required to distinguish: The interfaces The implementation of these interfaces The TypeScript example: // === Interface =====================...
0 votes
0 answers
45 views

How big should database adapters/gateways be?

Outline When you build an Adapter that connects your application and the database, How big should you make this adapter? Should it contain all possible queries that could be made to the DB? Do you ...
  • 109