R – Base business class: is it bad

Architecturebusiness-objectsnet

I would like to create my base business class, something like EntityBase, to have some common behavior, such as implementing interface to track changes in the object (IsNew, IsDirty) and INotifyPropertyChanges interface.

But many people say it's a bad idea to have a base business class and derive all your business objects from it. Usually they say that it is bad to have presentation code in the entity class. But I think it's just a theory. What is bad in practice? They say: try it yourself. No more arguments usually.

So what do you guys think? Is it good or bad? If bad, why? Please, try to be a practical person, not theoretic.

Best Answer

A lot of people subscribe to the idea of Single Responsibility Principle, which says that a class should only have a single area of responsibility. By building state tracking, rendering and so forth into a common base class, you'll certainly violate the SRP. If you class handles many tasks, it will have many reasons to change.