Beispiel #1
0
        WageraWagera(Baseclass bcObj)
        {
            //Old Way
            Obj = bcObj;
            ListAddition(Obj);

            //New Way
            ListAddition2();
        }
Beispiel #2
0
 //We have to refactor this method
 public void ListAddition(Baseclass bcObj)
 {
     //In Each if else Sceanario we are adding new object of each class in a list.
     if (bcObj is A)
     {
         _Names.Add(new A());
     }
     if (bcObj is B)
     {
         _Names.Add(new B());
     }
     //Can be n munber of if case Sceanario
 }