I want to implement a database driven payroll system using CSharp. I already did it once, but the implementation sucks so I want to do it again and do it right.
My first thought is to create a static class calculator which would simply hold all the formulas, one private method per formula. One main public method "Calculate" which would take a ref Employee type object as a parameter. Take data from the object, apply the formulas and set the objects properties, but my guess is this would probably suck.
One class with a bunch of properties for holding all the "(algebraic) constants". One class containing and managing the object. This class would deserialize the class holding all the data and serialize on app exit. The calculator would use this class to get data and apply the formulas to make changes to the "Employee". These "constants" would be changable from inside the application.
Thoughts ?
I am not good when it comes to structuring applications and a lot of my implementations end up sucking... I realize that I hate it when I need to make changes to the application.
Thanks
ref
just to change an object's properties. Objects are passed by reference in C# anyway. The only thing extra thatref
allows you to do is assign a entirely different Employee to the passed-in Employee. f.ex.public void MyMethod(ref Employee employee) { employee = new Employee(...); }