J
Jeremy S.
I have started with a new client that is having me substantially modify an
existing .NET application. I have found that the original developer
implemented a lot of data access layer (DAL)-type functions in a base class.
Now I am refactoring. As I'm doing so, I realized that I *never* would have
thought to make a DAL class a base class for other UI-related classes or for
business objects. In my way of thinking I would always have the DAL class be
consumed via containment/delegation by business objects or even UI classes
on occasion.
Question: Would any of you ever recommend having a proper DAL class be
inherited by business object or UI-related classes? I understand that it can
work. But I only see disadvantages (e.g., with single inheritance you lose
that one opportunity...). I understand there isn't necessarily a right vs
wrong answer here... just looking for some thoughtful feedback on the
subject.
Thanks.
existing .NET application. I have found that the original developer
implemented a lot of data access layer (DAL)-type functions in a base class.
Now I am refactoring. As I'm doing so, I realized that I *never* would have
thought to make a DAL class a base class for other UI-related classes or for
business objects. In my way of thinking I would always have the DAL class be
consumed via containment/delegation by business objects or even UI classes
on occasion.
Question: Would any of you ever recommend having a proper DAL class be
inherited by business object or UI-related classes? I understand that it can
work. But I only see disadvantages (e.g., with single inheritance you lose
that one opportunity...). I understand there isn't necessarily a right vs
wrong answer here... just looking for some thoughtful feedback on the
subject.
Thanks.