Home  /  Questions  /  Question



60   95.3
Jul 28, 2011


View models and accessing data in the presentation tier

I see that in the pattern's in action source you are using a Provider to sit over your data access as you are using the Provider Model to hot swap DALs based on config settings.

My current project we are using an SOA and all data coming into the presentation comes from services. We have 15 different services that we consume and we have put two layers of abstraction over the WCF proxies.

1) Service Proxy - this class is responsible for calling into services and allows us to mock services that aren't available.
2) Data Mapper - this class is responsible for mapping DTOs coming out of Service Proxy to View Models for consumption by the UI.

I'm working on a new stream on the same project and I wanted to revisit this a bit and improve the naming. Data Mapper doesn't feel right because it's not accessing a DB and the Fowler pattern is about DB access. Is there a better name for this? Provider doesn't seem right as it's too general and we aren't using the provider model (aka strategy and abstract factory).

Thanks,

Ryan



90   96.5
Aug 26, 2011
Hi ,

From what I understand is the DTO objects returned by your service proxies is turned into an View Model object that will be understandable by the UI?

If yes, "Adapter" could be the right word as you are trying to adapt the DTO to be understandable by View Model.

In that case it could be DTOtoViewModelAdapter or DTOViewAdapter something like that...

Please correct me if am wrong..

Thanks
-Tarriq Ferrose Khan