Service registration

Topics: Web Client Software Factory
Jan 22, 2007 at 7:48 PM
Is there a way to register a module or global service outside the module? The only way to do this today is to in the AddModuleServices function in the ModuleInitializer. It would be great if this could be defined outside the main module assembly, for example in a xml config file. The reason I want this is that I do not want to have my service implementations in the same assembly as the main module, for example I would have a number of data repository interfaces defined in the main module assembly but the actual implementations would go in a another assembly.

//
Torkel
Jan 22, 2007 at 8:46 PM
I totally agree with you, and in fact mentioned this in a recent blog post (http://www.dotnetblogs.co.uk/Default.aspx?tabid=137&mid=550&ctl=ViewEntry&EntryID=291 - at the bottom under "the future").

My feeling is that modules should specify what services they require, but configuration should supply the concrete implementations.

Can I suggest you create an issue for us to vote on?

Simon
http://www.dotnetblogs.co.uk/
Developer
Jan 23, 2007 at 2:44 AM
Hi,
With the current implementation of the Composite Web Application Block, you cannot define services in configuration. To do it, you would have to extend the block to have a service that would read the configuration, for example. If you think that this is important for you, please feel free to open an issue as Simon pointed out, so we can evaluate and prioritize the feature for future releases or publications for the community.

Please take into account that you can have services implemented in a separate assembly - just create a separate project and implement the services there, add a reference to it in your module assembly and in your module initializer register the service.

Cheers,
Mariano Szklanny
http://staff.southworks.net/mariano
Jan 23, 2007 at 8:00 AM
Yes I guess you can have the implementation in a separate assembly, but then the module assembly must reference that assembly which has irritating side effects like the interface definitions and model types needs to be defined in a separate assembly to avoid circular dependencies.

Having the service registration in a configuration file decouples assembly dependencies, the main module will not need to reference any concert implementation. I think this will also increase the composability of the architecture.

I will create a issue for this so we can vote on it.

/Torkel
Jan 23, 2007 at 8:17 AM
There is now a issue for this: http://www.codeplex.com/websf/WorkItem/View.aspx?WorkItemId=7540
Jan 23, 2007 at 9:08 AM
I'll vote for this.