ARCH-3: Context Management in the OpenEdge® Reference Architecture John Sadd Engineering Fellow and OpenEdge Evangelist.

Slides:



Advertisements
Similar presentations
Server Access The REST of the Story David Cleary
Advertisements

ARCH-13 Developing WebSpeed  Applications Chris Skeldon Principal Consultant.
Objectives In this session, you will learn to:
SOA with Progress Philipp Walther Consultant. © 2007 Progress Software Corporation2 Agenda  SOA  Enterprise Service Bus (ESB)  The Progress SOA Portfolio.
Stanford University EH&S A Service Oriented Architecture For Rich Internet Applications Sheldon M. Heitz.
John Sadd Progress Fellow and OpenEdge Evangelist
Exchange in Real Time DEV-06: The ProDataSet in OpenEdge™ 10 John Sadd Progress Fellow and OpenEdge Evangelist.
Client/Server Architecture
Working with SQL and PL/SQL/ Session 1 / 1 of 27 SQL Server Architecture.
Client-Server Processing and Distributed Databases
DEV-14: Understanding and Programming for the AppServer™
Performance testing of Progress Appservers and a plug-in for Jmeter
Introduction to Databases Transparencies 1. ©Pearson Education 2009 Objectives Common uses of database systems. Meaning of the term database. Meaning.
The Easiest Way to Write Web Applications Jordi Sastre IT Architect, PSC May 2012.
Sys Prog & Scripting - HW Univ1 Systems Programming & Scripting Lecture 15: PHP Introduction.
Web Development Challenges and How They are Solved in ps:eScript Matt Verrinder Progress Software UK Internet & Integration Technologies.
ARCH12: QA Considerations - OERA ARCH-12: QA considerations for applications following the OpenEdge Reference Architecture SMAT-Team Tobago Thomas Hutegger.
DB-19: OpenEdge® Authentication Without the _User Table
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
DEV-07: Increasing Productivity with Tools for Business Logic Gikas Principal Software Engineer.
Denise Luther Senior IT Consultant Practical Technology Enablement with Enterprise Integrator.
SOA-12: Integrate over the Web with OpenEdge® Web Services
ARCH-1: It’s a Tall World After All Taking Application Architecture Seriously John Sadd Progress Fellow and OpenEdge Evangelist Mike Ormerod Technical.
MOVE-14: Migrating Your 4GL Authentication System to OpenEdge® 10
SAP Overview SAP? Company ERP Software package –R/2 –R/3.
Enticy GROUP THE A Framework for Web and WinForms (Client-Server) Applications “Enterprise Software Architecture”
Advanced Web Forms with Databases Programming Right from the Start with Visual Basic.NET 1/e 13.
Simple Database.
Data File Access API : Under the Hood Simon Horwith CTO Etrilogy Ltd.
INT-11: It’s Monday Morning, Do You Know Where Your Service Has Been? Service Management with Sonic ™ and Actional Marv Stone Progress Software.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
ARCH-03: Implementing the OpenEdge™ Reference Architecture – Part 1 John Sadd Progress Fellow and OpenEdge Evangelist.
White Star Software Exchange 2005 – DEV-15 DEV-15 All Dynamic Applications John Campbell White Star Software.
DEV-5: Introduction to WebSpeed ® Stephen Ferguson Sr. Training Program Manager.
The ProDataSet in OpenEdge™ 10
Microsoft ® Business Solutions–Navision ® 4.0 Development II - C/SIDE Solution Development Day 2.
DEV-09: User Authentication in an OpenEdge™ 10.1 Distributed Computing Environment Michael Jacobs Development Architect.
ARCH-4: The Presentation Layer in the OpenEdge® Reference Architecture Frank Beusenberg Senior Technical Consultant.
MOVE10: Darwin or Big Bang? 1 MOVE-10: Darwin or Big Bang? SMAT-Team Tobago Thomas Hutegger & Pheona Job
DEV-01 What’s New in Progress Dynamics ® Anthony Swindells Progress Fellow.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
INT-5: Integrate over the Web with OpenEdge® Web Services
SOA-26: Extending Your Application with OpenEdge ® Web Services John Sadd OpenEdge Evangelist.
® IBM Software Group © 2007 IBM Corporation Best Practices for Session Management
ARCH-07: Implementing the OpenEdge™ Reference Architecture – Part 2
ARCH-7: A Class-Based Implementation of the OpenEdge® Reference Architecture John Sadd Fellow and OpenEdge Evangelist Applied Technology.
ARCH-11: Building your Presentation with Classes John Sadd Fellow and OpenEdge Evangelist Sasha Kraljevic Principal TSE.
© 2013, published by Flat World Knowledge Chapter 10 Understanding Software: A Primer for Managers 10-1.
© 2008 Progress Software Corporation1 SOA-33: Transactions in a SOA World What happens next? Flight Booking Hotel Booking Car Booking (3) Calls (2) Change.
AMQP, Message Broker Babu Ram Dawadi. overview Why MOM architecture? Messaging broker like RabbitMQ in brief RabbitMQ AMQP – What is it ?
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
A7: Architecting Your Application in OpenEdge ® 10 Mike Ormerod Applied Architect.
ARCH-7: Integrate this! SonicMQ® and the OpenEdge® Reference Architecture Christian Stiller Technical Architect.
Chapter 1 Revealed Distributed Objects Design Concepts CSLA.
DEV-5: Using ProDataSets™ in OpenEdge ® 10 Cheryl LaBarge Product Readiness.
DEV-8: AppServer ™ Mode Case Studies Simon Epps Solutions Engineer.
ARCH-5: Service Interfaces in Practice Christian Stiller Technical Architect.
MOVE-15: Leveraging Business Entities, Data Access Objects and ProDataSets with a Progress Dynamics® or ADM2 GUI Peter Judge Principal Software Engineer.
DEV-9: Using the ProDataSet™ in OpenEdge® 10
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
SAP Overview.
COMP-10: Managing OpenEdge® Development with the Roundtable® TSMS
Introduction to Databases Transparencies
Lecture 1: Multi-tier Architecture Overview
ARCH-1: Application Architecture made Simple
ARCH-4: A Stateful Application in a Stateless World
– JukeBox – transparency, flexibility, speed and comfort!
DEV-11: Architecting Your Application in OpenEdge® 10
ARCH-2: OpenEdge Reference Architecture (OERA) Latest Thinking
SOA-09: Conducting Business with OpenEdge® and SonicMQ®
Presentation transcript:

