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".
261 questions
2votes
2answers
2kviews
Refactoring a legacy codebase with a god Repository and incomplete Clean Architecture
I'm currently working on a large legacy project that tried to implement Clean Architecture combined with MVVM, but unfortunately didn't fully adhere to the principles. One major problem: The ...
3votes
1answer
190views
How do I handle polymorphic domain models in a Clean Architecture data access layer?
Let's say I'm making a space 4X game (because I am!) and I have an ISpaceObject interface in my domain layer, with a number of classes such as Ship, Starbase, Planet, Wormhole, etc. implementing it. I ...
1vote
1answer
105views
Split single repository/service into pieces in clean architecture?
I'm curious to know your opinion on how to organize code in services and repositories in the context of a three-layer architecture (controllers - services - repositories). Let's say there is a User ...
0votes
3answers
372views
Repository interfaces returning DTO in clean architecture used by query handlers
Repository interfaces are often defined in the Domain layer. This makes sense for command handlers, which call repository methods and return nothing. But what about query handlers that call repository ...
2votes
2answers
250views
How to handle pagination logic in a layered architecture without making premature decisions?
I'm working with a layered architecture and I'm unsure where to place the pagination logic. This answer suggests that it's not a domain concern, which I think makes sense. In most cases, pagination ...
2votes
2answers
448views
How should I implement data access with jpa to meet Clean Architecture/DDD
For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate. Do not use @ManyToMany or @...
4votes
5answers
272views
Clean Architecture - Chapter 23: Presenters and Views
Everyone! While reading Chapter 23 of the book Clean Architecture, specifically the Presenters and Views section, I came across something rather unexpected where Uncle Bob states: Every button on the ...
2votes
2answers
271views
Clean Architecture Chapter 8 - Financial Data Mapper
I’m studying Clean Architecture, and I came across a technical concept in the diagram from chapter 8. In this chapter, the author states that the Financial Data Mapper implements the Financial Data ...
0votes
0answers
63views
Where should validation be placed? [duplicate]
Recently I asked the following question regarding Clean Architecture with some things that were unclear to me: Clean Architecture using interfaces or Mediator approach? I think I have a better ...
3votes
1answer
250views
Clean Architecture using interfaces or Mediator approach?
I'm starting a new project and I want to follow a Clean Architecture(ish) approach. I've modeled my projects in that manner (attached diagram). For the API I'm using FastEndpoint since I like it, it'...
0votes
1answer
309views
Should I create interfaces for each entity, or should I use plain classes?
I’m currently creating a class diagram to develop an application following the “Clean Architecture” guidelines by Robert C. Martin. I’m unsure about how to structure the “Entity” component, ...
2votes
1answer
132views
Should our api-response-to-domain-entity transform functions be in the API/Infrastructure layer, or the Domain layer?
Should our api-response-to-domain-entity transform functions be in the API/Infrastructure layer, or the Domain layer? We have a react-native mobile application written in TypeScript. We have separated ...
2votes
2answers
348views
Advanced Scenarios in Clean Architecture
We have a very complex and mature ASP.NET web application that is about 20 years old and has 5 million lines of code spread across roughly 30 project in a single monolithic solution. It's running on ....
0votes
2answers
188views
How to handle data-intensive functionality of domain objects in Clean Architecture?
I'm going to ask this question using a concrete example. An optimal answer would take into account that this is just an example for the general problem. I'd like to implement a user management system ...
0votes
1answer
156views
SQLAlchemy (ORM) details in service layer in Clean Architecture?
I'm trying to decide how to hide data layer details (joinedload of sqlalchemy) in clean architecture. I have some dilemma about clean architecture. Please look at the code of some api endpoint (full ...