Beispiel #1
0
        public TheRuleList(Employee employee) : base("TheRuleList", employee)
        {
            r1 = new Rule1(employee);
            r2 = new Rule2(employee);
            r3 = new Rule3(employee);

            r2_1   = new Rule2_1(employee);
            r2_2   = new Rule2_2(employee);
            r2_2_1 = new Rule2_2_1(employee);
            r2_2_2 = new Rule2_2_2(employee);

            r3_1 = new Rule3_1(employee);
            r3_2 = new Rule3_2(employee);

            r_isSalary1 = new RuleIsSalary(employee);
            r_isSalary2 = new RuleIsSalary(employee);

            rt = new RuleTerminator(employee);

            r1.RegisterRules(rt, r2);
            r2.RegisterRules(r_isSalary1, r3);
            r3.RegisterRules(r_isSalary2, rt);

            r_isSalary1.RegisterRules(r2_2, r2_1);
            r_isSalary2.RegisterRules(r3_2, r3_1);

            r2_2.RegisterRules(r2_2_1, r2_2_2);

            r2_1.RegisterRules(rt, rt);
            r2_2_1.RegisterRules(rt, rt);
            r2_2_2.RegisterRules(rt, rt);

            r3_1.RegisterRules(rt, rt);
            r3_2.RegisterRules(rt, rt);
        }
Beispiel #2
0
		public TheRuleList(Employee employee) : base("TheRuleList", employee)
		{
			r1 = new Rule1(employee);
			r2 = new Rule2(employee);
			r3 = new Rule3(employee);

			r2_1 = new Rule2_1(employee);
			r2_2 = new Rule2_2(employee);
			r2_2_1 = new Rule2_2_1(employee);
			r2_2_2 = new Rule2_2_2(employee);

			r3_1 = new Rule3_1(employee);
			r3_2 = new Rule3_2(employee);

			r_isSalary1 = new RuleIsSalary(employee);
			r_isSalary2 = new RuleIsSalary(employee);

			rt = new RuleTerminator(employee);

			r1.RegisterRules(rt, r2);
			r2.RegisterRules(r_isSalary1, r3);
			r3.RegisterRules(r_isSalary2, rt);

			r_isSalary1.RegisterRules(r2_2, r2_1);
			r_isSalary2.RegisterRules(r3_2, r3_1);

			r2_2.RegisterRules(r2_2_1, r2_2_2);

			r2_1.RegisterRules(rt, rt);
			r2_2_1.RegisterRules(rt, rt);
			r2_2_2.RegisterRules(rt, rt);

			r3_1.RegisterRules(rt, rt);
			r3_2.RegisterRules(rt, rt);
		}