> -----Original Message-----
> From: Leo Sutic [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, 17 February, 2002 18:26
> To: Avalon Developers List
> Subject: RE: Son of ComponentManager
>
>
>
>
> > From: Stephen McConnell [mailto:[EMAIL PROTECTED]]
> >
> > Here is consolidation of the interfaces based on a logical extrapolation
> > of the conclusions reached under this thread:
> >
> >   interface Serviceable
> >   {
> >       public void service( ServiceManager manager ) throws
> > ServiceException;
> >   }
> >
> >   interface ServiceManager
> >   {
> >       Object lookup( String role );
> >       boolean hasService( String role );
> >   }
> >
> >   interface ServiceSelector
> >   {
> >       Object select( Object policy );
> >       boolean isSelectable( Object policy );
> >   }
> >
> >   interface ServiceResolver extends ServiceManager
> >   {
> >        Object lookup( String role, Object token );
> >        void release( Object object );
> >        void releaseAll( Object token );
> >   }
> >
> >   interface PooledSelector extends ServiceSelector
> >   {
> >       Object select( Object token, Object policy );
> >   }
> >
> > Over to you.
>
> Got the correction:
>
> interface Resolvable {
>   public void resolve( ServiceResolver resolver ) throws
> ExceptionThrownWhenLookupFails;
> }
>
> Where does the policy object in PooledSelector come from when a lookup is
> done through a ServiceResolver? Isn't it necessary to have:
>
>    interface ServiceResolver extends ServiceManager
>    {
>         Object lookup( String role );
>         Object lookup( Object token, String role );
>
>         Object lookup( String role, Object policy );
>         Object lookup( Object token, String role, Object policy );
>
>         void release( Object object );
>         void releaseAll( Object token );
>    }
>
> where the policy object is passed along to the selector if present?

This principal is that selection (brought about by the introduction
of a policy argument) is something that can be isolated under a separate
ServiceSelector implementation.  This means that the common ServiceManager
does not need to be polluted with selection semantics.  From an
implementation perspective this is a really good thing because we achieve
isolation the behaviour (no empty methods).  A selector implementation can
then apply local policy combined with supplied policy to do the selection
of an appropriate service.  The principal is the you "lookup" the directory
then apply "select" against the directory that is returned.

> Before I go and vote for this one, I would also like to hear more
> about Peter's release-less version. If that one works, we could have:
>
>    interface ServiceResolver extends ServiceManager
>    {
>         Object lookup( String role, Object policy );
>    }
>
> which is much cleaner. But it requires some other changes to the way we
> write components. See:
>
> http://marc.theaimsgroup.com/?l=avalon-dev&m=101392754607827&w=2
>
> and my response:
>
> http://marc.theaimsgroup.com/?l=avalon-dev&m=101395308809276&w=2
>

Agreed.

Cheers, Steve.





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

Reply via email to