As I mentioned earlier, i want to remove all static declaration from all businesses classes.
But I don't want to change much the original design, doing so I've encountered some problems that I hope you will help me to solve.
First problem I've encountered changing Category class.
In this class there is a property with it's getter:
Code:
private List<Article> _allArticles = null;
public List<Article> AllArticles
{
get
{
if (_allArticles == null)
_allArticles = Article.GetArticles(this.ID, 0, MAXROWS);
return _allArticles;
}
}
As you can see I cannot use Article.GetArticles(...)
What would be the best option in my case scenario?
Should I pass Article class' instance as parameter to Category instance?
(In this case i will pass and store whole Article class for just one method)
Maybe I should use delegates with events to point to GetArticles method in Article instance?
Maybe I should completely change the design to meet my needs (that i don't want to do) or maybe partial change involving just the part of retrieving Articles from category?