Mehdi Nabizadeh
Mehdi Nabizadeh

Reputation: 24

Services and Repository in Clean Architecture

I use Clean Architecture in Asp.net Core. My Layers are: *UI *Ioc *Domain *Data *Application

In First I Define Model Classes In Domain Layer and Define An Interface For each Model. then i implement the Interfaces in Data Layer. It's OK After It in Application Layer I Define new Interface for Models and then implement Interfaces in this layer With the methods in Repository Classes in Data layer. In this layer i can use logic and condition while in Data Layer I Avoid From Logic.

is this Architecture Good? and when i have a simple Model With CRUD Operation I should Copy Interface in Domain Layer to Application Layer and then implement Services. i confused for this copy paste in this Architecture. what's your opinion?

-Picture

Upvotes: 0

Views: 3472

Answers (1)

Heron Yang
Heron Yang

Reputation: 336

"The purpose of a good architecture is to defer decisions, delay decisions." -- Clean Architecture

It's hard to say if your design is good or not without knowing what problem you're trying to solve.

  • If an architecture solves the problem, it might be good enough for now.
  • If an architecture defers the decisions that you have make in the early stage, it's good.

Upvotes: 0

Related Questions