Tamer_Ahmed Posted June 25, 2004 Posted June 25, 2004 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 Quote
Administrators PlausiblyDamp Posted June 25, 2004 Administrators Posted June 25, 2004 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Tamer_Ahmed Posted June 25, 2004 Author Posted June 25, 2004 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 Quote
Administrators PlausiblyDamp Posted June 25, 2004 Administrators Posted June 25, 2004 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.