Hi all,
I have a condition and formula generator in my application. I must save this condition and formula in database and calculate formulas for each condition.
I want to model these conditions and formulas. For example:
Condition:
Education=BS AND MaritalStatus=Married AND YearsOfService>10
Formula:
Salary=2.5*EducationFactor+BaseSalary
I modeled conditions and formula separately and using Interpreter Pattern.
*Condition
<a href=http://www.freeimagehosting.net/image.php?87d5753b0f.jpg><img src=http://www.freeimagehosting.net/uploads/th.87d5753b0f.jpg alt="Free Image Hosting by FreeImageHosting.net"></a>
*Formula
<a href=http://www.freeimagehosting.net/image.php?de66e96277.jpg><img src=http://www.freeimagehosting.net/uploads/th.de66e96277.jpg alt="Free Image Hosting by FreeImageHosting.net"></a>
Now my questions:
1-Are these model Correct?
2-What are context and client in this pattern?
3-In these models , I have to model Coefficients and Items as subclass of Expression, because of Interpreter Pattern, but naturally they aren't. How can I handle this problem?
4-What are equal tables for these models?
Thanks alot
Software/Hardware used:
ASKED:
November 16, 2008 9:57 AM
UPDATED:
November 17, 2008 6:09 PM