Greetings,
We have built an extensive system and data framework api using interfaces and DI. For the data access, if the application is a Windows service/WCF service then a LINQ implementation of the repositories is injected at runtime using Castle. Client web/winform applications use the same Data controllers/domain objects but the implementation portions use injected WCF client classes for da开发者_C百科ta access. The cool part about this setup is that the client and server code can reuse the same domain objects, services and system logic by including the appropriate assembly with a few translations.
I have just now created a Silverlight application using the "Silverlight Navigation Application" template in VS2010. It seems the only way I can reference my desktop CLR code is via linked classes (add existing item/linked). There is not a boat load of plumbing classes, but there are some core classes that handle routing interfaces for emails, SMS messages, logging, and data access using the castle microkernel and application configuration files.
I can do grid displays and whatnot by binding the controls to the WCF service references. However, I would like to reuse the controller model for messaging, data access, logging and so on. I cannot determine if it is worth the time to try to fit all the existing classes into SL project classes or start thinking about somehow creating a new lightweight api for SL? Has anyone had experience with unity/castle and Silverlight?
In regards to "It seems the only way I can reference my desktop CLR code is via linked classes" you could always use a portable class library and it will work on everything from CLR, SL through to Xbox360.
精彩评论