This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
A little Background: I have a requirement to allow the end user of our Struts application to design their own inventory groups. For example, they could configure a group called Clothing and they could select from a pre-defined list of group attributes like color, size, sex, condition, etc. Based on their selection, the inventory entry screen would only show the fields related to the attributes "assigned" to this particular group. Hence, the screen for inventory items of type Clothing would display the fields for color, sex, and condition, where as the inventroy screen for items of type, say, Baseball Cards, would only see attributes for condition, year, etc. Fields displayed correspond to attributes assigned during setup.
Going Forward: Can someone point me to some resources (design patterns, etc) that would allow me to start analyzing this requirement more thoroughly?
I can imagine each product object has a set of attributes, each attribute has a name, value and type, each type has an editor that can build one GUI field and validate user input. The editor might include a list of valid values (dropdown) or rules like "Number between 1 and 1000". I'd guess lots of GUI builder tools have done this over the years, but I don't know any published "pattern" for it.
See the recent thread on Prototype Pattern. You could construct one BaseballCard object (from specs in a database?) and then clone() it when somebody wants to make a new one.
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi