c# - Pattern for reverse-accessible logic changes? -


i'm trying find design pattern or best practice, or other solution problem keeping versions of business logic within application. specifically, looking find way determine logic used issue insurance policy.

i have code looks this:

public double fixeddeductiblesurchageamount() {     double percent = fixeddeductiblesurchargepercent();     double base_premium = collisionpremium() + theftpremium();     return (base_premium * percent); } 

i needing make change business logic function looks more like:

public double fixeddeductiblesurchageamount() {     double percent = fixeddeductiblesurchargepercent();     double base_premium = collisionpremium() + theftpremium() + medicalpremium();     return (base_premium * percent); } 

where run trouble existing policies should rate previous logic. there design pattern this? if not, there ways implement it?

strategy pattern sounds applicable. you'd need factory method or such takes in date return appropriate strategy.


Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -