Niclas Hedhman wrote:

On Tuesday 10 August 2004 22:55, Sylvain Wallez wrote:


Niclas Hedhman wrote:


I know far too little about Spring in general (i.e. never worked with it)
and GBeans in particular (i.e. have not read enough), to be able to
provide a good answer.

As for Spring, I think the apparent convergence between Merlin and Spring
is based on two different starting points. Merlin starting out as a
Model-driven architecture, with strong typing, a strong IoC as its base,
where as Spring started out with making IoC-style out of JavaBeans.


Mmh... can you elaborate on the meaning of "model-driven" and "_strong_
IOC"?



Strong IoC is in reference to ECM that allows you to look up any component on the fly, no matter if such dependency has been declared or not. Merlin otoh, will not allow lookup() of non-declared dependencies.



Ah, ok. So this is about security and proper use of dependencies.

It seems to me that dependency injection, compared to lookup, solves this problem in the an elegant way by suppressing it, since a component no more has access to a component locator.

Model Driven = Merlin builds a model of all the participating components. Merlin will satisfy the declared dependencies, implicitly or explicitly, within the model, prior to deploying (note, deploying != instantiation, as that is determined by the lifestyle) the components. If the dependencies can not be fulfilled, deployment will not occur. This approach minimizes the runtime problem that can occur, with adhoc resolution of component dependency resolution.



Although this is very good from a robustness point of view, I don't feel at ease with this as it requires to somehow manage dependencies twice: in the model where they have to be formally expressed, and in the code where actual lookup occurs. Again, depencency injection (as opposed to lookup) avoids this problem.


You said that Merlin is going to support injection, which IMO a very good thing. My remarks are mainly about the Avalon Framework APIs which now seem so old-fashioned compared to newer approaches to IOC. Sure, Avalon kicked ass when it was invented and was very ahead of its time, but things have evolved since then (dynamic proxies, AOP, etc) and people have learned from what was brought by Avalon.

I hope this clarifies my PoV.



Yep. Thanks a lot!

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Reply via email to