On Wed, 20 Feb 2002 10:10, Michael McKibben wrote:
> I've been finding myself wishing for a Context.put(key,value) on the
> Context interface. Why does Context only have a get? 

because that was the minimum interface that the concept of Context supported. 
If you look at how it is used - most projects will define a sub-interface of 
it. For instance phoenix has a BlockContext (which is largely read-only) 
while myrmidon defines a TaskContext (which is writeable and readable). 

So for the moment I would suggest you do something like

public void contextualize( Context context )
{
 _context = (MyContext)context;
}

and add any auxilliary methods to the MyContext interface.

> It seems that you can
> still support an unmodifiable Context by just throwing an exception (ala
> an unmodifiable java.util.Map). I know supporting this change for the
> immediate future would be bad since this will break any Context impls out
> there (although, in practice don't most people just use DefaultContext?)
> but how about for 5.0? It just bugs me having to pass the Context impl to
> methods that need to populate the context. I would rather just have to
> change code in one spot if I need to swap out a Context impl.
>
> So, what do you guys think? It's just *one* more method :)

Unfortunatley it is not really an option for avalon4.x due to backwards 
compatability but I think it would be a good idea to reexamine it for the 
next iteration.

-- 
Cheers,

Pete

-----------------------------------------------------------
 Don't take life too seriously -- 
                          you'll never get out of it alive.
-----------------------------------------------------------

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

Reply via email to