W3C home > Mailing lists > Public > www-svg@w3.org > February 2000

Re: SVG DOM factory methods

From: Jon Ferraiolo <jferraio@Adobe.COM>
Date: Wed, 23 Feb 2000 16:35:21 -0800
Message-Id: <200002240032.QAA01936@mail-345.corp.Adobe.COM>
To: bbrodie@savagesoftware.com (Blaine Brodie)
Cc: www-svg@w3.org
(It took me awhile to understand this.) Yes, there is a reason.

The Document interface on the Core DOM has a method call:
       createElement(DOMString tagName)

See: http://www.w3.org/TR/1999/CR-DOM-Level-2-19991210/core.html#i-Document

Since the SVG DOM sits on top of the Core DOM, this method call is
available by first finding the ownerDocument object. 'ownerDocument' is
available from the SVGElement interface since SVGElement descends from
Element, which descends from Node, which has attribute 'ownerDocument'.

See: http://www.w3.org/TR/1999/CR-DOM-Level-2-19991210/core.html#ID-1950641247

The only reason for factory methods in the SVG DOM (or any other language
DOM) is to create objects which are not elements.

Jon Ferraiolo
SVG Editor
Adobe Systems Incorporated

At 03:57 PM 2/21/00 -0800, Blaine Brodie wrote:
>Is there a reason that there are no factory methods to create SVG DOM
>elements other than basic data types and a SVGDocument?  I would expect
>that there would be methods such as createSVGCircleElement(),
>createSVGRectElement(), etc. to be part of the SVGDocument interface.
>
>Blaine Brodie
> 
Received on Wednesday, 23 February 2000 19:33:14 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 5 November 2012 23:52:47 GMT