aspose file tools*
The moose likes Java in General and the fly likes composition? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "composition?" Watch "composition?" New topic
Author

composition?

david garcia
Greenhorn

Joined: Nov 06, 2004
Posts: 5
Hello,

This is part of my xml file:




I was thinking if this is the best approach to design this, i think i could have a class Condition that "has a" Criterion (size, date, pattern...).




The problem i see is that anytime i add a new criterion in my xml file, i would have to create a new Class. Am i right?

Is this the best approach to do this?

Thanks in advance
Ta Ri Ki Sun
Ranch Hand

Joined: Mar 26, 2002
Posts: 442
Originally posted by david garcia:
SNIP


I would have it exactly as a code generator would give it to me if passed such an xml file, except I'd probably rename some of your properties.



You might not be using a generator now, or a tool that takes an xml file and populates an object for you, or visa versa, but who knows what you'd do in the future.
 
Don't get me started about those stupid light bulbs.
 
subject: composition?