service - Where does DTOS as InputModel / ViewModel Fit in Layered Archicture -
i'm trying understand inputmodel , viewmodels fit @ 4 layer architecture.
presentation | application | domain | infrastructure
given application layer takes care exchange data beteween presentation layer , domain layer, supposed that, must live inside layer, adapter convert domain entity , vice versa.
inputmodels, know commands, in asp.net mvc can coincide viewmodels.
makes no sense me viewmodels inside presentation. application layer should return viewmodels presentation , receive viewmodels mapp domain entity. if have viewmodels inside presentation, , presentations refers application layer, have loop reference.
and also, example, if have presentation build asp.net mvc , have necessity change windows application lost viewmodels fit on requisites, shame, given have built in change presentation technology.
i'm reading book dino esposito , andrea saltarello, microsoft .net: architecting enterprise. don't talk application layer, that, 1 should orchestrate domain services , repositories fullfill user cases, , hide domain presentation.
is right? should put dtos inside application layer? if not, fit on lasangna?
dtos should defined in whichever of 2 layers higher in dependency food chain, avoid circular references. mean application layer in onion / hexagonal architecture, because dependencies point inward -- presentation references application. don't know other layered architecture styles. alternatively, place dto's in own separate layer referenced 2 others , stand above them.
Comments
Post a Comment