Results 1 to 4 of 4

Thread: Recommendations for Abstract class vs interfaces

  1. #1

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Recommendations for Abstract class vs interfaces

    Hi,

    From the following URL i got some doubts about the Recommendations for using Abstract class vs interfaces

    http://msdn.microsoft.com/en-us/libr...(v=vs.71).aspx


    1. If you anticipate creating multiple versions of your component, create an abstract class. Abstract classes provide a simple and easy way to version your components. By updating the base class, all inheriting classes are automatically updated with the change. Interfaces, on the other hand, cannot be changed once created. If a new version of an interface is required, you must create a whole new interface. { Is there any example for this t ounderstand throughly ?}

    Can any one explain with example please
    2. If you are designing small, concise bits of functionality, use interfaces. If you are designing large functional units, use an abstract class.
    If you want to provide common, implemented functionality among all implementations of your component, use an abstract class. Abstract classes allow you to partially implement your class, whereas interfaces contain no implementation for any members. { Is there any example for this t ounderstand throughly ?}

    Can any one explain with example please
    Loving dotnet

  2. #2
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Recommendations for Abstract class vs interfaces

    Hello,

    There are a couple of articles here:

    http://geekswithblogs.net/mahesh/arc.../05/84120.aspx

    http://codeofdoom.com/wordpress/2009...-an-interface/

    That will hopefully help you.

    Gary

  3. #3

    Thread Starter
    Fanatic Member karthikeyan's Avatar
    Join Date
    Oct 2005
    Location
    inside .net
    Posts
    919

    Re: Recommendations for Abstract class vs interfaces

    Thanks Gary
    Loving dotnet

  4. #4
    ASP.NET Moderator gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Recommendations for Abstract class vs interfaces

    No worries.

    Let me know if you have any more questions.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width