Hi,

iPOJO provides different ways to handle optional (scalar) dependencies. When
a service is unavailable, iPOJO can inject:
- a Nullable object as in Dependency Manager
- null 
- an object from a default implementation


In the last option, iPOJO creates an object from the specified
default-implementation and injects this object when the required service is
unavailable. 


Clement

-----Original Message-----
From: Richard S. Hall [mailto:[EMAIL PROTECTED] 
Sent: jeudi 18 septembre 2008 22:27
To: [email protected]
Subject: Re: DependencyManager - dependencies restricted to interfaces

peter.doornbosch wrote:
> Hi Marcel,
>
>> Up to now I have not had anybody use it with services that are not 
>> interfaces, but I would not mind adding support for that. Obviously 
>> in that case I cannot support that null object pattern 
>> "automatically" anymore (automatically meaning me creating a proxy 
>> that does nothing) but I could:
>> a) let the user supply some kind of factory method to supply a proxy
>> b) add an option to completely turn off the creation of null objects
>> c) anything reasonably that's suggested here :)
>
>  (a) would be a good idea anyway, because it would make it possible to 
> use other null objects than the default ones the dep. mgr. provides. 
> For example, in some cases i would like to have a "null" object for a 
> LogService that prints to system out. Other examples are proxies that 
> throw exceptions on any invoked method, etc.

Agreed. This is a useful feature. We added something similar to iPOJO so 
that you can specify a "default service implementation" in such situations.

-> richard

>
> Regards
> Peter
>
>
> ---------------------------------------------------------------------
> 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]



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

Reply via email to