I am creating a simple CMS for learning purposes. It has a DAL, BLL and UI. The DAL contains non static methods which are accessed in the BLL layer.
I have a factory pattern which creates instances of the DAL methods like this:
public class Factory
public static T GetInstance<T>() where T : new()
return new T();
And they are accessed in the BLL like this:
public void Save(Article article)
ArticleData artDate = GeepyFactory.GetInstance<ArticleData>();
My question is, what additional logic should/usually go into the Factory class to make it favourable/a better solution over standard instantiation of a class like this ArticleDAL artDal = new ArticleDal(); ??
View Complete Post