Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

hi all

i read many books about compnent and com+ and all books always talk about interfaces i know interfaces in vb.net and c# and how to impelement it but i don't feel that the interfaces in VB & C# is similar to interfaces in component & com+ do am right and if there's any different can anyone tell me what is that different :D

  • Administrators
Posted

Interfaces are merely a way of providing polymorphism when it comes to the idea of OOP (in VB 6 and earlier and COM they were the only supported way).

Under .Net you will find interfaces are more flexible than under COM (interfaces can inherit from each other for starters) but server the same basic purpose.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted
so u mean that interfaces was a way of providing polymorphism is that mean that the methods and procedures was contain the code and the client doesn't need to impelement it like .net do am right
  • Administrators
Posted

An interface defines a required set of methods / properties / events. Any class or struct that implements an interface is required to provide an implementation of ALL of these.

 

Other code could be written that only expects to work on variables whose type is the interface, this code will then be able to work with any class or struct that implements said interface. The calling code never needs to know the specifics of how a particular class / struct decides to implement the functionality, it can just call it blindly.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...