471,627 Members | 1,692 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,627 software developers and data experts.

Solution for storing a lot of web app configuration ?

Hi,

I'm currently developing an HR system which involves storing a lot of
configurations per module, such as payroll module, absence/shift
module, training module, etc. total: around 100 configuration items.

Configurations here, ranging from a simple key to value pair, a key to
multiple values, and a key to several records of a / multiple values.
Let me give an example to clarify this:

* [Key to value] Percent of X tax to deduct from employee salary = 5%.

* [Key to multiple values] Limit (days) of employee taking a leave
between: 1 - 5.

* [Key to several records of a / multiple values]
a. Employee level entitled to one holiday per month: Manager,
Supervisor, Vice Manager.
b. Regulation on annual tax deduction: Manager -> 1%, Supervisor -> 2%,
Vice Manager -> 3%.

My current solution is to store all those configurations in a table,
e.g tbSETUP, which roughly has these fields:
Key <= this is the ID for the setup, not unique (hardcoded in app)
Value1 <= this is value number 1
Value2 <= this is value number 2 .. until 5.

Everytime I need to read these configuration, I will have to query the
table with the appropriate Setup ID and convert the value to my desired
data type, such as integer to include calculation. And this is becoming
so tedious typing it all over again.

Is there any elegant solution for storing and reading all these
configurations, or at least save time from converting all the
configuration value type?

I've tried googling a while and found some interesting topic on this
matter, a little bit similar to my situation, (such as serialize in xml
files, creating custom class xml, etc.), but I think this will be more
or less the same with my current solution.

Any opinion is appreciated :)

Thank you,
Hendry J

Dec 5 '05 #1
2 1303
I think custom classes that can be serialized / deserialized into XML is a
good solution. Here's an article that touches on a similar topic:

http://www.eggheadcafe.com/articles/20051013.asp

Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"he**********@gmail.com" wrote:
Hi,

I'm currently developing an HR system which involves storing a lot of
configurations per module, such as payroll module, absence/shift
module, training module, etc. total: around 100 configuration items.

Configurations here, ranging from a simple key to value pair, a key to
multiple values, and a key to several records of a / multiple values.
Let me give an example to clarify this:

* [Key to value] Percent of X tax to deduct from employee salary = 5%.

* [Key to multiple values] Limit (days) of employee taking a leave
between: 1 - 5.

* [Key to several records of a / multiple values]
a. Employee level entitled to one holiday per month: Manager,
Supervisor, Vice Manager.
b. Regulation on annual tax deduction: Manager -> 1%, Supervisor -> 2%,
Vice Manager -> 3%.

My current solution is to store all those configurations in a table,
e.g tbSETUP, which roughly has these fields:
Key <= this is the ID for the setup, not unique (hardcoded in app)
Value1 <= this is value number 1
Value2 <= this is value number 2 .. until 5.

Everytime I need to read these configuration, I will have to query the
table with the appropriate Setup ID and convert the value to my desired
data type, such as integer to include calculation. And this is becoming
so tedious typing it all over again.

Is there any elegant solution for storing and reading all these
configurations, or at least save time from converting all the
configuration value type?

I've tried googling a while and found some interesting topic on this
matter, a little bit similar to my situation, (such as serialize in xml
files, creating custom class xml, etc.), but I think this will be more
or less the same with my current solution.

Any opinion is appreciated :)

Thank you,
Hendry J

Dec 5 '05 #2
Hi,

Maybe takeing an n-tier approach to your application or trying to
logicaly break down the config parameters into a set of small tables,
not just one.

You could also encapsulate all of the logic for you config parameters
into one class which does the work for you. Then when you need a
parameter you simply instantiate your class and call a method and it
returns your desired config parameter.

I have an article here which might help:

http://www.developersdex.com/gurus/articles/739.asp

Happy Coding,

Stefan
C# GURU
www.DotNETovation.com

"You always have to look beyond the horizon and can never be complacent
-- God forbid we become complacent."

Jozef Straus

*** Sent via Developersdex http://www.developersdex.com ***
Dec 5 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Ritu | last post: by
10 posts views Thread by tshad | last post: by
11 posts views Thread by cmp | last post: by
1 post views Thread by fniles | last post: by
5 posts views Thread by =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post: by
1 post views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.