lundi 8 août 2016

Constructor with parameters and factory method

In my application I have model classes with simialr strucuture:

 public class SomeBaseClass {
    public int FieldA {get;set;}
    public int FieldB {get;set;}

    public SomeBaseClass(int fieldA, int fieldB)
    {
          FieldA = fieldA; 
          FieldB = fieldB;
    }
}

So in case if I have inherited from SomeBaseClass classes, should I use any сreational pattern? and how to do it if I initialize fields through construcutor (is that a good approach)?

Aucun commentaire:

Enregistrer un commentaire