ARCH-3: Context Management in the OpenEdge® Reference Architecture John Sadd Engineering Fellow and OpenEdge Evangelist

© 2006 Progress Software Corporation2 ARCH-3 Context Management in the OERA Agenda  Client to Database – a brief history  AppServer™ modes and issues  Thinking about procedures and context  Maintaining context on the client  Maintaining context on the server  Conclusions

© 2006 Progress Software Corporation3 ARCH-3 Context Management in the OERA The good (very) old days: host-based FIND FIRST Customer FIND NEXT Customer /* Process Customer 1 */ /* Process Customer 2 */ Everything on one box

© 2006 Progress Software Corporation4 ARCH-3 Context Management in the OERA The good (not so) old days: client/server FIND FIRST Customer FIND NEXT Customer /* Process Customer 1 */ /* Process Customer 2 */ Client networking Client PC Server

© 2006 Progress Software Corporation5 ARCH-3 Context Management in the OERA Client/server limitations: Performance FIND FIRST Customer FIND NEXT Customer /* Process Customer 1 */ /* Process Customer 2 */ Client networking Client PC All code executes on the client Server

© 2006 Progress Software Corporation6 ARCH-3 Context Management in the OERA Client/server limitations: OpenEdge client platform only FIND FIRST Customer FIND NEXT Customer /* Process Customer 1 */ /* Process Customer 2 */ Client networking Server

© 2006 Progress Software Corporation7 ARCH-3 Context Management in the OERA What to do, what to do… Host-based Client/Server AppServer

© 2006 Progress Software Corporation8 ARCH-3 Context Management in the OERA OpenEdge AppServer PO ProDataSet™ The Bigger Picture – Today and Tomorrow Purchase Order Business Logic Header Data Detail Data Other Data Purchase Order Proxy.NET™ User Interface Jonas Grumby 110 Desert Isle Path Minnow, HI OK Cancel C# OpenEdge.NET Interface  Flexibility for client platforms and integration needs ABL or WebSpeed™ Interface WebClient™ / HTML User Interface Jonas Grumby 110 Desert Isle Path Minnow, HI OK Cancel OpenEdge ABL Interface ABL OpenEdge Web Services Interface

© 2006 Progress Software Corporation9 ARCH-3 Context Management in the OERA Agenda  Client to Database – a brief history  AppServer modes and issues  Thinking about procedures and context  Maintaining context on the client  Maintaining context on the server  Conclusions

© 2006 Progress Software Corporation10 ARCH-3 Context Management in the OERA Improving network performance with the AppServer RUN CustProc.p ON hAppServ (“FIRST”, OUTPUT ttCust) CustProc.p Client AppServer Business logic code executes on the server

