Scenario:
Create exclusions for cron schedulerSolution:
Behavioral Pattern is used to chain the objects and pass the request along it until an object handles it.Example: Create exclusions for cron scheduler
1 2 3 4 5 6 7 8 9 10 11 12 | private ICalendar Scheduler(string exclusions) { ICalendar cal = null; var list = exclusions.Split(new[] { ListDelim }, StringSplitOptions.RemoveEmptyEntries); //chain exclusions foreach (var item in list) { cal = new CronCalendar(cal, item); } return cal; } |
No comments:
Post a Comment