Migrating Web Frameworks Using Water Transformations - PowerPoint PPT Presentation

1 / 17
About This Presentation
Title:

Migrating Web Frameworks Using Water Transformations

Description:

ASP uses VBScript. NSP uses JavaScript. Object Model Transformation: ... Tokens of interest (VBScript Code) Parsed and expanded. Water: ... – PowerPoint PPT presentation

Number of Views:49
Avg rating:3.0/5.0
Slides: 18
Provided by: ZSur
Category:

less

Transcript and Presenter's Notes

Title: Migrating Web Frameworks Using Water Transformations


1
Migrating Web FrameworksUsing Water
Transformations
Ahmed E. Hassan Richard C. Holt School of
Computer Science University Of Waterloo
2
Web Applications
  • A software system whose functionality is
    delivered through the web
  • Web browser is used as the client
  • HTTP state-less protocol is used as the
    communication protocol
  • Many development frameworks have been proposed
    JSP, NSP, ASP, ASP, CF
  • Active pages are their building blocks

3
Introduction to Active Pages
  • Simple html file (foo.html)
  • lthtmlgt
  • Welcome to CNN.COM
  • lt/htmlgt
  • AP file (foo.ap)
  • lthtmlgt
  • Welcome to lt Write(CNN.COM) gt
  • lt/htmlgt

4
Introduction to Active Pages
  • Interesting AP file (foo2.ap)
  • lthtmlgt
  • Welcome to lt Write(Server.name) gt
  • lt/htmlgt

5
Introduction to Active Pages
file.ap
file.html
Web Server Pre-processor
COM/ CORBA Objects
Data Tables
Data Flow
6
Structure of an Active Page
Active Page
Client Scripts
Server Scripts
HTML
JavaScript
Perl
VBScript
VBScript
JavaScript
7
Web Application Development Frameworks
  • Abstract details of developing an application
  • access control
  • client state maintenance
  • relational database access
  • file manipulations on the server
  • Each framework
  • uses its own programming language
  • Each framework provides a set of built-in objects

8
Migrating from ASP to NSP
  • Language Transformation
  • ASP uses VBScript
  • NSP uses JavaScript
  • Object Model Transformation
  • Different set of built-in objects

9
ASP vs NSP built-in objects
10
ASP Example
1 ltHTMLgt 2 ltTITLEgtMain Pagelt/TITLEgt 3 lt if
Session("loggedIn") Then User already logged
ingt 4 Welcome ltResponse.Write(Session("username
"))gt to your account, 5 To display balance ltA
HREF"balance.asp"gtclick herelt/Agt 6 lt Else
User needs to login gt 7 Please Login first, ltA
HREF"login.asp"gtclick herelt/Agt 8 lt End If
gt 9 lt/HTMLgt
11
Island Grammars
  • Used for robust parsing and extraction
  • Recover from errors and handle ill defined
    grammars
  • Island
  • Tokens of interest (VBScript Code)
  • Parsed and expanded
  • Water
  • Un-interesting tokens (HTML/Comments)
  • Skipped

12
Water Transformations
  • Extends the idea of Island Grammars for code
    transformations
  • Converts Water to special Islands
  • Performs code transformation on Islands using
    traditional approaches
  • Convert back the special post-transform. Islands
    to Water

13
Migration Overview
rmComment (in Perl)
rmHTML (in Perl)
VBScript code
ASP file
Lang Trans. (in TXL)
Object Model Trans. (TXL)
addComment (in Perl)
addHTML (in Perl)
JavaScript code
NSP file
14
1 ltHTMLgt 2 ltTITLEgtMain Pagelt/TITLEgt 3 lt if
Session("loggedIn") Then User already logged
ingt 4 Welcome ltResponse.Write(Session("username
"))gt to your account, 5 To display balance lta
HREF"balance.asp"gtclick herelt/Agt 6 lt Else
User needs to login gt 7 Please Login first, lta
HREF"login.asp"gtclick herelt/Agt 8 lt End If
gt 9 lt/HTMLgt
Input ASP file
1 HTMLCALL() 2 if Session("loggedIn") Then
User already logged in 3 HTMLCALL() 4
Response.Write(Session("username")) 5
HTMLCALL() 6 Else User needs to login 7
HTMLCALL() 8 End If 9 HTMLCALL()
After rmHTML
15
1 HTMLCALL() 2 if Session("loggedIn") Then
User already logged in 3 HTMLCALL() 4
Response.Write(Session("username")) 5
HTMLCALL() 6 Else User needs to login 7
HTMLCALL() 8 End If 9 HTMLCALL()
After rmHTML
1 HTMLCALL() 2 if Session("loggedIn") Then
3 COMMENTCALL() 4 HTMLCALL() 5
Response.Write(Session("username")) 6
HTMLCALL() 7 Else 8 COMMENTCALL() 9
HTMLCALL() 10 End If 11 HTMLCALL()
After rmCmt
16
1 HTMLCALL() 2 if Session("loggedIn") Then
3 COMMENTCALL() 4 HTMLCALL() 5
Response.Write(Session("username")) 6
HTMLCALL() 7 Else 8 COMMENTCALL() 9
HTMLCALL() 10 End If 11 HTMLCALL()
After rmCmt
1 HTMLCALL() 2 if (Client.loggedIn)) 3
COMMENTCALL() 4 HTMLCALL() 5
write(Client.username)) 6 HTMLCALL() 7
else 8 COMMENTCALL() 9
HTMLCALL() 10 11 HTMLCALL()
After TXL Trans.
17
Conclusion
  • An approach to migrate ASP to NSP is presented
  • Language Transformation
  • Object Model Transformation
  • Pre/Post processing steps are used to massage the
    input and transform it to a traditional program
  • The approach preserves the location of the
    comments and HTML compared to the source code to
    ease future maintenance
Write a Comment
User Comments (0)
About PowerShow.com