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
1 vote
0 answers
19 views

Should input adapters receive the domain model?

This article on Medium addresses the scopes of the domain model in hexagonal architecture. I have sketched the following generic hexagonal architecture: On the one hand, the secondary/output adapter ...
user946822's user avatar
0 votes
2 answers
119 views

Clean Architecture with Microservices

I'm fairly new at system architecting and I'm looking for some advice. My company is revamping its order management system. Currently is a monolith system that scales very poorly and is difficult for ...
ArcSpark76's user avatar
0 votes
1 answer
59 views

Designing Clean Architecture(Hexagonal) for a Spring Boot Application : Project Layout and Class Organization

I'm currently in the process of integrating Clean Architecture into my Spring Boot project and I'm seeking advice on the ideal project structure and the types of classes and projects that should be ...
shiningStar's user avatar
1 vote
1 answer
49 views

UI or Application layer responsibility - retrieving additional data for display

I have an application service that retrieves Order data. The service is consumed in UI, where it can be edited by users. Additionally, the users wants to see related data such as ordered products' ...
Liero's user avatar
  • 141
0 votes
1 answer
79 views

Clean architecture for file upload in a flutter app

I have started a flutter app and want to apply clean architecture to it. The first use case i have is the following: A user provides file(s)via "open file" dialogue. The provided files ...
Jim Panse's user avatar
  • 348
2 votes
2 answers
201 views

hexagonal architecture vs clean architecutre

I am trying to improve the architecture for my React app project that has grown in size lately. I'm looking at Hexagonal architecture and Clean architecture, and I couldn't really see the difference ...
rickvian's user avatar
0 votes
2 answers
185 views

Clean Architecture: Loading data for the domain layer

Let's say my domain has a User Entity that has a many to many relationship with itself representing "Friends" public class User { public int Id; public IEnumerable<User>? ...
MyUsername112358's user avatar
0 votes
3 answers
127 views

Can the application layer extend the domain models?

I write BFF (Backend For Frontend) and it's domain is to provide user info and microservices integration. The User domain model looks like below: public class User { public required Guid Id { get; ...
Szyszka947's user avatar
0 votes
2 answers
113 views

Domain Project and Identity Project circular dependency

I am currently working on implementing the Clean Architecture pattern using Entity Framework. However, I've encountered an issue related to the design of my Domain project. In this project, I need to ...
pakerinjo's user avatar
0 votes
1 answer
144 views

Clean architecture - how to manage use cases that depends on external apis

How to apply clean architecture concepts in a software that depends on External APIs. Example: A business that offers some kind of subscription to its users. Its convinient to store some subscription ...
Drealler's user avatar
0 votes
1 answer
65 views

Communicating unpredicted Failure from Repository implementation to Applicaiton Layer

My application follows Clean Architecture wherein the Application Layer wraps the Domain Layer. I try to adhere to DDD more-so as a "guiding light" than a strict rulebook. Within the Domain ...
John Hall's user avatar
  • 163
9 votes
4 answers
3k views

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 ...
Mehdi Charife's user avatar
0 votes
3 answers
519 views

Clean Architecture and Access Control

I'm working on a .Net core API for product configuration and ordering. The ticket for Permissions has come up and I've been tasked with developing a solution, ideas of middleware have been mentioned. ...
Tod's user avatar
  • 103
-1 votes
1 answer
78 views

Split or join two use cases that are similar in Clean Architecture

