• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

what pattern is this.....?

Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure what to call this pattern-could someone help- For our validation on Objects-We are using standard java beans(not ejb's) that "set" the data, before the actual Access Bean is used to create,update,or delete the EJB. The problem was that we had "lots" of data to validate, and were looking for a way to validate it more "dynamically."
Each java bean(not ejb) has a "validator" class which basically has all of the valiation logic. Each method in the validator class can but does not always map over to the java bean getter methods. Somae validation values are loaded into the validator class via properties files(not the best design). Due to the significant number of fields in the java bean, we used the reflection api to dynamically validate all of the fields by calling the getMethods of the java bean class against the getMethods of the validator class. If the two match(with some string manipulation), we call getvalue on the java bean method and the corresponding validate method that checks the value. The result is that when we add validation methods to the validator class, there are no changes outside of that class(ie I don't have to code for it elsewhere). Also, methods that we don't want validated, we simply don't add to the validator class.
Is this even a pattern? Does this resemble any existing patterns?
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Give a look at JUnit's web site ! JUnit in itself is not what you ask for I believe but there is plenty of extensions which you could use for your problem !
Could you post your findings about yr problem on the site or directly ot me ?
I am Arthur, King of the Britons. And this is a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic