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

213 questions
131
votes
7 answers

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 people implementing this architecture, returning the…
49
votes
3 answers

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

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. Here is where things get a bit strange: We have a…
49
votes
5 answers

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 core. This is one way to write good programs but…
Vedant Agarwala
  • 775
  • 1
  • 8
  • 16
35
votes
4 answers

Clean Architecture - Too many Use Case Classes

I'm going into Clean Architecture and lift my Android level from MVC to MVP, introducing DI with Dagger 2, Reactivity with RxJava 2, and of course Java 8. In MVP clean architecture there is a layer between the entities (in datastores) and the…
28
votes
4 answers

Difference between Domain Driven Design and Clean Architecture

I have been studying Clean Architecture (CA) by Robert C. Martin and have found it quite useful in promoting architectural standards for large applications. Through implementation of a case study, I have a bit of experience of how it can help build…
Matthew Knill
  • 403
  • 1
  • 4
  • 8
14
votes
1 answer

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 talking about: Lets say I have a small application…
David Mason
  • 321
  • 3
  • 7
13
votes
4 answers

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 views: a CLI and a Web, for instance. If you…
12
votes
3 answers

Should business logic be in the app or in the backend?

I've recently started applying the Clean Architecture while developing an Android application. And so I divided my application in 4 different parts. Data layer Contains the implementation of repositories. Device layer Contains implementation of…
11
votes
1 answer

Clean Architecture and Microservices

Our team is in the planning stages of creating an enterprise solution for our back office. Our goal is to have one singular entry point for common tasks, such as changing an address or reprojecting a loan (we're an FI). We want several front-ends…
Brian Chambers
  • 243
  • 2
  • 4
10
votes
3 answers

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 outermost layer (frameworks) to allow for it to be…
Kevin Streicher
  • 371
  • 1
  • 3
  • 9
9
votes
4 answers

Is it okay to have misleading struct and function names for the sake of encapsulation?

I'm writing this library in which the user can provide custom code defining the algorithm used for finding an optimal solution. In the papers that I have read, the targeted user thinks in terms of finding the hyperplane that maximizes a measure of…
9
votes
3 answers

Clean Architecture Gateway layer depends on outer layer

Looking at the clean architecture layers and flow diagrams, and implemented it my self in my applications, I've always wondered which layer is supposed to contain the DB, or any 3rd Party service or SDK. Looking at both of these images raises the…
oren
  • 257
  • 2
  • 6
9
votes
1 answer

How & Should we use Clean Architecture in Front-end?

Just a little explanation: "I'm used to be a solo front-end developer in my company and using default folder-structure and way of coding which vue-cli provided, it is good for a solo developer and small applications, but the project is going to…
9
votes
2 answers

In Clean Architecture, aren't Entities another type of Boundary?

In the Clean Architecture, Uncle Bob defines Entities as enterprise-wide business rules and Interactors (Use Cases) as application-specific business rules. Also, he describes that Interactors are responsible for the "dance of the entities", and in…
8
votes
2 answers

Why can't Entities leave the inner layers in the Clean Architecture?

I was reading about the clean architecture, and I don't get this part: Don't use your Entity objects as data structures to pass around in the outer layers. Make separate data model objects for that. As long as I don't let the entities leak out…
Luís Soares
  • 271
  • 1
  • 7
1
2 3
14 15