Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Database Login in Clean Architecture?

I'm pretty new to Clean Architecture and like the principals. If we define data access interfaces and the implementation comes later that's all good.

In my case my application will have data from several sources. Now if I have a database instead of using the file system for the implementation, I will need a database login and therefore prompt a user. How does this fit in with Clean Architecture since the domain and application layers shouldn't know about implementation?Only implementing with a database brings a requirement for a login.

Cheers, Alan

like image 594
Chowhar Avatar asked Feb 26 '26 04:02

Chowhar


1 Answers

Accepting login data from user does not mean you expose domain to implementation details, it only means you get that input from presentation layer (and of course should save it in a secured way for later use) rather than save it ahead somewhere in your infrastructure layer.

In a way, ui client and infrastructure are similar, they are both considered as implementation details. That is why they are both presented in the same outer circle of the CA diagram.

like image 178
desertech Avatar answered Feb 28 '26 19:02

desertech