I’m learning Composite Application Block and I’ve hit a rock about services. I have my shell application in its own solution, and of course a test module in its own solution (developed and testing completely independent and external of the shell solution). If I created a service named “Sql Service”, would I need to put this in its own library, so that both the shell and the module know the types?
If that’s the case, then for good practice, should I put the service project in the shell solution, or external just like a module (in its own solution), even though it’s not loaded as a module?
Then, what about references? Should the shell reference this directly, add then add the service? Or load it as a module and add the service?
Where should I create my services? Should I reference or load as modules?
If you have a service that you want to expose to two different assemblies, then what you should do is define the interface for that service in a separate assembly and share that between the two. Generally speaking, I always put services in their own assembly (project) and I put the interface definitions to those services in a separate assembly (project).
In the specific case of the CAB I would avoid exposing much of anything to the Shell unless it is absolutely necessary – only if the Shell itself has to use the service would I reference it in the Shell. The Shell should be bare-bones; it exists so that modules can show their own elements to the user. Individual modules can worry about referencing and utilizing the specific services.
As far as solution organization: Generally, when I am working on a CAB application, everything is in one solution. I have rarely had need for separate solutions. Separate projects, yes – but all under one umbrella solution.