Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 24437 invoked from network); 20 Oct 2003 23:29:23 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 20 Oct 2003 23:29:23 -0000 Received: (qmail 29173 invoked by uid 500); 20 Oct 2003 23:29:04 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 29146 invoked by uid 500); 20 Oct 2003 23:29:04 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 29133 invoked from network); 20 Oct 2003 23:29:04 -0000 Received: from unknown (HELO trex.powerpool.ab.ca) (209.115.254.215) by daedalus.apache.org with SMTP; 20 Oct 2003 23:29:04 -0000 Received: by trex.powerpool.ab.ca with Internet Mail Service (5.5.2653.19) id <4T1HZXN7>; Mon, 20 Oct 2003 17:30:05 -0600 Message-ID: <856668DB01E31240A2E83717CC57F5670F9E03@atlas.ta-alberta.ca> From: Anthony.Mutiso@aeso.ca To: commons-user@jakarta.apache.org Subject: RE: [BeanUtils] Mapped properties, this maybe a bug? Date: Mon, 20 Oct 2003 17:29:49 -0600 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > -----Original Message----- > From: Craig R. McClanahan [mailto:craigmcc@apache.org] > Sent: Monday, October 20, 2003 3:16 PM > To: Jakarta Commons Users List > Subject: Re: [BeanUtils] Mapped properties, this maybe a bug? > > > Anthony.Mutiso@aeso.ca wrote: > > >Thanks David for the response. > > > >I guess then the real questions is why is the silent read-only > >assumption the default behavior? Or why not keep looking for setters > >even after the first one that comes up does not match the expected > >signature? > > > >If the non-polymorphic behavior is required rather then convenient, > >then of you have other conflicting signatures, maybe a log4j > warning to > >save other poor souls from hours of debugging? > > > >Not that I require this at present, but I could see a > situation where a > >property has both mapped and scalar behavior especially in an index > >world, ala prop(Name) and prop.config.address. > > > > > > > > The approach for mapped properties was copied from the way that > JavaBeans works for scalar and indexed properties. None of them > supports the type of name polymorphism you are describing, > and lots of > code that talks about "JavaBeans" assumes that you know this > kind of the > rule already, because it is so universal. > > To know precisely what a JavaBean is, the simplest thing to > do is skim > the JavaBeans specification. For the question at hand, > you'll want to > study the chapter on properties pretty carefully. > http://java.sun.com/products/javabeans/ Craig, I am sorry, this has created more smoke rather then cleared the air. On a quick review of the javabeans 1.01 spec an index property does support getters and setters for the complete array. void setter(int index, PropertyType value); // indexed setter PropertyType getter(int index); // indexed getter void setter(PropertyType values[]); // array setter PropertyType[] getter(); // array getter (Chapter 7, Page 41 of the PDF version of the spec). So if BeanUtil supported mapped javabeans follow a similar patterns is it not reasonable to expect a Map getter() and maybe even a void setter(Map map). (Now I really wonder what happens with Collection classes as indexed properties, can one say Object getFoo(int index); and List getFoo();). Maybe it's all that trobbing in my head that is confusing me. At this point it's now only a matter of seeking enlightenment and a way to make the headache go away.... :-) Anthony --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org