Date post: | 30-Nov-2014 |
Category: |
Technology |
Upload: | ganesh-prasad |
View: | 1,077 times |
Download: | 0 times |
Life above the Service TierHow to Build Application Frontends in a ServiceOriented World
Ganesh PrasadRajat TanejaVikrant Todankar
October 2007
Illustration: “Three Worlds”,M.C.Escher, 1955 Lithograph
All M.C. Escher works © 2007 The M.C. Escher Company the Netherlands. All rights reserved. Used by permission. www.mcescher.com
© Copyright Ganesh Prasad, Rajat Taneja, Vikrant Todankar, 2007This work is licensed under a Creative Commons AttributionNo Derivative Works 2.0 License.
Life above the Service Tier 2
Who Are We?
Ganesh PrasadSenior Architect, Westpac Banking Corporation
Rajat TanejaChief Architect, Zurich Financial Services Australia
Vikrant TodankarSenior Consultant, Hyro Limited (formerly with EDS)
Life above the Service Tier 3
Life in the Business Logic Tier is Moving Along SOAmmingly...
...but the Presentation Tier is a mess.
SOA principles - Loosely coupled systems, no implicit dependencies, all legitimate dependencies in the form of explicit contracts.
No such architectural blueprint exists for the Presentation Tier.
Two Service Models today:
SOAP-based Web Services REST
Both are based on XML document exchange.
Any Presentation Tier technology should be able to interface to legacy services painlessly, i.e., should support both SOAP and REST.
Life above the Service Tier 4
The Presentation Tier and its Three Main Processes
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Application Download
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Presentation Flow
ClientApplication
Network
Business Logic
(Service)
Download Server
Persistence
ApplicationContainer Data Interchange
Service Interface
Life above the Service Tier 5
The Presentation Tier and its Three Main Processes
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Application Download
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Presentation Flow
ClientApplication
Network
Business Logic
(Service)
Download Server
Persistence
ApplicationContainer Data Interchange
Service Interface
Life above the Service Tier 6
The Presentation Tier and its Three Main Processes
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Application Download
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Presentation Flow
ClientApplication
Network
Business Logic
(Service)
Download Server
Persistence
ApplicationContainer Data Interchange
Service Interface
Life above the Service Tier 7
The Presentation Tier and its Three Main Processes
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Application Download
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Presentation Flow
ClientApplication
Network
Business Logic
(Service)
Download Server
Persistence
ApplicationContainer Data Interchange
Service Interface
Life above the Service Tier 8
The Presentation Tier and its Three Main Processes
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Application Download
ClientApplication
Network
Business Logic
(Service)
Download Server
PersistenceApplicationContainer
Presentation Flow
ClientApplication
Network
Business Logic
(Service)
Download Server
Persistence
ApplicationContainer Data Interchange
Service Interface
With Thin Clients, the Web Server plays a role in all three processes.
Life above the Service Tier 9
However...
The Thin Client Model has Three Flaws
Life above the Service Tier 10
Flaw 1 – Lack of Respect for Data
Name “Joe Bloggs”
BirthDate “01-JUL-1978”
AnnualSalary “120000.00”
NoOfDependents “3”
From Browser to Web Server
From Web Server to Browser
<Presentation-Markup>Data</Presentation-Markup>
Data Structures
Flattened to a set of Name-Value pairs
Data Types
Everything reduced to a String
Data Constraints
None
Data as Data?
Specialised formatting and markup for
Presentation
We can do better than this!
Life above the Service Tier 11
Flaw 2 – Coupling of Presentation Flow and Data Interchange
Server
Client
GET GETPOST
Page 1
Page 2
Page 3
Page 1 Page 2 Page 3
What the user wants to do (Presentation Flow)
What the browser does in response (Data Interchange)
GET GETPOST
Symptom – Remember the Browser Back-Button Problem?
Unsafe operation!
Yes, the POST-Redirect-GET pattern fixes this problem, but the fundamental architecture is broken.
Life above the Service Tier 12
Flaw 3 – No Support for Peer-to-Peer Data Interchange
ClientApplication
NetworkBusiness
Logic(Service)
Web Server PersistenceApplicationContainer
Client/Server (Request/Response)
Server messages can only be in response to client
requests – no unsolicited messages such as event
notifications
Life above the Service Tier 13
AJAX is the Answer!NOT!
AJAX provides Raw Capability, not Architecture.
We can build badly architected applications even with AJAX.
Thin Client(Browser) Network
Business Logic(Service)
Web Server
Persistence
Service Interface
Application DownloadPresentation FlowData Interchange
Data Interchange
AJAX Data Interchange
Web Server drives Presentation Flow
based on Data Interchange requests
Web Server acts as intermediary for Data
Interchange
Data is still treated shabbily
So what is the answer?
Life above the Service Tier 14
The Answer
...is an architecture that decouples orthogonal concerns and respects data.
Life above the Service Tier 15
So What Technologies Can We Use?
The following technologies and frameworks are available today:
DHTML/AJAX frameworks for Current Browsers 1. Handcrafted DHTML/AJAX with Third-Party JavaScript Libraries 2. Google Web Toolkit (GWT, GWT-Ext) 3. TIBCO General Interface Builder
XML Dialects for Advanced Browsers 4. XForms embedded in XHTML 2 5. Mozilla XUL 6. Microsoft SilverLight/XAML
Java-based Technologies 7. Java WebStart (Swing, SWT, Spring Rich Client) 8. JavaFX
Adobe Flash Runtime-based frameworks 9. Adobe Flex10. OpenLazslo
The degree of fit with the SOFEA model varies, but designers play a critical role in ensuring compliance with the model. We also need to consider factors like performance, ease of use, etc.
Life above the Service Tier 16
What Is Our Contribution?
A cleaner architectural model for the Presentation Tier that decouples the orthogonal concerns of Application Download, Presentation Flow and Data Interchange. Positioning the web server as a Download Server alone. The evils of web server involvement in Presentation Flow and Data Interchange are avoided. Affirmation of MVC rather than Front Controller as the natural pattern to control Presentation Flow. End-to-end data integrity in Data Interchange, which traditional thin-client technology does not and cannot enforce. Unification of the thin-client and rich-client models, now seen as an artificial distinction. Support for SOAP- and REST-based business services, and a natural integration point between the Presentation and Service Tiers
Life above the Service Tier 17
Thanks!