spacer

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

home / experts / javascript / column22


Behavior's object-oriented concepts

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

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.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

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

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business


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

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