• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

design alternative

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Currently I am in the process of creating something for managing all Dropdown list data to be displayed in all our front end pages.
All the input data for populating such various dropdown list is available in a single xml file. So this xml file has data pertaining to all country list, all types of accounts etc etc which we need to display in several dropdown option list in various pages.
What we plan to do is read this xml (using some javatoxml utility like xmlbeans or castor) & create java objects for all the xml data.
Once we are done with this process we plan to store these parsed values into several hashmap's. So there will one hashmap each for county list , one for account types etc. So we will have one top level hashmap which will have key as countrycode & in value there will be hashmap of all countries then there will be a second key say accounttype & in its respective value will be a hashmap of all account types.

Once we have this top level hashmap ready , we plan to store this hashmap in cache & all our front end code will look into the cache to fetch their respective values of download list.

Do post your comments on the same.


Regards
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This sounds like a generally sensible approach. I'm slightly puzzled that you don't seem to have any lists or arrays mentioned in your design, only Maps. How do you propose to actually populate the entries in each "dropdown" from your cached data?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'd assume the leaf level map contains code & value that will go into the dropdowns with code hidden, values shown.

The single XML file bothers me a bit. I worked with something very similar, but it read database tables instead of XML. We could use the tables for referential integrity and export them to reporting tools and so on.

To tool also allowed further levels of filtering on arbitrary columns, like all the activity code-value pairs for usergroup X instead of just all the code-value pairs. We cached the code value pairs for a given query with critical columns of the query as cache key.

There's a bit of configuration to tell the utility that the first argument to "activities" is a constraint on the "usergroup" column. And "activities" is the name of a view that has the appropriate joins between the real activity and usergroup tables.

Whew. Don't know if that helped or not.
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic