Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Abstract Classes
Message
General information
Forum:
ASP.NET
Category:
Other
Miscellaneous
Thread ID:
00835368
Message ID:
00835450
Views:
13
>Hi,
>
>Can anyone give me some information related to the implementation of Abstract Classes? I understand what they are and how they work, but was wondering if someone could provide me with a real-world example of using abstract classes in their app. For example, why were abstract classes used - what were the benefits gained in your app?

I can give you one example where I've used an abstract class used. I've created an ASP.NET server-side control that knows how to display a paged list of items, with and without checkboxes next to them (and has a definite "XP" feel to it). By itself, the list doesn't do anything; it doesn't have enough information to generate the list if you were to use it by itself. It >has< to be subclassed and a few stub methods and properties need to be filled in before it will work.

The list is an abstract class because of this - I don't want anyone thinking they can just create an instance of it (eg. dropping it on a form) and using it. By creating an abstract class, though, I've got a nice consistent (and easy) way of creating my paged lists. The interface is exactly the same in each subclass, and all of the "real" work is done by the abstract class.
-Paul

RCS Solutions, Inc.
Blog
Twitter
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform