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

RE: Procedural vs Declarative XML transformation approaches

  • From: "Clark C. Evans" <cce@c...>
  • To: Mike.Champion@S...
  • Date: Sun, 05 Nov 2000 11:09:22 -0500 (EST)

procedural versus object oriented approaches
In 1989, when I first started writing programs for 
Windows 3.0 with Petzold's book in one hand, the primary
part of the program (for each window) was the event 
handler -- one huge switch stement:

  switch(wparm) {
     case WM_CLOSE:
       // code to handle the window closing
     case WM_MOVE
       // code to handle the movmement of a window
      ...
  }

These statements could grow to be several pages long,
violating one of the first rules in P.J.Plaugher's 
book on "style" which said that each function should
be only 10-15 lines long.
      
Then, in 1991, I started to use Borland's compiler which 
had a message dispatch (message cracker) mechanism:

  BEGIN_MESSAGE_MAP
    MESSAGE(WM_CLOSE,close_func)
    MESSAGE(WM_MOVE,move_func)
    ...
  END_MESSAGE_MAP

  close_func(LPARM lp) {
     // code to handle window closing  
  }

  move_func(LPARAM lp) {
    // code to handle window moving
  }

This was a huge improvement, since the GUI could help
you write the message map, and would build the stubs 
for you and your event handler methods could now be
10-15 lines long.  Then, shortly there after, C++/MFC 
matured and made this process more transparent and
"object-oriented".

...

I don't necessarly see XSLT as "declarative" as 
much as I see it as "event oriented".  With the 
apply-templates/select and template/match pair 
analogous to the "message dispatching" system
found in modern event-driven windowing libraries
for the C language.  In effect, the template
mechanism breaking down into two manageable parts 
what would have otherwise been a for-each 
with a large, hard to manage choose statement.

Thus, I see James Clark wisely skipped the late 80's
event programming model, and moved us right into 
state of the art in the mid-90's.

I hope this view helps,

Clark


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.