473,320 Members | 1,920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1386
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Claire | last post by:
Hi We're newish to visual studio .net. I wanted to store some user defined variables. Normally I'd have written these to the registry but my colleague informed me that Microsoft was trying to...
1
by: Ritu | last post by:
How to store connection strings in machine.config?What are the advantages of storing it in the machine.config file.Can u provide me with the information regarding accessibility of machine.config...
2
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I...
9
by: KarlM | last post by:
After reading some articles regarding confuguration data I'm a bit confused. Where is the right place for storing configuration data? - XML-files? - registry? - INI-files? (from a users point...
10
by: tshad | last post by:
I am trying to find the best procedure for storing keys used for encryption. This would also be a question for the connection string to the database. At the moment, this is kept in the web.info...
0
by: Mushq | last post by:
Hi, I have got a TestSol which contains three projects , but all three projects are not selected for build, it means if I build whole solution then none of the project would be built, but if I...
11
by: cmp | last post by:
Hello, If I have a Visual studio project configured to vbuild againts one SDK. How is the normal procedure to build that solution against other different SDK that I have installed after previous...
1
by: fniles | last post by:
I just got a new machine and installed .NET 2005. In VB.NET 2005 in the old machine, under "Project" - "properties", in the "Compile" tab, I can see "Configuration" and "Platform" combo box with...
5
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have a solution with 50 projects. They are all compiled in DEBUG mode and the output path has been modified to a custom directory I now want to build RELEASE mode and the Output Path...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.