[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Prototype OO was Re: Inheritance/defaulting of attributes

  • From: John Gossman <JohnGo@a...>
  • To: "'xml-dev@i...'" <xml-dev@i...>, "'Meltsner, Kenneth J'" <Kenneth.J.Meltsner@j...>, John Gossman <JohnGo@a...>
  • Date: Fri, 10 Oct 1997 11:16:31 -0700

typedef inherit
	I guess an example is in order:

	<typedef id="button">
		<x type="int" value="0"/>
		<y type="int" value="0"/>
		<x2 type="int" value="1"/>
		<y2 type="int" value="1"/>
		<caption type="string" value="button"/>
	</typedef>

	later we can define an instance of button:

	<button id="button1">
		<x2 value="100"/>
		<y2 value="200"/>
		<caption value="Click Here!"/>
	</button>

	The button instance picks up default values and types from the typedef
(the prototype), and overrides the others.

	Furthermore, you can derive a new class:

	<typedef id="button-with-graphic" parent-class="button">
		<graphic type="string" value=""/>
	</typedef>

	and a new-instance:

	<button-with-graphic id="button2">
		<caption value="Click on the picture"/>
		<graphic value="folder1.gif"/>
	<button-with-graphic/>

	-JG


	

>----------
>From: 	John Gossman
>Sent: 	Friday, October 10, 1997 10:38 AM
>To: 	'xml-dev@i...'; 'Meltsner, Kenneth J'
>Subject: 	RE: Prototype OO was Re: Inheritance/defaulting of attributes
>
>	This is an excellent idea.  For declarative languages especially,
>prototype is a very good model for  inheritance because it provides
>default values for data fields and layouts of schemas, which is
>primarily what you need (there is no behavior to inherit).  I have used
>this as the basis for my XML based OXF (Open Exchange Format).  It seems
>to be easier to understand for those who are not fluent in OO technique.
>
>

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.