I like the current model on how context objects are created and extracted
(lots of room for creating default values, etc.) In the majority of cases
we have encountered we can derive default values if nothing is declared.
The cases where we are currently throwing an exception is (a) conflicting
context information, (b) badly defined context information, and (c) internal
failures arriving from validating context and derived information in
sub-systems. Conclusion is that I don't think the operations on context
object need to change.
Steve.
> -----Original Message-----
> From: Peter Donald [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, 10 April, 2001 06:08
> To: Avalon Development
> Cc: [EMAIL PROTECTED]
> Subject: Re: Throwing exceptions during contextualization
>
>
> At 07:15 9/4/01 +0200, Ricardo Rocha wrote:
> >A component implementing Contextualizable may need to assert some
> >condition(s) on its context and throw an exception if such condition(s)
> >are not met:
> >
> > public class MyComponent implements Contextualizable {
> > . . .
> > public void contextualize(Context context) throws ContextException {
> > this.requiredComponent = context.get("required");
> > if (this.required == null) {
> > throw new ContextException("Required component missing
> in context");
> > }
> > }
> > . . .
> > }
> >
> >What do you think of creating a new ContextException and have the
> >contextualize(Context) method throw it?
>
> I like - except I would have context.get() throw the COntextException
> directly - thoughts?
> 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]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]