© 2006 Progress Software Corporation11 ARCH-3 Context Management in the OERA Using a bound AppServer session in “state-aware” mode RUN FindCust IN hCust (“FIRST”, OUTPUT ttCust) RUN FindCust IN hCust (“NEXT”, OUTPUT ttCust) /* Process Customer 1 */ /* Process Customer 2 */ RUN CustProc.p ON hAppServer PERSISTENT set hCust. CustProc.p Client AppServer

© 2006 Progress Software Corporation12 ARCH-3 Context Management in the OERA Scalability and bound AppServers client AppServer session

© 2006 Progress Software Corporation13 ARCH-3 Context Management in the OERA Using the AppServer in “stateless” mode AppServer session AppServer broker All client requests

© 2006 Progress Software Corporation14 ARCH-3 Context Management in the OERA Using the AppServer in “stateless” mode– FIND FIRST AppServer session 1 AppServer session AppServer broker RUN CustProc.p ON hAS (“FIRST”, OUTPUT ttCust)

© 2006 Progress Software Corporation15 ARCH-3 Context Management in the OERA Using the AppServer in “stateless” mode – FIND NEXT AppServer session AppServer session 2 NEXT What?? AppServer session AppServer broker RUN CustProc.p ON hAS (“NEXT”, OUTPUT ttCust)

© 2006 Progress Software Corporation16 ARCH-3 Context Management in the OERA Advantages to using stateless mode  Allows sharing of server resources by many clients  Promotes scalability  Allows for load balancing and other optimizations  Allows AppServer access from other platforms

© 2006 Progress Software Corporation17 ARCH-3 Context Management in the OERA Challenges using stateless mode  Can’t run procedures PERSISTENT without binding the AppServer session Server procedure won’t keep track of you Can’t run internal procedures  Can’t get a procedure handle for non-persistent procedures  Can’t maintain client-specific context within an AppServer session

© 2006 Progress Software Corporation18 ARCH-3 Context Management in the OERA Unmanaged “state-free” mode  Not even a persistent CONNECTION-ID for the AppServer broker  Recommended for use with Web services or other connectionless environment Service-Oriented Application on the bus  Issues are essentially the same as with stateless

© 2006 Progress Software Corporation19 ARCH-3 Context Management in the OERA Agenda  Client to Database – a brief history  AppServer modes and issues  Thinking about procedures and context  Maintaining context on the client  Maintaining context on the server  Conclusions

© 2006 Progress Software Corporation20 ARCH-3 Context Management in the OERA Context Management Basics  Target environment is client to stateless or statefree AppServer  Each interaction is independent  Maintain context between related interactions

© 2006 Progress Software Corporation21 ARCH-3 Context Management in the OERA Dealing with context in a stateless world: binding for the duration of a task  Run a procedure PERSISTENT on a stateless AppServer session This binds the session for the life of the procedure Supports multiple calls that are part of a single ‘task’ The session is unbound when the procedure instance is deleted

© 2006 Progress Software Corporation22 ARCH-3 Context Management in the OERA Managing context for a task Agreement Validate Customer if ? then Context Enter Order if ? then Confirm Inventory if ? then Calculate Price if ? then Agreement Order Entry Task Agreement Customer Entity Order Entity Inventory Entity Pricing Entity

© 2006 Progress Software Corporation23 ARCH-3 Context Management in the OERA Managing a task by binding a stateless AppServer Agreement Validate Customer if ? Context Enter Order if ? Confirm Inventory if ? Calculate Price if ? Agreement Task Agreement Client RUN PERSISTENT DELETE PROCEDURE AppServer  This method is strongly discouraged! Uncontrolled binding to client Not suitable for SOA direction

© 2006 Progress Software Corporation24 ARCH-3 Context Management in the OERA Accessing shared procedure instances  Pre-start commonly used PERSISTENT procedures as part of AppServer start-up  Use a ‘gateway’ (Service Interface) procedure to route client requests  Or: Have the Service Interface start procedures the first time they are needed  Session manager on the server

© 2006 Progress Software Corporation25 ARCH-3 Context Management in the OERA Using a Service Interface procedure and session manager ClientServer UI Procedure DATASET dsOrder Business Entity DATASET dsOrder Data-Access Object DATASET dsOrder RUN fetchOrder IN hdsOrder (..., OUTPUT DATASET dsOrder BY-REFERENCE) RUN FetchWhere IN hEntity (..., OUTPUT DATASET phFetchDataSet BY-REFERENCE) fetchWhere: FILL ATTACH Client Proxy Service Interface Session Manager

