Daniel Cazzulino's Blog : MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder

MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder

Today I presented a webcast on p&p ObjectBuilder (OB), the underpinning framework powering CAB and EntLib v2.0.

I'm afraid I tried to cover too much ground and the result was a pretty fast and maybe hard to follow session. I think it would have been much better to do an OB introduction webcast alone, and then another one on how to extend it.  My apologies for that. I'll appreciate your feedback.

I showed some examples of how to use OB programmatically, as well as how to extend it. You can download the source, which is fairly big as it contains Pico.NET and Spring.NET in addition to OB itself. Also, you will see a side-by-side example of Fowler's MovieFinder example running in all three frameworks, so you can appreciate the differences.

 

posted on Friday, April 21, 2006 3:23 PM by kzu

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Sunday, April 23, 2006 6:42 AM

Hi Daniel,

I really liked the web cast on Object Builder. While it was nice to see a practical example of its use in CAB, it would help me more if you focused on an example like your BuilderContainer. It's there that I feel like you could show us more on how to use object builder in our own applications. Also like to see an example of how to use the locator and lifetime container, and how they relate. Also like to see an example of how to insert / find things in the locator/container. One of the things we'd like to do is use an object context for our business objects, and be able to find them (by custom key) if they are already loaded etc.

Great job overall. Thanks so much for this and I really look forward to more web casts from you - I find it very helpful.

Steve Miket
CBS Televison

Steve Miket - CBS

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Sunday, April 23, 2006 1:56 PM

Hi Daniel,

I was only able to partially follow your webcast because I had some sound problems with Media Player. After debugging the damn thing I did find the plugin which caused me the trouble. Could you post when/if avaliable a link where the recorded session can be viewed again?

Yours,
Alois Kraus

Alois Kraus

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Sunday, April 23, 2006 9:01 PM

Great feedback Steve. I'll try to arrange another webcast with a stronger focus on using OB standalone.

kzu

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Monday, April 24, 2006 2:35 AM

Hi Daniel

Good job in doing an overall presentation of ObjectBuilder. Actually one of the first I have seen. Thanks for that.

However as you noticed yourself it would be great if this cast is going to be in two session. One introduction where ObjectBuilder (DI concept) is explained and how it is used in different projects (CAB, EL 2.0).
Next session on extensibility of ObjectBuilder, maybe starting out with CAB and EL 2.0, since HOW they use the ObjectBuilder is actually quite different in my opinion. Finishing session two of with "How to create and integrate your own builder" topics.

As user (still on rookie level) of ObjectBuilder in my own application (WCF Services), I would have enjoyed to see more scenarios in which the ObjectBuilder could be utilized.
Basically I need to answer my "inner voice" question:
I have implemented my own builder. The work it performs does the right stuff, but did I implement it correctly?

Anyway. Thanks for sharing your knowledge and keep up the good work. Hope you can use the feedback I gave you.

Regards

Henrik

Henrik Gøttig

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Tuesday, April 25, 2006 8:04 AM

My team like Steve is interested in using ObjectBuilder for building business objects. We are thinking of having a custom implementation through which we can do data mapping, caching, and lazy loading of data from the database. In your opinion which implementation (CAB, EntLib, Farcaster) is the best starting point for guidance on using ObjectBuilder in this fashion?

Damian Reeves

# Object Builder Sample @ Wednesday, June 21, 2006 2:53 PM

I just came across a great sample application using the PAG's ObjectBuilder (OB) framework. Daniel...

Anonymous

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Thursday, July 06, 2006 1:51 AM

Hi Daniel,

I really liked the webcast and thank you for the example code. I have been using Dependency Injection for about 3 years, mostly my own simple framework (constructor and setters) or Spring (Java and .Net).

What I really love about DI is:
- the loose coupling of the use of interfaces in code, and not having to deal with the wiring

- your code does not know about the existence of a DI framework because the code gets injected/called through the same mechanism as if you would have called it manually.

- being able to change the wiring for different situations, like unit testing, integration testing and production, wwithout having to change any code.

I tried Object Builder when it came out, but switched back to Spring because the documentation was implying (to me)that ObjectBuilder is more of a pluggable DI Framework-Framework, than a DI Framework, and I did not find an out of the box Xml configurable DI option.

I do like the pluggable features of ObjectBuilder, but currently do not have the time to write my own implementation.

IMHO the attributed approach is not very flexible, since you would have to change attributes to change injection. (I mostly use constructor injection)

Spring does not need attributes for constructor DI and chooses the constructor that you configure in xml, which is a far nicer way IMHO, because you don't have to change code (attributes) when you want to use another constructor.

Do you need to always attribute constructors if you want to use constructor based injection?

Just a couple of questions, on the side by side comparison code. Why do you programmatically add the dependency configuration? Would that not be even more work than just manually wiring up the objects? or is this just to show the differences between the frameworks.

For instance, you could replace all the configuration code in the MovieApp.cs file (about 11 statements) in Spring.Examples.MovieFinder with:

MovieLister lister = (MovieLister)ContextRegistry.GetContext().GetObject"MyMovieLister");

That is how you would normally use Spring.

I looked at the ObjectBuilder before and could not find a default xml configuration implementation. If there is one I would like to give ObjectBuilder a try. I love the way Spring works in this aspect.

The thing I feel that is lacking with the ObjectBuilder is ease of use and documentation. With Spring I just need to configure in xml and get my context.

I am sure that this could be achieved with ObjectBuilder as well and I hope this wil be available soon.

Raymond Roestenburg

# re: MSDN Architecture Webcast: Extending Microsoft patterns & practices ObjectBuilder @ Friday, July 28, 2006 4:41 PM

Muy bueno!!!
Tengo que ver como se configura con el XMLConfigurator.

Segui haciendo webcast asi... me facilitan mucho :)!

Gracias!!!

Mariano Vicario