File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: composition?
 
Similar Threads
connection pooling Jboss 3.0
XML Parsing
getting Date input
What class to use for date-related calculations.
Getting the maximum of two dates and date comparison