• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Data dictionary for displaying value objects

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I'm currrently working on a project in which we are pulling a set of value objects back from a data server and displaying the attributes of these objects in a JSP. The framework I am using is Struts 1.1.
The value object's attributes are mostly custom typesafe enums (see Effective Java, Bloch, p105) that Struts doesn't have a clue how to handle, as you'd expect.
Currently I am 'wrapping' the returned objects into a composite object that contains the returned value objects and provides me with accessor methods that convert the enums into Strings for displaying.
Although this is a quick and easy fix, does anyone have any suggestions on a more flexible approach? i.e. something that doesn't require me to write one wrapper class for each set of value objects returned. I've heard mention that a data dictionary might be useful, in which I map the contents of each value object within an XML file that defines the type of each field. I could then use a generic class to handle each object according to the definitions in the dictionary.
Can anyone point me to an example of this kind of solution?
 
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Nondescript",
Welcome to JavaRanch. We don't have many rules here, but one we do have is a naming policy. Please edit your display name to comply with this policy. Thanks in advance, and we look forward to seeing you around the Ranch.
[I see on the topic list on the main Saloon page that your name at one time showed up as "Carl Bradbury" and not "Nondescript".]
[ December 16, 2003: Message edited by: Jason Menard ]
 
A magnificient life is loaded with tough challenges. En garde tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic