Defining a Robust SIlverlight 4 Architecture
This is my first SO question. I know there have been many topics on Silverlight and architecture, but have not found the answers that satisfy me. I am an ASP.NET MVC developer and used to work on architectures built using best practices (loose coupling with DI, etc.).
Now I am faced with a new Silverlight 4 project and would like to be sure that I am making the best choice as I am not experiencing. The main functions required by the applications are as follows:
- use an existing SQL Server database, but with the ability to move to the cloud.
- using EF4 to access data from SQL Server.
- : the ability to add new modules without changing the main host.
- loose coupling.
I watched various webcasts (Taulty, etc.), blogs about Silverlight and came up with the following architecture.
- EF 4 for data access (as required)
- WCF RIA middle tier services that control access to data for requests and the ability to support end-to-end validation, authentication, and data roles.
- MEF support for enabling modules.
- Unity 2.0 for DI.
The problem is, I don't know how to define a robust architecture where all of these elements fit together well. Should I use framework instead of Prism or Caliburn? But I'm not sure yet what scripts they support.
What's the best use for Unity in Silverlight? I've used IoC in ASP.NET MVC for loos connection and other things like interception for audit logging. It looks like Silverlight Unity doesn't support interception. I would like to use it to enable loose communication and allow roaming to the cloud as needed.
Thanks in advance for your help.
Best practice in Silverlight is actually (IMO) a bit of a myth. By definition, "Best Practice" refers to the practice that generates the best overall results (fast time to market, fast iteration of versions, low error rates, etc.). However, Silverlight 4 isn't even released, so it's really impossible to define what ended up being "Best Practice".
In addition to that, Silverlight itself and the technologies that surround it were very fluid and very new. With that in mind, that's my 2penny.
EF and WCF RIA Services will most definitely show up in your architecture if you create a LOB application. (While NHibernate instead of EF might be worth a look, I tend to bias towards MS components unless something else knocks it out of the park).
MEF most definitely deserves further study if you are in DI. This is the area that is most in demand now. I wouldn't be surprised to see Unity and Prism evolve to use MEF more to implement their various models. MEF is especially good at what you say.
source to share