Hi Jason I think that approach sounds great. I'm sure we could plug in a few different Strategy patterns so that folks can customize the XMLIntrospector to suit their needs. e.g. some folks like to use mixedCaseNames for bean properties and <mixed-case-names> style XML elements.
So go for it. BTW yes you're right, there's some duplicate code I introduced when implementing the loading of .betwixt files. I'm sure we can refactor that a bit cleaner to promote code reuse. James ----- Original Message ----- From: "Jason van Zyl" <[EMAIL PROTECTED]> To: "Jakarta Commons Developers List" <[EMAIL PROTECTED]> Sent: Sunday, March 10, 2002 5:17 PM Subject: [betwixt] Strategy for dealing with addXXX() methods > Hi James, > > I was just looking at a way for trying to deal with addXXX() methods in > a configurable way. I think I might have come up with a way to handle > it. > > While passing through the bean information in > XMLIntrospector.introspect() when discovering a loop type could we take > the name, say Hobbies, and apply a strategy to determine its singular > form? Then store that singular form for later use. > > So I could use a plural stemmer strategy that would turn Hobbies into > Hobby and then in the XMLIntrospectorHelper.defaultAddMethods() the > addHobby(Hobby hobby) would be matched up with Hobbies. > > We could maintain the current behaviour and possibly make these > strategies stackable so that different attempts can be made. This would > also allow things like i18n plural stemmers. > > I'm still trying to sort out some of the, it looks like there is some > duplicated code in the XMLIntrospector* classes but I'm not exactly sure > yet. > > But I think this method would work, I'll take any pointers. I think in a > few more hours I'll be able to give it a whirl if the approach is > acceptable. > > > -- > jvz. > > Jason van Zyl > [EMAIL PROTECTED] > > http://tambora.zenplex.org > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>