Results 1 to 2 of 2

Thread: Interface Question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Posts
    382

    Interface Question

    Are Interfaces in vb.net mostly used for encapsulation purposes? I don't see any real benifit from using them other than maintaining organized and encapsulated code. I mean If I use 5 different Interfaces in one class, even If i only use 1 of those interfaces, all the other Interfaces routines and values are still using up memory and being saved when I serialize the class which implemented all 5 interfaces.. Can anyone enlighten me or am I right on target?

  2. #2
    New Member
    Join Date
    Apr 2003
    Location
    Nottingham
    Posts
    14
    Interfaces in any object-oriented language allow you to leave the specific implementation of the methods, events and properties to the implementing class. It means that you can change the specifics of a method in a class that implements an interface without having to worry about the rest your application being affected by it. Your app still uses the same interface so it doesn't care about how it actually does something.

    It is a different technique than using inheritence, where the implementation of the methods etc are already defined, and is usually used to extend some functionality of a base class in the derived class.

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