At 07:16  16/5/01 -0700, Harmeet Bedi wrote:
>Why not change the lookup method to take an interface rather than a string
>as a parameter.
>
>So it would be
>DataSourceComponent dataSource =
>    (DataSourceComponent)manager.lookup(DataSourceComponent.class);
>
>That way not only do you get the idiom without adding the 'ROLE' member, but
>also do a lookup for a role, and in Java one could argue Interface is Role.
>
>What do you think ?

That was discussed a while ago - there was two major problems with it. 

1. Some interfaces serve multiple roles. ie Both spool and store can have
the same interface but they have vastly different implementations. Now
there are some components that will need access to both (ie the processor
component that moves things from spool to store) which would not be
possible if access via interface. This problem however could be gotten around.

2. Classloader issues - it would considerably complicate classloader issues
for containers. Using strings means that ComponentManagers don't have to
worry about all these things however using Class objects means that several
layers of complexity would have to be added and ordering in kernel
operation. This can't be gotten around easily.

Cheers,

Pete

*-----------------------------------------------------*
| "Faced with the choice between changing one's mind, |
| and proving that there is no need to do so - almost |
| everyone gets busy on the proof."                   |
|              - John Kenneth Galbraith               |
*-----------------------------------------------------*


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

Reply via email to