Craig,

Just got back from Holidays. Am I already late to party?
 How about `DynaActionForm' with unmodifiable map
`MutableDynaActionForm' with a direct modifiable map.

--
Peter Pilgrim,
Struts/J2EE Consultant, RBoS FM, Risk IT
Tel: +44 (0)207-375-4923


> -----Original Message-----
> From: Craig R. McClanahan [mailto:[EMAIL PROTECTED]
> Sent: 16 July 2003 20:30
> To: Struts Developers List
> Subject: Re: DynaActionForm.getMap() change
> 
> 
> 
> 
> On Wed, 16 Jul 2003, Rob Leland wrote:
> 
> > Date: Wed, 16 Jul 2003 14:58:45 -0400
> > From: Rob Leland <[EMAIL PROTECTED]>
> > Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> > To: Struts Developers List <[EMAIL PROTECTED]>
> > Subject: Re: DynaActionForm.getMap() change
> >
> > David Graham wrote:
> >
> > >DynaActionForm.getMap() returns the Map that the 
> properties are stored in
> > >without copying it to a new Map instance or wrapping it in 
> an unmodifiable
> > >Map.  IMO, we should treat that method with much more care 
> and return an
> > >unmodifiable view of the Map considering it's mainly to be 
> used in JSTL
> > >tags.
> > >
> > Does this solve a problem that you or others have 
> encountered in practice ?
> >
> 
> I can see where a use who retrieves the Map and then modifies it could
> accidentally (or on purpose) violate the type safety checks that the
> normal get() and set() calls provide for you.
> 
> > -Rob
> >
> > >
> > >Is anyone opposed to this idea?
> 
> My only concern would be the performance impact of this, 
> especially if it
> happens more than once in the same page (say, because you 
> used the same
> dynabean in more than one EL expression).
> 
> An alternative approach would be to do what someone else suggested and
> make DynaActionForm implement Map directly -- but make it effectively
> immutable by throwing UnsupportedOperationException for Map 
> method calls
> like put() and remove().  I don't *think* there are any 
> method signature
> overlaps that would cause us any grief.
> 
> > >
> > >David
> 
> Craig
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


***********************************************************************************
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
             Regulated by the Financial Services Authority

            Visit our website at http://www.rbs.co.uk/CBFM/
***********************************************************************************


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

Reply via email to