Vitor Medina Cruz wrote
> This is exactly my concern! Sure, for small stuff that is not a problem,
> but what if you have a big app?

I don't think it makes any difference. You have to decide in each case
whether an object is an internal (implementation detail) and therefore it
must be created from inside the class that uses it, or a dependency (or
peer) that should be passed as an argument. In the later case you
instantiate the object from the outside and hand it over to the object that
requires it. 
Most applications have a few major top level abstractions. Let's call them
subsystems. I would use more domain specific names in a concrete case but
this is a general example. These subsystems are instantiated at the entry
point of the application. If there are shared dependencies between them,
those are instantiated here as well. Then each subsystem can build up some
object graph that is required by the actual subsystem (Not everything needs
to know about everything else. There are clusters of objects that represent
domain level abstractions). The same things applies here as well. Some
dependencies are passed through (peers), others are instantiated (internals)
from the inside. This can go on and on further and it will result a fractal
like structure. The whole application is one object. It consists of few
other objects. Those object consists of further objects. In a typical Spring
application there is big blob of object soup with full of equivalent
objects, everyone can access to everything else and this fractal structure
is missing.



--
View this message in context: 
http://forum.world.st/Wiring-objects-IoC-and-Service-Locator-tp4949280p4950508.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

Reply via email to