I began trying to use Meta and Container in Fortress, and started to
look
at Merlin 2 on how to best do this. The Container interface exposes
methods
to the implementing container so that the kernel can do its magic.
There
are some things that look suspiciously like subversion of control that I
am curious about. First, the simplified interface that I would be happy
with is:
interface Container
{
void install( Profile[] profiles );
}
The reason is simple: information should flow inward, not outward.
Container
hierarchies should not be determined based on the kernel's viewpoint,
but
on the way that the developer sets it up. Granted, the current approach
allows
the kernel to set everything up, but let me illustrate why Fortress and
Merlin
have very different viewpoints on setting up the container hierarchy.
* Querying the state of the child
- Merlin's kernel queries the state of the child container, as opposed
to
knowing it.
- Fortress knows the state of the child container because the parent
container
set it. Information flows from the parent to the child (inward),
but no
information flows from the child to the parent (outward).
* True hierarchy vs. Flat hierarchy
- Merlin asks a container to create an instance of a child container,
presumably
so that it can directly manage it--or pass in the profiles.
- Fortress allows the containers to create whatever child containers
it needs.
It provides the framework that does not bind the container writer
into one
way of doing things. You don't even *have* to use the provided
Container
interface or the provided ServiceManager/ComponentManagers.
* Architecture specific constants
- Both Merlin and Fortress have architecture specific constants that
are passed
in (presumably by the context object). These constants are
container specific.
- Fortress deals with this by separating out the constants into
separate
interfaces instead of merging them.
Both Merlin and Fortress do work, but Merlin side-steps IOC by making
all containers
in a system as peers--at least that is how it looks. I would like to
understand
the thought processes behind the decisions.
"They that give up essential liberty to obtain a little temporary safety
deserve neither liberty nor safety."
- Benjamin Franklin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>