i have some code like this:
class DataFilter
{
List<Animal> animals=null;
public function1(string TypeOfData)
{
if(TypeOfData=="cat"){//get cats from database and do something}
else if(TypeOfData=="dog")
{//get dogs & do something}
}
}
class Animal
{}
class Cat:Animal
{}
class Dog:Animal
{}
if i reuse the DataFilter class:
class CatFilter:DataFilter
{
}
how to reuse list animals property???
how to refactor it to split the function1 into different class