Transformations Siim Karus Faculty of Mathematics and Computer - - PowerPoint PPT Presentation

transformations
SMART_READER_LITE
LIVE PREVIEW

Transformations Siim Karus Faculty of Mathematics and Computer - - PowerPoint PPT Presentation

Designing Maintainable XML Transformations Siim Karus Faculty of Mathematics and Computer Science University of Tartu Estonia siim04@ut.ee Outline Motivation XSLT guidelines Measuring XSLT conformance Improving XSLT


slide-1
SLIDE 1

Designing Maintainable XML Transformations

Siim Karus Faculty of Mathematics and Computer Science University of Tartu Estonia siim04@ut.ee

slide-2
SLIDE 2

Outline

  • Motivation
  • XSLT guidelines
  • Measuring XSLT conformance
  • Improving XSLT conformance

2

slide-3
SLIDE 3

Uses of XSLT

3

System External System The Internet Component Component Component XSLT User

slide-4
SLIDE 4

Maintenance

Evolution of XML

  • New information
  • Obsolete information
  • Changes in semantics

Maintenance

  • Updates in relevant

transformations

4

slide-5
SLIDE 5

Forward Compatibility

Independence from business components (generality) Graceful handling of unexpected content

5

Minimises effort needed to update code.

slide-6
SLIDE 6

Guidelines

Use existing or common controls. Use generic services instead of internal components to expose similar aspects. Compose complex services of individually addressable and “subscribable” services. Avoid the need for additional metadata to render a document.

6

Reuse Loose coupling

slide-7
SLIDE 7

Evaluation of Guidelines

10

Framework Viewing an article Viewing a category Modifying a category Configuration module Viewing an application Viewing a news item Pre-guidelines 273 136 181 85 73 355 49 Guidelines 262 82 103 37 80 253 50 100 150 200 250 300 350 400 Lines of Code

slide-8
SLIDE 8

Metrics of XSLT

  • Number of elements
  • Number of attributes
  • Number of templates
  • Number of apply-templates
  • Number of match expressions
  • Number of select expressions
  • Number of test expressions

12

slide-9
SLIDE 9

Types of Expressions

  • Simple

– Can be written without wildcards and function calls – E.g. Resources

  • Complex

– Wildchars – Function calls – E.g. *[string-length(name())=4]

13

slide-10
SLIDE 10

Results

14 5 10 15 20 25 30 35 Templates Simple Complex Simple Complex Simple Complex Templates Apply Match Select Test pre-guidelines guidelines

slide-11
SLIDE 11

Results

15 5 10 15 20 25 30 35 40 45 50 Templates Simple Complex Simple Complex Simple Complex Templates Apply Match Select Test VVV pre-guidelines VVV guidelines FxCopReport pre-guidelines FxCopReport guidelines xCBL to Rosettanet pre-guidelines xCBL to Rosettanet guidelines

slide-12
SLIDE 12

Impact of the Guidelines

16

Metric Guideline 1 Guideline 2 Guideline 3 Guideline 4 Number of Similar code sections Length of similar code sections Number of elements in stylesheet Number of local variables and parameters in stylesheet Number of global variables and parameters in stylesheet Number of template calls and copy-of elements Number of match, select and test expressions, which make use of implicit information Number of templates in stylesheet Number of apply-templates elements in stylesheet Length of templates in stylesheets

slide-13
SLIDE 13

Improving XSLT Conformance

  • Iteratively
  • One guideline at a time:

– Common controls – Generic transformation services – Addressable and subscribable services – Use of metadata

  • Verify each steps result

17

slide-14
SLIDE 14

Future Perspectives

  • Study the correlation between stylesheet
  • rientation and effectiveness of guidelines.
  • Investigate maintainability using other

metrics.

  • Study enforceability of the guidelines.

18

slide-15
SLIDE 15

Discussion

19