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

Re: Role of XSLT?

Subject: Re: Role of XSLT?
From: "W. Eliot Kimber" <eliot@xxxxxxxxxx>
Date: Sun, 27 Oct 2002 20:14:49 -0600
xslt business rules
Roger L. Costello wrote:
Is this a good use of XSLT?  I don't think so.  The problem is that I am
dispersing my business rules across the stylesheets, e.g., premier
clients get a 5% discount.  Maintaining such a system becomes a
nightmare.

This leads me to question the role of XSLT.  Are there stylesheets which
do not have business rules built-in?  Should stylesheets be confined to
simply doing mindless formatting?  What are your thoughts?  /Roger

The engineering principals that I live by stress separation of concerns and isolation of business logic to the outer layers of the system.


For this use case, that suggests that the business logic that controls the customer-specific content of the Web pages be isolated to the smallest number of code modules possible, ideally one.

This could be done any number of ways, including by having a separate XSLT module that encapsulates the business logic, probably coupled with heavy use of named templates. But it could also be through table-driven external code used from the XSLT (via extension functions).

Without knowing anything more about your system, my preference would be to put the business logic into external Java code for at least the following reasons:

- It can be completely unit tested in isolation (XSLT is harder to unit test)
- It can be re-used in other processing contexts besides XSLT
- It can be optimized for preformance if necessary
- It can be made more secure if the business logic is sensitive
- It can more easily access external data sources without going through an XML API layer if all you need to do is to look up a few data values.


Cheers,

Eliot
--
W. Eliot Kimber, eliot@xxxxxxxxxx
Consultant, ISOGEN International

1016 La Posada Dr., Suite 240
Austin, TX  78752 Phone: 512.656.4139


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

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
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.