[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Procedural vs Declarative XML transformation 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|