PDA

Click to See Complete Forum and Search --> : Why separate the interface from the implementation if you don't need polymorphism?


jason1972
Mar 8th, 2001, 10:44 PM
Many books about VB component development seem to promote the use of interfaces. I know it can be very useful if you have a general object type with different specific implementations (polymorphism). But what if I don't need polymorphism because my classes are all distinct from each other? Are there other advantages to separating the interface from the implementation?

It seems simpler to just code the implementation class and use the default interface for that class provided by VB. An added benefit is you do not need any workarounds to use the default interface from scripting clients like ASP. Can someone please enlighten me? Thanks.

Jason

hayessj
Mar 9th, 2001, 09:46 AM
I don't think you need to be enlightened here, if you aren't going to use VB's "polymorphism" then you shouldn't bother with interfaces.