Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

composition?

 
david garcia
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 442
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic