+1 if I had a vote :)

I will be curious to see how you decide to start.  Just off the top of my
head (and using my knowledge of PicoContainer) I would envision something
like...

public interface Concern {
    Expression passOnConcern(Container c, Expression exp);
}

public interface Container {
    void addConcern(Concern c);
    void registerComponent(Class componentClass);
    void registerComponent(Class componentClass, Object key);
    Object getComponent(Object key);
    Object getComponentOfType(Class type);
}

Then a call to registerComponent would create some sort of Expression and
run it through all of the Concern(s).  For example:

public interface Expression {
    Class getType();
    Object getValue();
}

public class SimpleInstantiationExpression {
    private Class klass;
    public SimpleInstantiationExpression(Class klass) {
        this.klass = klass;
    }
    public Class getType() { return klass; }
    public Object getValue() {
        try {
            return klass.newInstance();
        } catch (AllRelevantExceptions are) {
            throw new ReleventException(are);
        }
    }
}

The container impl could create a SimpleInstantiationExpression and all the
Concerns could decorate it as desired to add configuration, logging,
dependency management, etc.  I realize that this is most likely
oversimplified. :)



----- Original Message ----- 
From: "Leo Sutic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 10, 2004 11:37 AM
Subject: [VOTE] New sandbox project


> All,
>
> I'd like to start exploring the "aspect" container architecture
> by writing some code. There seems to be some interest in this
> type of effort - as usual it is of the "sure looks good, but is
> it even possible" kind (I ask the same myself), and there's
> only one way to really find out. I figure I should do my
> experimenting in public rather than privately, so that anyone
> interested can see what I'm doing, and therefore I want to
> do it in sandbox.
>
> I want to stress the following things:
>
>  1. This is not "yet another container". I think we all know
>     that such an effort would just send us off further into
>     La-la Land.
>
>  2. It will not be very mavenized, very feature-rich or
>     anything. If this thing starts to become even remotely
>     useful, it is time to stop.
>
>  3. As I see it, the only future it has is if I can make it
>     into something that we can re-build Merlin on top of.
>
> So I'd like to run a quick vote to make sure that what I do
> is in line with community consensus. Yes, I'm skipping the
> [PROPOSAL] part - just cast the votes and we'll see how it
> ends up.
>
> +1 from me, obviously.
>
> /LS
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to