|
From: Paul S. <pau...@ne...> - 2002-02-06 13:47:10
|
Gavin_King/Cirrus%CI...@ci... wrote: [snip] >>It is also impossible for MappingByReflection to see inside lists, >>maps, and sets. Because they must be declared by their basic >>collection interface, the reflection code has no clue what they >>contain. >> > > Yeah, they should be left simply as stubs for the user to fill in. > Thats cool, if this tool does 70% of the work (the tedious work), > it already takes away 90% of the pain :) Perhaps we could use a similar approach to Beans introspection here - guess based on what methods exist. In beans you have a convention for naming indexed properties, there might be a broad enough generalisation we could apply here ourselves for guessing what's in a collection. e.g. for a List attribute blah, you might expect to find methods like addBlah( Foo ), removeBlah( Foo ) etc. and guess that blah contains Foo instances. I don't know if this works in the wider world, but perhaps worth considering something similar. We generally used method names based on the underlying collection class, e.g. for a List there's add, remove, list. For maps it's put/get, etc. Just an idea. PaulS. |