On Sep 10, 2010, at 5:46 PM, Adrian Crum wrote: > --- On Fri, 9/10/10, Adam Heath <[email protected]> wrote: >> On 09/10/2010 04:46 PM, Adrian Crum >> wrote: >>> I have a feeling that will break a lot of screen >> widget/mini-language code. >> >> Removing implements Map, or fixing the implementation? >> >> I've seen code scattered around that checks if the Map is >> an instance >> of MapStack, and then does a push, falling back on wrapping >> the map in >> a new MapStack. Such code shouldn't break > > Let's cross our fingers. > > I understand your viewpoint and I'm not arguing against it. If MapStack > implements Map, then it should follow the Map contract - from a Java > developer's viewpoint. > > My concern is for the OFBiz user who is writing a simple method, and they > expect their changes to local variables to be local - not global. The OFBiz > user is not aware of - or concerned with - a "Map contract." > > -Adrian
You may not want to argue against this point of view Adrian, but I'd be happy to. Adam: sorry, but that interpretation of the Map interface for something like a MapStack is silly. The priority is how the MapStack should behave. I'd prefer to look at is in a conciliatory way that generally makes more sense. For example, sure the remove() is complete and a call to containsKey() would be expected to return false, UNLESS something else comes along and changes it first, and that's what the MapStack does. -David
