Using an Abstract Base Class

As we've discussed elsewhere in this book, the fact that the common language runtime and thus managed languages can use implementation inheritance enables you to take advantage of polymorphism and write code that is both reusable and generic. It comes as no surprise that you can utilize this feature when you build your data access classes.

In the following sections, you'll learn how to create a base class for both non-serviced and serviced components. These base classes will incorporate some commonly implemented features and will be reusable across projects.

Creating a Base Class

When designing a reusable base class, you first need to understand its benefits and think clearly about what kinds of services it should ...

Get Sams Teach Yourself ADO.NET in 21 Days now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.