Can someone explain? I'm trying to convert my wpf app mvvm into different layers (reading ddd). I have some small confusions
- Presentation Layer (WPF, WEB, API) (ok.. this I know )
- Entity Model (I know is the class that represent database table e.g customer {id,name,surname,phone} from Entity Framework
but the following confuse me
- Domain model (is the class that represent sql table columns? e.g customer {Id,Name,Surname,phone} or the class that make sense for my application e.g Customer {ID,FullName,Balance}
- Where domain model lives? in which layer (seperate dll ?, in service layer ? or in data repository dll)
- DTO (Data Transfered object) is it the same as domain model?
- Service Layer (is it a separate dll?)
- Business Layer (many times i see the word business layer, some refer it as service layer) what is it actually? is it the same? is it a different class? a different dll (layer) that has it's own responsibility apart from service layer?
- Data Repository (question is, if service layer or business layer should be implement in the same layer that repository lives)
with all the above i have make sample application trying to understand where each one goes.
STEPS I FOLLOW
- I have sucesfully understant the data repository. a simple interface with CRUD and or complex queryies
- I create a
IService
that implements and inherited from reposiroty - Now in wpf i have to reference the service dll, but wpf needs not only service dll but also repository dll because service layer is using it.
My Question on this is. Is It normal? shouldn't service be independent?
Should Service Layer used it's own models? and convert data repository models to service models? therefor wpf will not need reference to repository? ( but if so.. isn't duplicate work?)