Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Web Flow An Overview.

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

Chapter 11 Designing the User Interface
Designing, Deploying and Managing Workflow in SharePoint Sites Steve Heaney Product Development Manager OBS
Apache Struts Technology
Programming Logic and Design Fourth Edition, Introductory
Corporate Context: A SOA & BPM Alliance Via Business Data Management Amir Bahmanyari Architect.
Sapana Mehta (CS-6V81) Overview Of J2EE & JBoss Sapana Mehta.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
© 2004, The Trustees of Indiana University 1 OneStart Workflow Basics Brian McGough, Manager, Systems Integration, UITS Ryan Kirkendall, Lead Developer.
WebDynpro for ABAP Short introduction.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Apache Struts Technology A MVC Framework for Java Web Applications.
Course Instructor: Aisha Azeem
Chapter 13: Designing the User Interface
Spring Web Flow.
Stateful Web Application Development with Spring Web Flow John Case Senior Consultant Centare Group, Ltd.
UNIT-V The MVC architecture and Struts Framework.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
Chapter 10 EJB Concepts of EJB Three Components in Creating an EJB Starting/Stopping J2EE Server and Deployment Tool Installation and Configuration of.
The Design Discipline.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
An Introduction to ASP.NET Ed Dunhill blogs.msdn.com/edunhill SLIDE7.
INTRODUCTION TO PROGRAMMING STRUCTURE Chapter 4 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
14 Chapter 11: Designing the User Interface. 14 Systems Analysis and Design in a Changing World, 3rd Edition 2 Identifying and Classifying Inputs and.
Introduction To Computer System
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
Todd Snyder Development Team Lead Infragistics Experience Design Group.
Design Patterns Phil Smith 28 th November Design Patterns There are many ways to produce content via Servlets and JSPs Understanding the good, the.
WEB 304 An Overview of ASP.NET and Windows Workflow Foundation Kashif Alam Program Manager Developer Division Microsoft Corporation.
J2EE Structure & Definitions Catie Welsh CSE 432
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 09. Review Introduction to architectural styles Distributed architectures – Client Server Architecture – Multi-tier.
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Lecturer: Prof. Piero Fraternali, Teaching Assistant: Alessandro Bozzon, Advanced Web Technologies: Struts–
Alcatel-Lucent CDC Workshop, Coaching & Knowledge Transfer Architecture.
1 Welcome to CSC 301 Web Programming Charles Frank.
Java Web Development with NetBeans IDE -- Kai Qian Chapter 5 JavaServer Faces (JSF) Technology.
Software Engineering Principles. SE Principles Principles are statements describing desirable properties of the product and process.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Forms with Spring MVC Handling Form.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Remoting Simplifying.
MIS 105 LECTURE 1 INTRODUCTION TO COMPUTER HARDWARE CHAPTER REFERENCE- CHP. 1.
A university for the world real R © 2009, Chapter 9 The Runtime Environment Michael Adams.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 1 Database Systems.
Rational Unified Process Fundamentals Module 7: Process for e-Business Development Rational Unified Process Fundamentals Module 7: Process for e-Business.
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
System Testing Earlier we have stated the 2 views of testing:
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Data Access with Spring.
UML - Development Process 1 Software Development Process Using UML.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Overview of the Spring Framework Introducing.
Catching the Web Flow Have you got the Flow? Björn Beskow.
Apache Struts Technology A MVC Framework for Java Web Applications.
Programming Logic and Design Seventh Edition Chapter 1 An Overview of Computers and Programming.
Information System Applications
ORACLE ADF ONLINE TRAINING COURSE
Working in the Forms Developer Environment
TECHLEADS IT Oracle Apps ADF R12
MVC and other n-tier Architectures
Web Software Model CS 4640 Programming Languages for Web Applications
ASP.NET Web Forms Vs. ASP.NET MVC ASP.NET is Microsoft’s big leap after Active Server Pages (ASP), ASP.NET provides flexible and unified web development.
Design and Maintenance of Web Applications in J2EE
Model-View-Controller Patterns and Frameworks
The Model Layer What is Model?
JavaServer Faces: The Fundamentals
Presentation transcript:

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Introduction to Spring Web Flow An Overview of Spring’s Event Based Web Application Framework

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 2 Topics in this Session What Is The Problem? Solving the Right Problem Advantages of the New Focus State and Flow Management Design Tips

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 3 Topics in this Session What Is The Problem? Solving the Right Problem Advantages of the New Focus State and Flow Management Design Tips

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 4 What Is the Problem? Take a simple use case –A wizard for a phone operator to use to sell items to customers Characteristics: –An “application transaction” that spans several steps –Some steps solicit user input –Some steps are decision points –Some steps perform calculations –Navigation from step-to-step is controlled

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 5 How Would You Solve This With Struts? 1.Create a session-scoped ActionForm to hold the wizard form data 2.Define a JSP for each step 3.Define an Action for each step 4.Expose each Action at a request URL 5.Have the form rendered by the JSP submit to that URL 6.At the end, delegate to a business service to commit the transaction

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 6 What this looks like /step2 Controller2 page2 partial data HTTP Session /step1 Controller1 partial data page1 /lastStep Controller3 confirmationPage processTx partial data Business Service

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 7 Issues with this approach Request centric: no concept of an ongoing conversation or flow Brittle dependency on request URLs Manual state management Odd new window behavior Proper back button behavior is difficult “Loose” controlled navigation Difficult to observe process lifecycle Controller and command logic are coupled Heavily tied to HTTP

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 8 Topics in this Session What Is The Problem? Solving the Right Problem Advantages of the New Focus State and Flow Management Design Tips

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 9 Solving the Right Problem The fundamental problem is that we have been working at the wrong level While HTTP is stateless, our business processes are not The web applications we write are for supporting business processes, not HTTP We need a way to work at the process level and let the computer handle the details of how to do that on the web

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 10 How Would You Solve This With SWF? 1.Define a flow that implements your business process 2.Define a web page for each place user input is needed (ie, each “view state”) ‏

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 11 What this looks like in SWF /theflow event view 2 Business Service /theflow event last view processTx /theflow view 1 The flow

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 12 What Is a Flow? A Flow definition serves as instructions to a finite state machine It consists of a set of states that you define Each state executes a polymorphic behavior when entered –View states solicit user input –Action states execute commands –Subflow states spawn child flows –End states terminate flows Events you define drive state transitions

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 13 A “Sell Item” Flow Definition start Enter Price and Item Count submit Select Item Category Is Shipping Required? Enter Shipping Information yes no Process Sale submit Show Cost Overview View State Action State Decision State End State

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 14 Topics in this Session What Is The Problem? Solving the Right Problem Advantages of the New Focus State and Flow Management Design Tips

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 15 Some Big Advantages Emerge Navigation enforcement Automatic state management Modularity & Decoupling Abstraction Toolability Facilites Agile Development Cycle Flow lifecycle visibility

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 16 Navigation Enforcement Web Flow ensures defined navigation rules can not be bypassed or short-circuited –This happens for free –Without losing any power compared to other approaches

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 17 Automatic State Management Flow scope state is managed for you automatically –Conceptually no different than existing scopes (e.g. Session, Request), but focussed on the process rather than the web –Put something in flow scope It’s there while the flow lives It’s cleaned up after the flow is done

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 18 Modularity & Decoupling Navigation rules are encapsulated in one place –Controller logic is clearly decoupled from command logic –The Flow is the controller, deciding what state to enter next –States execute arbitrary behavior when entered The logical flow is clearly defined, readable Flows are Modules the same way a class is a module

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 19 Toolability Flow definitions are extremely toolable Well suited to graphical editing Well suited to programmatic generation Spring IDE 2.0 knows about Web Flow –Web Flow Graphical Editor –Web Flow XML Editor –Use for visualization: a communication tool –Use for editing: easier for new developers

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 20 Abstraction Flows are very similar in different environments (JSF, Spring MVC, Flex, portlets, etc.) ‏ –Could be completely identical for different environments –Or slight differences where Web Flow capabilities overlap with base Web UI Framework capabilities E.g. use Web flow validation, or JSF validation?

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 21 Facilitates Agile Development Cycle Flows are re-compiled automatically, on the fly –Test your changes without restarting servlet container

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 22 Topics in this Session What Is The Problem? Solving the Right Problem Advantages of the New Focus State and Flow Management Design Tips

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 23 How Does Webflow State Management Work? SWF stores the current status of the overall conversation in a repository Each transition in the flow also has its status stored in the repository

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 24 Conversations & Continuations AB C C1C1 B C C1C1 C _k8D2_kA35_k7BC _c1B2 _kB2E _c1B2

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 25 State Management AB C C1C1 B C C1C1 C _k8D2_kA35_k7BC _c1B2 _kB2E _c1B2 flow scope conversation scope

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 26 State Storage Where should the data be physically stored? –To enable zero resource usage on the server? –To allow a process to be active for a long time (eg, so the person can resume in the morning) ‏ –For typical flows where the user is actively interacting with the application? –To allow sending a URL to an admin to finish booking your travel plans? Persistence is a separate concern easily swapped out depending on needs

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 27 States – 5 Main types View State –Pause and allow the user to participate in a flow Action State –Execute business logic, usually indirectly Decision State –Make a flow routing decision Subflow State –Spawn a sub flow End State –Terminate a flow

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 28 Getting Rid of “Double Submit” Why do browsers ask if you would like to re-post the data when you go back to a page that was created as the result of a post? Spring Web Flow follows the web “best practice” of using GET for reads and POST for writes. Why do you not see “repost” dialogs when you move back in a SWF application? SWF does “Post+Redirect+Get”, so no page is ever rendered as the result of a POST.

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 29 Subflows Flows are modular components, and can be “composed” Some processes will naturally break into subflows. –Allows for reuse of flows –Can make it much easier to manage complex flows

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 30 Topics in this Session What Is The Problem? Solving the Right Problem Advantages of the New Focus State and Flow Management Design Tips

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 31 What makes a good Web Flow? –Accomplishes some business goal, e.g. Book a trip Pay your taxes Apply for a Loan –Encapsulates that business goal as a reusable module –Entry point to business goal is a public URL, but intermediate steps are valid only in the context of the flow (i.e. may not be bookmarked) ‏ –Often has multiple paths to support different scenarios Paths may vary based on contextual information –Often spawns other Flows as sub flows Design Tips – Good For Flows

Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 32 What doesn’t make a good Flow? –Any set of pages with free-form navigation between them Publicly accessible URLs Often able to be bookmarked Often backed by individual controller or controller chain –E.g. Index pages, welcome pages, item detail pages, status pages, menus Web flows are best suited for enforcing controlled navigation to support business process workflows –As a compliment to traditional controllers Design Tips – Bad For Flows