Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / .NET SDK / December 2003

Tip: Looking for answers? Try searching our database.

Documentation on deriviing from a .NET abstract class

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edward Diener - 29 Dec 2003 22:54 GMT
In the documentation for an abstract base class, ie. CollectionBase, how
does one tell which methods must be implemented in the derived class ? I see
no information in the MSDN documentation on which method, properties, or
events are abstract and need to be overridden for abstract classes.

I know I can decompile the assembly using ildasm, but I wonder if there is
any tool which can decompile the assembly to a .NET language such as C# or
MC++ as MSIL is a bit of a pain to read ?
Mattias Sj?gren - 29 Dec 2003 23:13 GMT
Edward,

>I see
>no information in the MSDN documentation on which method, properties, or
>events are abstract and need to be overridden for abstract classes.

If you look at the method signature in the docs, it does include the
keyword abstract for abstract methods and properties.

Also, the compiler will give you an error for any abstract members
that you haven't implemented.

CollectionBase has no abstract members.

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Edward Diener - 30 Dec 2003 01:05 GMT
> Edward,
>
[quoted text clipped - 10 lines]
>
> CollectionBase has no abstract members.

The documentation says that it is an abstract class. Doesn't this mean that
it has at least one abstract method ?
Mattias Sj?gren - 30 Dec 2003 02:12 GMT
Edward,

>Doesn't this mean that
>it has at least one abstract method ?

No

Mattias

Signature

Mattias Sjögren [MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.

Edward Diener - 30 Dec 2003 02:44 GMT
> Edward,
>
>> Doesn't this mean that
>> it has at least one abstract method ?
>
> No

OK, I have picked up the idea that an abstract class does not need to have
at least one abstract method. No wonder I couldn't find any in
CollectionBase <g> .

I am still struggling to understand CollectionBase as a base class for my
own collection, as the documentation is pretty terrible in explaining what
needs to be overridden and what can be overridden for typed collections. I
do understand that, at the minimum, the Add and Remove methods and the Item
property needs to be implemented. The rest of the methods and properties
from IList and ICollection, as well as the methods from CollectionBase, seem
difficult to understand in their relationship to each other and whether
there is any point in overriding them. I will look for an explanation of
.NET custom collections on the Internet.
Edward Diener - 30 Dec 2003 03:27 GMT
> Edward,
>
>> Doesn't this mean that
>> it has at least one abstract method ?
>
> No

I found a very good article at
http://www.informit.com/isapi/guide~dotnet/seq_id~119/guide/content.asp
which explains custom collections derived from CollectionBase very well.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.