spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / javascript / column22


Behavior's object-oriented concepts

Developer News
HP to Microsoft: Thanks for Nothing
iPhone Remains Left Out as Android Scores Flash
The Year of Living the OpenSocial

As we have shown, the Behavior construct exemplifies several concepts from object-oriented programming languages and environments:

  • Hiding of the implementation details. Only the Behavior interface is exposed to the caller HTML code (via the IMPLEMENTS tags). It allows you to change the implementation of the style without modifying the caller HTML elements, as long as the interface does not change.
  • Encapsulation of code. A Behavior definition is enclosed in a single scriptlet file (soccer.sct in our Blinking Soccer example). Separating the behavior from the page contents eases the maintenance of both. No longer must the content expert deal with style and format. The style expert, on the other hand, can now focus only on these scriptlets, and does not have to deal with the page content.
  • Object-based definition. The definition of Behaviors and objects is very similar. It includes both the data and the operations defined on it. No other data can be associated with a Behavior after its definition. No other operations can be supported besides the initially-defined ones.
  • Reusable code. The same Behavior definition can be used by multiple DHTML elements.
  • Application Procedural Interface (API). The interface to a Behavior scriptlet is well defined, similarly to a procedural interface. The contents page assigns values to the pre-defined parameters of the Behavior. The Behavior can send events back to its caller page.

http://www.internet.com

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

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

webref The latest from WebReference.com Browse >
Administering RBAC in PHP 5 CMS Framework · xref: Automatic Cross Referencing Script · Book Review: Content Rich
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Building Command Line Utilities with Python · fring Brings Mobility to Junction Networks' OnSIP · Another Big Win for Wi-Fi Positioning


Created: July 19, 1998
Revised: July 19, 1998

URL: http://www.webreference.com/js/column22/objectoriented.html