© 2006 Progress Software Corporation26 ARCH-3 Context Management in the OERA Using a Session Manager DEFINE TEMP-TABLE ttEntity FIELD EntityName AS CHARACTER FIELD EntityHandle AS HANDLE FIELD DAOHandle AS HANDLE INDEX EntityName EntityName. FUNCTION getEntityHandle RETURNS HANDLE (INPUT pcEntityName AS CHARACTER): DEFINE VARIABLE hEntity AS HANDLE. FIND FIRST ttEntity WHERE ttEntity.EntityName = pcEntityName NO-ERROR. IF NOT AVAILABLE (ttEntity) THEN hEntity = startEntity(pcEntityName). ELSE hEntity = ttEntity.EntityHandle. RETURN hEntity. END FUNCTION. /* getEntityHandle */

© 2006 Progress Software Corporation27 ARCH-3 Context Management in the OERA Using a Session Manager - 2 FUNCTION startEntity RETURNS HANDLE (INPUT pcEntityName AS CHARACTER): DEFINE VARIABLE hEntity AS HANDLE. DEFINE VARIABLE hAccess AS HANDLE. RUN VALUE("be" + pcEntityName + ".p") PERSISTENT SET hEntity NO-ERROR. IF VALID-HANDLE(hEntity) THEN DO: CREATE ttEntity. ASSIGN ttEntity.EntityName = pcEntityName ttEntity.EntityHandle = hEntity. END. RETURN hEntity. END FUNCTION. /* startEntity */

© 2006 Progress Software Corporation28 ARCH-3 Context Management in the OERA Alternatives for maintaining context  Pass context information back and forth between client and server The context is held on the client  Store context between client requests in a shared data store All AppServer sessions can read and write it The context is held on the server

© 2006 Progress Software Corporation29 ARCH-3 Context Management in the OERA Using the AppServer in “stateless” mode AppServer session AppServer broker All client requests

© 2006 Progress Software Corporation30 ARCH-3 Context Management in the OERA Agenda  Client to Database – a brief history  AppServer modes and issues  Thinking about procedures and context  Maintaining context on the client  Maintaining context on the server  Conclusions

© 2006 Progress Software Corporation31 ARCH-3 Context Management in the OERA Passing Context between Client and Server  Context/Parameter temp-table passes context back and forth  Name & Value fields allow flexibility  Or just use a delimited list in a CHAR param  Context is maintained on the client  Useful for moderate amounts of data Also for context used on the client And for context modified on the client

© 2006 Progress Software Corporation32 ARCH-3 Context Management in the OERA context/parameter temp-table Context Between Client and Server -- Batching Client Server UI Procedure DATASET dsOrder Business Entity DATASET dsOrder RUN fetchOrder IN hdsOrder (..., OUTPUT DATASET dsOrder BY-REFERENCE) RUN FetchWhere IN hEntity (..., OUTPUT DATASET phFetchDataSet BY-REFERENCE) Client Proxy Procedure Server Gateway Procedure WhereString = “…” NextRowid = 63524

© 2006 Progress Software Corporation33 ARCH-3 Context Management in the OERA Using a context temp-table FIND ttContext WHERE ttContext.ContextName = "WhereString" NO-ERROR. IF NOT AVAILABLE(ttContext) THEN DO: CREATE ttContext. ttContext.ContextName = "WhereString". END. ttContext.ContextValue = "OrderNum = " + STRING(iOrderNum). /* …and the same for NextRowid */  Useful for any flexible set of parameters or context values in a single interface

© 2006 Progress Software Corporation34 ARCH-3 Context Management in the OERA Agenda  Client to Database – a brief history  AppServer modes and issues  Thinking about procedures and context  Maintaining context on the client  Maintaining context on the server  Conclusions

© 2006 Progress Software Corporation35 ARCH-3 Context Management in the OERA Context Maintained on the Server  Hold context in a shared server-side data store Typically a database table  Useful for context not to pass back and forth Session context such as language, authorization that does not change Also useful for large amounts of context data  Storing context on the server can be the best universal approach

© 2006 Progress Software Corporation36 ARCH-3 Context Management in the OERA Built-in support for UUIDs and GUIDs in 10.1A  Requires a Context ID passed from the client  GENERATE-UUID Universal Unique IDentifier Returns a 16-byte RAW (binary) value Guaranteed unique across all space and time  GUID ( ) Global Unique IDentifier Converts a UUID into a 36-character GUID –XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX  SUBSTRING(BASE64-ENCODE(GENERATE-UUID),1,22) Yields a more compact 22-character string

