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
2 votes
3 answers
197 views

Streams and clean architecture

I am pretty new to async programming and the whole stream stuff, since i have a web programming background with php, where async programming and streams isn't really a big topic most time. I try to ...
Jim Panse's user avatar
  • 388
0 votes
1 answer
66 views

Validation logic dependencies and separation of concerns

I am going back and forth on an aspect of our FluentValidation and MediatR pipeline behavior implementation. We receive requests which, in a Mediator pattern, are mapped to command or query objects, ...
BJ Safdie's user avatar
  • 103
-2 votes
1 answer
65 views

Clean code: formatting rules, dependent functions, multiple calls [closed]

About formatting Here are two scenarios in which the details of the formatting are described. How should in the clean code way, this be formatted Scenario 1: Dependent functions of dependent functions ...
user13047397's user avatar
12 votes
4 answers
5k views

Is there a clean way to model methods that only make sense depending on the current state of the object?

Let's say that I have a class called Mission. This class is intended to represent a mission requested by a professor working in a faculty. Mission has a private enum field representing whether the ...
Mehdi Charife's user avatar
0 votes
0 answers
46 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
197 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
248 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
68 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
153 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
  • 388
3 votes
2 answers
590 views

Key difference between Hexagonal Architecture vs Clean Architecture?

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
1 vote
2 answers
287 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
163 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
146 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
1 vote
1 answer
467 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
66 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
786 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
110 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
155 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
  • 541
2 votes
2 answers
822 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
  • 388
0 votes
0 answers
83 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
1k 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
2 votes
1 answer
1k 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
  • 131
0 votes
1 answer
216 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
266 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
410 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
835 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
0 votes
1 answer
317 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
226 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
486 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
874 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
154 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
445 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
222 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
270 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
360 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
205 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
525 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
948 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
207 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
470 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
298 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
1 vote
2 answers
266 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
3 answers
776 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
325 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
218 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
1k 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
95 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
175 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
2 3 4 5