oop - Business rules that are valid for specific time span – how to manage in an orderly manner -
i started working government agency , have come across interesting problem: business rules depend on legislature , such have respect exact time periods legislature has been active.
to give example, if subject has applied subsidy on date, has evaluated according criteria vas valid on given date. same subsidy, applied on later date has different criteria. wondering if there known pattern deal these time-dependent rules in orderly fashion. @ moment, code sprinkled expressions akin to:
if application.date >”july 17th, 2008”
what best way manage problem?
this looks case chain of responsibility. have handlers each legislature. pass application recent handler first. if old, passes down handler previous legislature.
Comments
Post a Comment