Since days I am reading and researching and still struggling how to create the perfect infrastructure. Since there are no Prism 4.0 templates as such, I came up with a strategy, but I need to be sure this is the right strategy and I would appreciate an advice from experienced PRISM/RIA developers.
I use PRISM 4.0, RIA Services 1.0 Sp1 Beta, Silverlight 4.0, Entity Framework 4.0
1) Client side
I created first a "Silverlight Business Application", which creates a Web.host and a Silverlight client application with implemented RIA authorization. The initially created Silverlight client application shall be used as the Shell project.
2) Infrastructure project (Common)
This project would contain some common Prism MEF attributes and perhaps the entity models that are auto generated by RIA as well as the Service Interface. The idea is to create a simple Silverlight Class Library, and under Properties of the project, I would select for the dropdown ‘WCF Ria Services Link ’ to point to the host.Web project that contains the Ria Services. Then after the rebuilding, I am able to see the entity models within the Class Library and these could then be shared between the prism modules to feed their ViewModels etc.
3) Service layer
Should I create the EF4 Model on the Web.host project and add the Domain Service in there? Then I would extract an interface from the Domain Service and put the interface into the Infrastructure (Common) project. The Web.Host therefore needs to reference the Infrastructure (common) project to get access to the interface. On the client side the interface may be used by MEF to retrieve or mock the service . However I am concerned about the service referencing a common project that contains also the client-side generated entities.
4) Authorization
Also a bit concerned about the authorization, shall I leave everything on the Shell project? Or do I have to move anything to the Infrastructure (common) project to share it?
Since this is my first time designing with PRISM, I might have misunderstood or forgotten some aspects. Please feel free to improve my suggestions.
Your help is highly appreciated
Kave