In a multi-level project with a domain level level (DL) / Business (Service) Layer (BL) / Layer Layer (PL), the best approach for delivering objects to the presentation level?
DO => Domain Object; DTO = Domain Transfer Object; VM => View Model; V => View;
Option 1:
DL => DO => BL => DTO => PL => VM => V
This option seems to be best practice, but also seems hard to work with.
Option 2:
DL => DO => BL => DTO => PL => V
This option does not seem to be very good practice, but since the DTO is almost identical to the virtual machine, we can pass it directly to the view, and this is less painful for implementation and maintenance.
Is this option reliable for several layouts, for example, for mobile devices, I may need less information from BL, so for this particular layout I need another virtual machine?
asp.net-mvc entity-framework viewmodel dto automapper
Patrick Oct 13 '12 at 15:03 2012-10-13 15:03
source share