© 2006 Progress Software Corporation37 ARCH-3 Context Management in the OERA Context ID parameter Context Stored on the Server Client Server UI Procedure DATASET dsOrder Business Entity DATASET dsOrder RUN fetchOrder IN hdsOrder (..., OUTPUT DATASET dsOrder BY-REFERENCE) RUN FetchWhere IN hEntity (..., OUTPUT DATASET phFetchDataSet BY-REFERENCE) Client Proxy Procedure Server Gateway Procedure ContextID = Context English Auth …

© 2006 Progress Software Corporation38 ARCH-3 Context Management in the OERA ProDataSet and Temp-Table Context  Store retrieved data in a context table For WebSpeed or other clients with no ProDataSet support RAW fields and BLOBs for generic storage Or store as XML in CHARACTER format  Store successive updates before commit Allows partial validation on the server Final update ProDataSet rebuilt from context

© 2006 Progress Software Corporation39 ARCH-3 Context Management in the OERA ProDataSet or Temp-Table Data as Context Client Server Web browser Business Entity DATASET dsOrder Browser code RUN FetchWhere IN hEntity (..., OUTPUT DATASET phFetchDataSet BY-REFERENCE) Server Gateway Procedure ContextID = Context Order 1 Line Order 1 Line Order 1 Line 1 “OrderNum = 1” Ord 1 L 1 Q 20 Application

© 2006 Progress Software Corporation40 ARCH-3 Context Management in the OERA Defining a context management table  SessionID – identify a client session  ContextID – identify a specific task or transaction within a session  ContextName – Table name or other tag (like ‘WhereString’)  ContextValue – Primary key value for a table, or string value for another tag  isBeforeRow – flag for ProDataSet rows  RowSequence – for ordering table rows  TimeStamp – when the row was created or last updated (also a DeleteTime for cleanup)  RawData – temp-table row data

© 2006 Progress Software Corporation41 ARCH-3 Context Management in the OERA Creating a context row phBuffer:RAW-TRANSFER(TRUE, /* from buffer to RAW */ BUFFER ContextStore:BUFFER-FIELD("RawData")). ASSIGN ContextStore.TimeStamp = NOW ContextStore.DeleteTime = DATETIME-TZ( DATE(NOW) + 1, MTIME (NOW), TIMEZONE(NOW)). CREATE ContextStore. ASSIGN ContextStore.ContextID = pcContextID ContextStore.ContextName = phBuffer:Name ContextStore.ContextValue = cKeyValues ContextStore.RowSequence = piSequence ContextStore.isBeforeRow = FALSE.

© 2006 Progress Software Corporation42 ARCH-3 Context Management in the OERA ContextStore rows wxyzeOrder271FALSEabcdraw buffer wxyzeOline27 11FALSEabcdraw buffer wxyzeOline27 22FALSEabcdraw buffer SessionIDContextIDContextNameContextValueRowSequenceisBeforeRowRawData

© 2006 Progress Software Corporation43 ARCH-3 Context Management in the OERA RAW-TRANSFER limitations  Low-level – does not recognize fields or other buffer specifics  Temp-table definitions must match exactly  Use for short-term storage

© 2006 Progress Software Corporation44 ARCH-3 Context Management in the OERA Agenda  Client to Database – a brief history  AppServer modes and issues  Thinking about procedures and context  Maintaining context on the client  Maintaining context on the server  Conclusions

© 2006 Progress Software Corporation45 ARCH-3 Context Management in the OERA Design for the OpenEdge AppServer  AppServer lets you locate business logic where it belongs to improve performance  AppServer is the basis for all Open Client access,.NET support, Web services, etc.  Stateless or statefree mode gives you the greatest flexibility and scalability  Avoid binding the AppServer to a client session

© 2006 Progress Software Corporation46 ARCH-3 Context Management in the OERA Design context management into your application as a “feature”  Store small amounts of context on client  Store larger amounts of data on server  Design general solutions into your application architecture  Consider needs of platforms like WebSpeed and Web services for SOA

© 2006 Progress Software Corporation47 ARCH-3 Context Management in the OERA Design for the future  Prepare your application for future requirements WebSpeed for a browser-based UI.NET, PDA, or other new UI platforms Access as Web Services Service Oriented Architecture

© 2006 Progress Software Corporation48 ARCH-3 Context Management in the OERA PSDN white papers on Implementing the OpenEdge Reference Architecture -- The Service Interface Layer -- Context Management

© 2006 Progress Software Corporation49 ARCH-3 Context Management in the OERA Questions?

© 2006 Progress Software Corporation50 ARCH-3 Context Management in the OERA Thank you for your time

© 2006 Progress Software Corporation51 ARCH-3 Context Management in the OERA