H
hendry.johan
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
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