Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [clean-architecture]

The tag has no usage guidance.

1
vote
1answer
110 views

Clean Architecture - Should you inject all entity dependencies?

According to "Clean Architecture", should you inject all entity dependencies (should you inject core business logic)? For example, if I have a vector entity, should that entity be injected into all ...
4
votes
3answers
252 views

Clean Architecture - Where to put business calculations when entities are autogenerated db first efcore?

I'm trying to switch to clean architecture from a traditional layered architecture approach and trying to figure out where to put business logic. Please consider the below scenario - Employee class (...
3
votes
0answers
58 views

Clean Architecture - What is the difference between Use Cases and Core Services?

I'm trying to apply Clean Architecture to a simple ASP.NET MVC Core app by following Microsoft's ASP.NET architecture guidelines and their eShopOnWeb sample project. In the standard Clean ...
2
votes
2answers
136 views

How to create useful error messages in a JSON REST API without leaking implementation details across layers?

We're implementing a REST service with three main layers: Controller, Domain, Repository. The REST API is supposed to respond to error conditions with meaningful error messages. Suppose the general ...
0
votes
2answers
91 views

How to deal with reusable use case?

I'm trying to implement the clean architecture and I'm not sure to quite understand when to reuse interactors (use cases). Considering that we have one use case such as get user information and we ...
1
vote
0answers
126 views

Clean architecture - how can a component become a micro service?

I've read and enjoyed the "Clean Architecture" book. So the first thing I tried to do is to implement my project with it. Where I work we follow a design method called IDesign in which the ...
1
vote
2answers
218 views

Clean Architecture: Is the Input Boundary necessary?

In Clean Architecture boundaries are interfaces, which I model in Python with abstract classes. The input boundary, which is between the controller and the interactor/use case does not need an ...
4
votes
2answers
299 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 ...
1
vote
1answer
121 views

Clean Architecture: Calling a Usecase from the Controller

In the context of Clean Architecture, is the following execution path right? The controller sends a request model (input) to an interactor. The interactor executes a use case dependent on the request ...
2
votes
1answer
188 views

Clean Architecture: May the Controller talk to the Presenter directly?

From what I understand from the 'Clean Architecture', the controller determines which usecase to execute dependent on the input of the user. If the input from the CLI for example is invalid, the ...
1
vote
0answers
72 views

Clean Architecture Python Example: How to implement a Usecase/Interactor saving Data to a Database

I am struggling with the clean architecure. I have constructed a minimal example of how a usecase/interactor could talk to the database without being dependent on it: The use case: class ...
0
votes
3answers
127 views

Can an entity include “technical” (not business related) information?

I want to to follow a clean architecture rules (with domain and architecture layers). I have a problem with properties that an entity should or should not have. Let's say that I have a User domain. ...
1
vote
1answer
78 views

Domain Use Case

In my understanding of Uncle's Bob Clean Architecture, a Use Case (Interactor) is responsible for orchestrating the Entities. At the same time, it represents Application-specific rules. The business ...
4
votes
2answers
122 views

Inject package protected (internal) classes at runtime

I am referring to Robert C. Martins book "Clean Architecture" on the top of page 318. There he states: In the ports and adapters approach, the OrdersService and Orders interfaces have inbound ...
1
vote
1answer
380 views

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 ...
2
votes
4answers
400 views

How to adapt Clean Architecture to a rich desktop application

I'm just learning about clean architecture and I'm trying to design a proof of concept for an application I want to build soon. In the Clean Architecture the Presentation layer and the Domain Model ...
5
votes
2answers
480 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 ...
4
votes
2answers
363 views

Interface Segregation Principle in Clean Architecture

In Chapter 10 of Clean Architecture, Martin gives an example for the Interface Segregation Principle. I have some trouble understanding that example and his explanations. In this example we have ...
45
votes
3answers
7k 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. ...
4
votes
2answers
341 views

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 ...
1
vote
1answer
176 views

Use case interactions in clean architecture

I'm experimenting with Clean Architecture for my turn-based strategy game project. I have use cases that form hierarchies and need to be coordinated with each other. I would like some advice on how to ...
1
vote
2answers
908 views

Clean architecture, CQRS, and authentication?

I'm working on implementing my first clean architecture and CQRS application, I've stumbled across a bit of logic that's leaving me a bit stumped. I'm working on integrating authorization and ...
1
vote
1answer
75 views

Common Code for Transformation of an Entity

My api is exposing information centering around an entity Company. Companies are complex, and can contain Vendors directly, or can contain sub-companies which contain vendors themselves. A consumer ...