I ve decided to build a database tracking the credit card offers I get in the mail, and one confounding factor has been how to represent the offers. With minimum finance charges and variable rates and mimimum variable rates it gets a bit more complex than "10.99 percent". I ve decided I need to construct a language to represent these things if I have a shot at comparing or trending these offers.
The question is, how do I represent this? The formulas are far too complex to model by creating fields, so I ll just store the formula in the DB in all it s glory. Yes, this means blurring the line between data and execution, but since this is a personal project I m not so worried.
- Embedded python. Represent the formula as Python and just bind relevant variables and call the formula.
- Use a Domain Specific Language. I can t be the first person to think of representing things this way, and in fact I know I m not. Are there any free, public languages that can represent this?
Can anyone offer advice on which approach is better?