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

RE: Lark 0.90 available, with an applica

  • From: Tim Bray <tbray@t...>
  • To: xml-dev@i...
  • Date: Fri, 27 Jun 1997 14:39:49 -0700

lark controller
At 02:08 PM 27/06/97 +0000, akirkpatrick@i... wrote:
>I did something very similar recently (admittedly in C++)
>and abandoned it...
>
>1. Leads to "class spaghetti" with similar code being spread
>all over the place.

In the XtoH application, the ElementLogic class from which all the 
element classes are subclassed has an atStart(), an atEnd(), and
a doText().  In a lot of cases, the atStart/atEnd amounted to "emit the
following string, interpolating the following attribute values".  So
yes, a lot of parallelism, but this seemed a fair price to pay for
the independence and modularity.

>2. There is usually a large degree of dependence between the
>elements and the driving application. Often the elements need
>to access the driving application directly and there is no obvious
>and efficient way provide this interface.

Not always true.  I don't do C++, but in Java, after the controller
cooks up the per-element object, he calls its method 
registerController(this) - the per-element classes all have
a mController member, thus they can callback to the controller.
The amount they had to do so was pretty small.

>3. You need to create a new class for each new element type
>(less of a problem in Java?). For C++, this means recompiling
>the application.

Non-problem in Java... in fact, you don't even need to know what
you've got when you start; when you find a new element, you can
dynamically see if there's a class for it.

>I'd be really interested to hear views in favour of the class approach.

Why I wrote this.  I would say that while we'd all prefer a declarative
stylesheet approach, it is my belief that in a lot of cases it's going
to be common to use, at least occasionally, some per-element custom
logic.  Java makes this easy enough to be very appealing as a general
framework.

 - Tim


xml-dev: A list for W3C XML Developers
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To unsubscribe, send to majordomo@i... the following message;
unsubscribe xml-dev
List coordinator, Henry Rzepa (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.