geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Wilkins <gr...@mortbay.com>
Subject [jsr77][core] Components & Containers.
Date Mon, 15 Sep 2003 03:51:04 GMT

[ sorry if this is a duplicate - original post has not turned up after a few hours ? ]

I am still uncomfortable with our base component and container
classes.  I find that I can never remember what they all do and
end up reading code to work out the differences.

But, hopefully most of it can be solved with some renaming and/or
a minor restructure.

Currently we have

     <<StateManageable>>
        ^
        |
     AbstractStateManageable
        ^
        |
     AbstractComponent ---------->  <<Component>>  <------- SimpleComponent
        ^                                ^                     ^
        |                                |                     |
     AbstractContainer ---------->  <<Container>>  <------- SimpleContainer


I find these names difficult as they do not indicate the differences
between the Simple and Abstract trees.   So firstly I like to
propose that we rename:

    SimpleXxx    to  AbstractXxx
    AbstractXxx  to  StateManageableXxx


So we will get:

     <<StateManageable>>
        ^
        |
     AbstractStateManageable
        ^
        |
     StateManageableComponent --->  <<Component>>  <------- AbstractComponent
        ^                                ^                     ^
        |                                |                     |
     StateManageableContainer --->  <<Container>>  <------- AbstractContainer


I think we could also change the structure so that StateManageableComponent
extends AbstractComponent and StateManagerContainer delegates to AbstractContainer:

                                                <<StateManageable>>
                                                     ^
                                                     |
                                                AbstractStateManageable
                                                     ^
                                                     |
   <<Component>>  <--- AbstractComponent  <---  StateManageableComponent
        ^                 ^                          ^
        |                 |                          |
   <<Container>>  <--- AbstractContainer -----o StateManageableContainer
            ^                                    /
             \                                  /
              ----------------------------------


This restructure could also be done without the renames, so that
AbstractXxx would be an extension/delegator of SimpleXxx.  But I like
these names better.

I would also like to move the DependancyService code out of AbstractStateManageable
and put it into StateManageableComponent.   AbstractStateManageable would just
be an enforcement of the jsr77 state machine transitions, it would not implement
the mechanism for those transitions (which for StateManageableComponent use the
Dependency service, but other StateManageables may use other mechanisms).

I don't think this is a change of style rather than substance, so it
should not break anything.  I hope that it presents a clearer picture of this
core class hierarchy and I'd also spend a bit of time on the javadoc for
these classes to make their purposes clear.

I'm going to start work on this shortly, so please yell sooner rather than
later if you object.  I wont commit until there is some positive feedback.

cheers




Mime
View raw message