Re: [Springnet-developer] Ref: Microsft Object Builder
Brought to you by:
aseovic,
markpollack
|
From: Gaurav V. <gau...@gm...> - 2007-09-08 07:54:30
|
Great! Anxiously looking forward to it.... :) Cheers, Gaurav Vaish www.mastergaurav.com www.edujini-labs.com ------------------ Spoken Words Fly Away, Written Words Last Forever ------------------ ----- Original Message -----=20 From: Mark Pollack=20 To: 'Gaurav Vaish' ; 'Spring.Net Devlopers'=20 Sent: Thursday, September 06, 2007 17:16 Subject: RE: [Springnet-developer] Ref: Microsft Object Builder Hi, From the end user point of view it will be just as clean. I wouldn't = worry about the implementation details at the moment. The goal will of = course to be as feature complete, and probably more, (by type wiring, by = named, autowiring etc) than what object builder offers.=20 Cheers, Mark =20 =20 From: Gaurav Vaish [mailto:gau...@gm...]=20 Sent: Thursday, September 06, 2007 7:19 AM To: Mark Pollack; 'Spring.Net Devlopers' Subject: Re: [Springnet-developer] Ref: Microsft Object Builder =20 Hi Mark, =20 Thanks for the pointer... I do understand the tight-boundedness to = the attributes, but IMHO - that may be sometimes preferred. At least, = there's an option. =20 However, I do not, at least at this point in time, feel really = comfortable with the way it seems to be implemented -- implementing = IObjectFactoryAware and PostProcessPropertyValues -- seems very = cumbersome. =20 I find the Object-Builder a lot more cleaner approach. Having said = that I must also confess that I don't know the insights when you say, = "I've currently scheduled it for Spring.NET 1.2" -- possibly it's clean = there. =20 I'll just give a sample of how it can be used in Object-Builder: =20 1. Class with dependency (can be InjectionContructor, = InjectionProperty or InjectionMethod) =20 public class DependentClass { [InjectionContructor] public DependentClass([Service] IMyService service) { .... } } =20 2. Serivce implementation: =20 //Lazy initialization for a service of type IMyService [Service(typeof(IMyService), AddOnDemand =3D true)] public class ServiceImplementation : IMyService { ... } =20 and, that's it. =20 There are other ways also, but what I have is that my class is not = bound to (dependent on) anything except for these attributes, which I = think looks cleaner. =20 Cleaner... as compared to what I find the URL you pointed out, = which reads "[Inject("MyMovieFinder")]" -- which says that I must = register a type with a name MyMovieFinder and then must know the name of = the component at design time. =20 IMHO, binding should be on the type and may not be on the name. = Having said that, I would also say that one thought just came to my mind = -- let the "Service / Injection" be allowed to take a name - but = optionally. I can look for a specific implementation and may be leave it = for the default implementation. =20 Not sure if I made any sense for the readers... :) =20 Cheers, Gaurav Vaish www.mastergaurav.com www.edujini-labs.com ------------------ Spoken Words Fly Away, Written Words Last Forever ------------------ =20 =20 ----- Original Message -----=20 From: Mark Pollack=20 To: 'Gaurav Vaish' ; 'Spring.Net Devlopers'=20 Sent: Thursday, September 06, 2007 16:35 Subject: RE: [Springnet-developer] Ref: Microsft Object Builder =20 Hi, =20 Yes, there is. You will see this week this functionality added to = the Spring Java feature set. I've posted on the forum how one might go = about doing this now if you are interested in using the existing = extension points in the current spring.net container. The link is here = http://forum.springframework.net/showthread.php?t=3D3393 =20 =20 Just to note the trade offs, while there are pros to doing this, it = does tie your class to a specific library, that one that attribute, even = if you use that object in cases where the attribute is not read for any = purpose. =20 Hope this helps. Mark =20 =20 From: spr...@li... = [mailto:spr...@li...] On Behalf Of = Gaurav Vaish Sent: Thursday, September 06, 2007 6:23 AM To: Spring.Net Devlopers Subject: [Springnet-developer] Ref: Microsft Object Builder =20 Hi, =20 I still wonder looking at the configuration required to work = with SpringFramework.Net... =20 Why do we need to specify the injection properties / = constructors the way that we currently do in the configuration? =20 Are there any plans to make use of the Object Builder = (Dependency Injection) mechanism as provided in the Microsoft Object = Builder (part of Composite UI Application Block) -- using attributes... = This makes it a lot more convenient and elegant to work with. More = importantly, I get rid of a large part of configuration file.... =20 =20 =20 Cheers, Gaurav Vaish www.mastergaurav.com www.edujini-labs.com ------------------ Spoken Words Fly Away, Written Words Last Forever ------------------ =20 =20 |