In my working project I have a CustomerRegisterUseCase, that has following steps: validate email is already in use; hash password; save customer in temporary table(tranfered to customer table after ...
Caio Filus's user avatar
1 vote
1 answer
148 views

deciding where to put "formatting" logic - database or in application layer

We have an application that fetches user data from an Azure tenant via MS Graph. We need to distinguish between guests and regular members. Guests come back with Usernames that look like this: ...
dot's user avatar
  • 531
1 vote
2 answers
559 views

Where to place a common database connection in clean architecture?

I am currently trying to follow the clean architecture approach but i wonder where common things like a database connections should take place. Since i think a database connection usually will be ...
Jim Panse's user avatar
  • 348
0 votes
0 answers
77 views

Access one usecase into another usecase

I am working on machine learning project. I use jupyter for quick prototying. Now I am trying to convert it into concrete python project using clean architecture. entities/ - problem.py # ...
winter's user avatar
  • 101
2 votes
1 answer
824 views

Clean Architecture Use Case and db transactions/unit of work

I've started working on a LoB application (as a learning exercise) while trying to express business logic with use cases from Clean Architecture. First use case is customer onboarding where client can ...
milan's user avatar
  • 21
1 vote
1 answer
768 views

Build a Rust project using Clean architecture and DB transactions in the same DDD bounded context

This is just an example of an (still incomplete) real-world project written in Rust using a clean architecture: https://github.com/frederikhors/rust-clean-architecture-with-db-transactions. Goals My ...
Fred Hors's user avatar
  • 121
0 votes
1 answer
197 views

Decoupling modules of a monolith

As part of an migration from .NET Framework to .NET Core we're looking to decouple elements of our monolith into more manageable modules. Ideally following a clean architecture/DDD/microservice ...
Andy Cox's user avatar
  • 103
0 votes
1 answer
198 views

Separating Application (Business Logic) Layer to Multiple Module Layers in Clean Architecture

Currently, I'm designing the Project based on Clean Architecture composing with 4 layers: Domain Application Infrastructure Presentation Since the project is pretty huge, I'm now considering to ...
Steve.NayLinAung's user avatar
1 vote
1 answer
366 views

Is it normal to use multiple repositories in one viewmodel?

Does it violating any conventions? Is it acceptable by MVVM? I have to separate the local data repository and online repository, but for login I have to use multiple repositories for getting response ...
Бодя павук's user avatar
0 votes
1 answer
655 views

DDD - How to avoid validation rule duplication

From what I understand of DDD, my entities and value objects should be able to enforce its own invariants, meaning that its constructors will check for nulls, must contains numbers and letters, ...
Douglas Monteiro's user avatar
2 votes
1 answer
272 views

How to restrict the construction of a domain object to an external service?

I have this object RelativeFoo{int relativeCode, Origin relativeTo} And I want to map it to this other object AbsoluteFoo{int absoluteCode} In order to do this, I need to use a service whose ...
Douglas Monteiro's user avatar
0 votes
1 answer
185 views

Domain Modeling / Architecture

I'm experimenting with some projects at the moment and I am stuck trying to decide on the correct approach to this question. Given a simple architecture like this consisting of Domain - (Person and ...
Justim Odendaal's user avatar
2 votes
1 answer
410 views

How much logic can the infrastructure level hold in Clean Architecture

I am trying to wrap my head around the concepts of Clean Architecture, and specifically about the responsibility of the Infrastructure layer. Its purpose is often described as "to provide ...
lemerek759's user avatar
2 votes
1 answer
576 views

In Clean Architecture, how do we name UseCases that get more and more specific without the names becoming too long?

All the examples of Clean Architecture that I see have very simple use cases, such as: OpenAccountUseCase DepositMoneyUseCase However, real world applications have much more complex logic. Let's say ...
MSOACC's user avatar
  • 935
1 vote
0 answers
141 views

Typescript Clean Architecture: How to tackle use case that needs multiple repositories?

I am implementing clean architecture in my new back-end project and getting stuck with a particular use case. I have a CreatePhysicianUseCase what is responsible for creating a new physician user in ...
z0mbieKale's user avatar
0 votes
0 answers
395 views

How to pass the entity's domain to the repository layer - clean architecture and spring JPA

According to Should I use a layer between service and repository for a clean architecture - Spring the Peristance layer is deprecated because the Repository is already an abstraction. UML solution of ...
Adri's user avatar
  • 101
0 votes
3 answers
200 views

Is Microservices a means of implementing Clean Architecture through technological constraints, just way more expensive?

I spend a lot of time lately talking about Microservices architecture and I have a really hard time buying all the benefits that are sold to me. For most arguments I hear I come to the conclusion that ...
nepa's user avatar
  • 264
1 vote
0 answers
202 views

Angular standalone components architecture

I am trying to understand the benefits/gains of using standalone components in a real project that my team and myself included are working on, and from my very humble point of view, I just can't see ...
Andres2142's user avatar
0 votes
0 answers
300 views

Where/how does the conversion of entity objects to data transfer objects take place in Clean Architecture?

Prolog: I have a domain-layer which contains some entity-classes like Customer. I have a application-layer which contains some data transfer object classes like CustomerDto. My Problem: At a presenter ...
Cit's user avatar
  • 21
-1 votes
1 answer
176 views

Do usecase-class work with domain-model or data-model at cleanarchitecture?

I interessted in the "usecases" and "how they interacts with the "context" at "clean architecture". If I understand right, there will be two contexts. First is the ...
Cit's user avatar
  • 21
0 votes
1 answer
413 views

Clean Architecture : Application State

Given the following design from clean architecture in which layer would you put overall application state? In each state a subset of use cases are allowed to be invoked. For example if application is ...
hamid's user avatar
  • 9
1 vote
2 answers
830 views

Help implementing call to external API and store summary in my database in hexagonal architecture with DDD

Good afternoon. My situation is this: I have to call an external API to create some data and store it there, but I want to have a summary of that data in my own database. I have my use case that ...
TheEmpire12's user avatar
0 votes
2 answers
188 views

How to design software architecture without solid requirements?

I am working on a project which does not have solid requirements, All is we have meetings with all the teams across and confluence pages. No one owns any requirements and it just float around ...
uss's user avatar
  • 141
1 vote
0 answers
436 views

On which layer of Clean Architecture hierarchy must be the entities with application-specific properties?

From the answer to Must the use cases extend the entities in Clean Architecture? I have known that the use cases must NOT extend the entities. It's fine, but what do I have to do with the properties ...
Takesi Tokugawa YD's user avatar
0 votes
0 answers
183 views

Why the "Use Cases" and "Request and Response Models" are the different sections of the "Business rules" chapter?

From the answers on "Which Clean Architecture Areas do Gateways interfaces and their implementations belong to?" question I knew that gateways interfaces (well, the gateways are the ...
Takesi Tokugawa YD's user avatar
0 votes
0 answers
267 views

How to implement repository in clean architecture

I need to rewrite my project due to many underlying issues causing errors and I started following clean architecture by Uncle Bob (I read the book). I created my domain, infrastructure, application ...
z0mbieKale's user avatar
0 votes
0 answers
78 views

From the ECB & DAL perspectives, is this design acceptable?

I've been recently trying to go slightly further in arch. patterns (specifically layered arch.). I decided to go though an old project of mine (a CLI-based cinema reservation system) and evaluate my ...
Ahmed Alhallag's user avatar
1 vote
2 answers
236 views

Where to save entity metadata in a Ports-And-Adapters Architecture

I’m using a hexagonal/clean/ports-and-adapter architecture. For the sake of simplicity, I’ll only talk about domain and infrastructure here, where the infrastructure has dependencies on the domain but ...
Mirco's user avatar
  • 651
1 vote
1 answer
1k views

Must the use cases extend the entities in Clean Architecture?

Currently I don't understand the Use case concept enough good - too much abstract definitions but no particular examples. The section Use Cases of Chapter 20 Business Rules does not including any code ...
Takesi Tokugawa YD's user avatar
0 votes
2 answers
627 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 =====================...
Takesi Tokugawa YD's user avatar
0 votes
2 answers
279 views

Making a Data Layer that is tightly coupled to the Presentation Layer in Clean Architecture

So I've got a simple object recognition app in iOS. I am trying to create an Interface-Adapter for the machine learning / computer vision like this: protocol MachineLearningInterface { func ...
Bawenang Rukmoko Pardian Putra's user avatar
-2 votes
1 answer
197 views

Is it OK to use a Command Sourcing instead of Event Sourcing? Replay events in Commands-Repositories

I have a system that uses a graph database without any ORM, mapper or tool that tracks entity changes, like EntityFramework. I'm not using domain entities, instead I have an Event that calls changes ...
Augusto Will's user avatar
0 votes
2 answers
884 views

Is it okay for an Interface Adapter / Repository / Gateway to use Entities in its implementation

I've got these classes: enum Environment { case staging case production static func current() -> Environment { #if STAGING return .staging #elseif PROD ...
Bawenang Rukmoko Pardian Putra's user avatar
3 votes
1 answer
87 views

High level abstraction of file scanning service in domain driven design, and the implementations

My domain requires that a Resource (ubiquitous language for a singular unit of data to be moved - commonly a file or folder) can only be moved if it has been Scanned to ensure it does not contain any ...
Patrick Christie's user avatar
1 vote
0 answers
166 views

Business rule or repository implementation rule in Clean Architecture

I'm studying Clean Architecture with python and got into this "problem" of choosing where to implement a rule (that I considered a Business Rule, maybe I'm wrong) I have 2 Entities @...
Rodrigo Maller Martins's user avatar
1 vote
6 answers
1k views

TDD: testing an abstract class. Test all concrete classes or create mock sub-class to test the behavior?

Well, I'm developing a personal project using TDD and Clean Architecture, and I chose to build an abstract class to gather all use-cases behavior in one single class. My question is: What you think ...
Gabriel Antonio's user avatar
0 votes
1 answer
527 views

Clean Architecture for React App: Component / View / Page

Abstract I'm trying to figure out a solid, scalable, clean and practical architecture for react projects. As a a playground I have a project with two Screen and a JSON server. When I try to apply a ...
DarkTrick's user avatar
  • 207

1
2 3 4 5