File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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


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?
jQuery in Action, 3rd edition