This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "composition?" Watch "composition?" New topic


david garcia

Joined: Nov 06, 2004
Posts: 5

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:

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:
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