Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Lookup strategy question: need advice

807589Aug 15 2008 — edited Aug 15 2008
I'm designing a web application that pulls data from several different web services. Each service has its own enums, i.e. to represent a country, a particular service would actually send back a country code as a response to some call. These codes are proprietary per service. For example, in the case of the country Afghanistan:

Service1: ("Afghanistan", 1)
Service2: ("Afghanistan", 239)
Service3: ("Afghanistan", 87)

Additionally, I have my own list of country/ID, which creates a fourth mapping from string to int:

MyApp: ("Afghanistan", 56)

I need to be able to convert from a proprietary country/code mapping to mine for data pulls from the services, and vice versa for data pushes. My question is simply this: Can someone recommend the best strategy for storing and retrieving the information? In a MVC web application (using spring framework), how would you implement the lookups/conversions? I'm stuck on whether to use enum'ed ArrayLists or hash tables.

My application has database access; if I want, I can create a lookup table in the db as well.

Any feedback would be greatly appreciated!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 12 2008
Added on Aug 15 2008
2 comments
55 views