DataSets vs Classes
Should I choose datasets or will classes do the trick? This is a question each developer probably asks himself (or herself) at the beginning of a project. And maybe even along the way…
If I had to answer that question, I wouldn’t now what to say because I think it depends on a lot of things which of the two will be better. Both of them have pros and cons. DataSets for instance are very easy to persist in a database. Classes on the other hand can enforce business rules more easily.
Barry Gervin started out with a list why datasets are so good, but in the comments there’s a big discussion going on about when to use datasets and when to use custom entities. I for one like datasets and classes. And I think we can use them both, even within the same system. On the other hand, that might get a bit complex.
Is Udi Dahan's comment right? Should dataset only be used in one-off situations, or can they belong in the center of a system’s architecture?
I don’t have a particular preference, although I seem to be inclined to start with classes more often. Do you have a preference? If so, drop me a line in the comments!