I'm having trouble where to put our data model in our Prism 开发者_JAVA百科app. Most, if not all or our data will be coming from web services and the web services are unique for each module. Unfortunately, there will be objects that need to be shared (such as a person/user object).
I'm really torn about whether to add these services directly to the module, so that each is truly independent, or create a separate project to house the web service proxies and business entities.
The modules are being built by different teams, but will all live in the same solution (and source control, of course).
You will find the answer to you question to be subjective and each person may answer this a bit differently.
Personally I try to keep enough separation as I don't know where my requirements my change in the future. For example I might be be building a ASP.NET app and then asked to do a WinForm Version of the same thing.
Adding your model to an independent assembly allows you to reuse that assembly regardless of project type. So if I where building a Silverlight app or a Winform app I can use the same model.
But, I believe the heart of your question is if you should separate you data model for each web service into a different assembly. I think it's a bit of overkill to separate each out into it's own project.
I would make sure that the model is not dependent on the web services code, as if you change requirements in the future you may find yourself getting the data through another method.
The key area of separation for me are:
- Data Access Layer
- Business Object Layer (Model)
- User Interface Layer
精彩评论