Book a Demo

Author Topic: Fixed my problem with interpreter  (Read 2140 times)

Elham

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
    • View Profile
Fixed my problem with interpreter
« on: November 16, 2008, 09:00:25 pm »
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


*Formula


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