We are worki开发者_开发百科ng on changing an old project to a new technology. We decided to use EF + WCF + WPF with a SOA aproach.
After some research we decided to use the following architecture:
- EF for the database operations (CRUD) - on the server
- DTO for data transport (here we have 2 mappings: DTO-EF & EF-DTO).
- the business objects will be on the client - classes implementing the WPF interfaces(IEditableObject, INotifyPropertyChanged, etc) (here we put again two mapping transforms - DTO-BO & BO-DTO)
- the validation will be part on the client side, part on the server.
Can someone tell me if this is a correct aproach for a average size enterprise app and if not what is wrong.
Two comments:
Having both DTO and BO seems unnecessary, you can make DTOs to implement INotifyPropertyChanged and cut out the middle man. You will also create ViewModel classes on top of these, it will become quite unmanageable soon. It is also prone for mapping errors.
You haven't mentioned about using any mapping libraries for DTO<->EF copy. Consider using AutoMapper or ValueInjecter.
精彩评论