Hi
I'm pretty new in OOP but have to develop a big project... Just for imagination, below 2 examples which returns same.
Which one is (more) correct, hmm or cleaner? The Property or the method? In real I have to return complex datasets from joined tables... I avoid copy the complet query which returns the dataset. Thats why it's just an empty here in this example.
Thanks.
public class House
{
public static DataSet Windows
{
// just for imaging
get
{
DataSet ds = new DataSet(); // Here would be my data set from sql which returns a windows collection.
return ds;
}
set
{
Windows = value;
}
}
public static DataSet GetWindows()
{
DataSet ds = new DataSet(); // Gets same right?
return ds;
}
}