You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by Peter Donald <do...@apache.org> on 2001/04/23 08:08:36 UTC

[Framework] ContextException

Hi,

Just about to implement this. I figure that we stick with the pattern
established by Configuration and have exception thrown from Context.get() -
you can always manually rethrow a ContextException if it doesn't conform to
your context rules set.

One thing I was thinking about - should there be a method like

Object get( String key, Object defaultValue );

My initial reaction was to say no as a valid context should never return
null. The reason being that COntext is effectively part of
Container-Component contract and if that is violated then that means the
Container is Fubar. Anyone else have any thoughts?


Cheers,

Pete

*------------------------------------------------------*
| "Computers are useless. They can only give you       |
|            answers." - Pablo Picasso                 |
*------------------------------------------------------*

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org


RE: [Framework] ContextException

Posted by Leo Simons <ma...@leosimons.com>.
> Just about to implement this. I figure that we stick with the pattern
> established by Configuration and have exception thrown from 
> Context.get() -
> you can always manually rethrow a ContextException if it doesn't 
> conform to
> your context rules set.

I like what I did - see proposal =)

> One thing I was thinking about - should there be a method like
> 
> Object get( String key, Object defaultValue );

no. That's a violation of contract.

> My initial reaction was to say no as a valid context should never return
> null. The reason being that COntext is effectively part of
> Container-Component contract and if that is violated then that means the
> Container is Fubar. Anyone else have any thoughts?

I agree.

cheers,

LSD

---------------------------------------------------------------------
To unsubscribe, e-mail: avalon-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: avalon-dev-help@jakarta.apache.org