Composite Web Application Block and Unity -- Update

Topics: Web Client Software Factory
May 2, 2008 at 1:36 AM
I posted article five in the series today. I think there will be at least two, maybe up to 4 more.
Check it out at Converting the Composite Web Application Block to Unity - Actually Adding Unity

Michael Puleio - patterns & practices
May 9, 2008 at 8:40 PM

MichaelPulio wrote
Let's roll back removing the Containers property, add the RegisterInstance and Resolve methods (that use a name) to the interface, test them, then add the CreateChildContainer method to the interface, and test it. Once we have those pieces, we can re-work ModuleLoaderService and DefaultModuleContainerLocatorService to use the new methods. Once we do all that, we can remove Containers from the ICompositionContainer interface without problems.

Do you have any high-level thoughts on how you would have approached the Containers property had it not been practical to re-work the applicable services? The reason I ask is because this won't be an option for the SCSF WorkItem (to many external components reference them)...

        ManagedObjectCollection<Command> Commands { get; }
        ManagedObjectCollection<EventTopic> EventTopics { get; }
        ManagedObjectCollection<object> Items { get; }
        ManagedObjectCollection<object> SmartParts { get; }
        ManagedObjectCollection<WorkItem> WorkItems { get; }
        ManagedObjectCollection<IWorkspace> Workspaces { get; }

May 9, 2008 at 10:18 PM
I'd look at what the Prism guys are doing, and hope for some inspiration.

Of course, the reason I got rid of the containers collection was that it was no longer necessary, as there are better ways to manage the containers. For things like Commands, SmartParts, Items, etc, you may need access to the collections. Of course, just because a method returns a ManagedObjectCollection does not mean it needs to store things in a ManagedObjectCollection. This could be a facade over something that plays better with Unity....

Let's move the SCSF conversations over to the other Discussion forum, in the future. I do (try to) monitor both forums (and a few others as well).

I hope that helps a bit,
Michael Puleio - patterns & practices