spacer
Yehuda Shiran June 7, 2002
The Interface's Advantages
Tips: June 2002

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
News Flash: Adobe Has iPhone Workaround
Adobe's Flash 10.1 Goes Mobile (Minus iPhone)
A Salute to Visionary CEOs

The Interface concept is one of the cornerstones of object oriented programming languages. Interfaces are very similar to classes. They are also defined by the exact same syntax. Interfaces differ from classes in that they don't include any member implementation. An interface can have properties and method interfaces only. An interface does not have any method implementation. It can include a method declaration but no function body.

By itself, interfaces are not very useful. You cannot create instances of interfaces. You can implement interfaces by useful classes from which you can create instances. Interfaces are instrumental in enforcing object oriented design methodologies. One group may specify the interface for other groups to follow. Each group may implement its own function bodies, but all groups will adhere to the same interface, defined a priori. It comes back to the first and foremost incentive for object oriented programming: encapsulation. You don't care how a capability is implemented. You, as a programmer, are exposed only to the interface. This is also a good way to watch after the system architecture. You don't let everyone on the team define his or her own interfaces. One central group will usually define them for the rest. Interfaces are a good way to define methods for the whole project.

To learn more about JScript .NET, go to Column 110, JScript .NET, Part IV: Inheritance.


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Building a Banking Application Home Page with OOP · Mixing Scripting Languages · Review: phpFox, a Social Networking CMS with all the Bells and Whistles
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Enterprise 2.0: Social Networking in the Cloud · BroadSoft Marketplace Hastens Pace of Telephony Innovation · Review: HTC Hero for Sprint