ARCH-07: ARCH-07: Implementing the Implementing the OpenEdge™ Reference OpenEdge™ Reference Architecture – Part Architecture – Part 2 2 John Sadd Progress Fellow and OpenEdge Evangelist
Jan 05, 2016
ARCH-07: ARCH-07: Implementing the Implementing the OpenEdge™ Reference OpenEdge™ Reference Architecture – Part 2Architecture – Part 2
John Sadd Progress Fellow and OpenEdge Evangelist
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation2 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Separated presentationand integration layers
Data accessabstracted from
storage
Common business logic with
advanced models
OpenEdge Reference Architecture – a layered view
Users Users
Presentation Layer
Business Servicing Layer
Data Access Layer
Managed Data StoresManaged
Data StoresUnmanaged Data Stores
Unmanaged Data Stores
Enterprise Services
Enterprise Services
Integration Layer
Modern Application ArchitectureModern Application Architecture
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation3 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
AgendaAgenda
Introducing the Service Interface Layer Managing ProDataSet Instances Context Management Creating a WebSpeed® User Interface Additional Topics and Futures Conclusions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation4 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Enterprise Services
Enterprise Services
Bus Task
Bus Task
Bus Task
SOA – Service Interaction ModelSOA – Service Interaction Model
Bind Invoke
Service
Requestor
Service
Requestor
Service
Provider
Service
Provider
Broker/ Director
yService
Broker/ Director
yService
Find / Details
Publish
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation5 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Container-managedContainer-managedSupport ServicesSupport Services
Service Proxy
Presen
tation
Co
ntain
er
Service Interface
Service C
on
tainer
Client Side
Server Side
Order Mgmt
…
Sessio
n/C
on
text M
an
ag
em
en
t
Tra
nsactio
n C
on
trol
Secu
rity
Fn()Fn()
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation6 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
The Service Interface Layer The Service Interface Layer in the Architecturein the Architecture
Users Users
Business Servicing Layer
Data Access Layer
Managed Data StoresManaged
Data StoresUnmanaged Data Stores
Unmanaged Data Stores
Enterprise Services
Enterprise Services
Integration Layer
Service Interface
Presentation Layer
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation7 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Role of the SampleRole of the SampleService Interface LayerService Interface Layer
Manages server-side entities– Keeps an in-memory catalog of running
instances Provides standard one-call access to
server-side procedures Provides a single simplified API from
client to server
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation8 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
The Service Interface Layer The Service Interface Layer
Client Server
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
Cli
ent
Pro
xy
Ser
ver
Gat
eway
Service Interface
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation9 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Client-side SI ProxyClient-side SI Proxy
dsOrderWinAdv.w
{dsOrder.i}{proSIproxyStart.i}…RUN fetchWhere INghProxySIproc(INPUT “Order”, INPUT ttContextDSOrder, OUTPUT DataSet dsOrder).
proSIproxy.p
PROC fetchWhere:RUN proSIgateway.p ON hAppServer (INPUT “Order”, INPUT “fetchWhere”…)
…
(call to server-side gateway)
User interface
procedure
Client proxy
procedure
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation10 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Server-side SI ProceduresServer-side SI Procedures
proSIgateway.p
hEntity = getEntityHandle in hSI.RUN fetchWhere in hEntity…
proSIserver.p
DEFINE T-T ttEntity…FN startEntity:FN getEntityHandle: /* entity temp-table lookup */FN getDAOHandle:
(call from client session)
(call to Business Entity API)
Server gateway
procedure
Server service
procedure
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation11 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Gateway Procedure APIGateway Procedure API
Five standard parameters– Logical entity name– Logical operation name– Context/parameter temp-table for passing any related
values back and forth– OUTPUT or INPUT-OUTPUT ProDataSet
Depending on whether ProDataSet definition or values need to be passed in
– OUTPUT status for exception handling Useful default for many operations
– Use custom APIs and custom gateway procedures for special operations
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation12 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
AgendaAgenda
Introducing the Service Interface Layer Managing ProDataSet Instances Context Management Creating a WebSpeed® User Interface Additional Topics and Futures Conclusions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation13 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Management of ProDataSet InstancesManagement of ProDataSet Instances
Which object “owns” the ProDataSet instance on server and client?
ProDataSets can be passed BY-REFERENCE to avoid copying
The caller’s instance is always used, even on OUTPUT– This will be extended in 10.1 to support a
“pull” model where the called procedure’s instance is used
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation14 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
ProDataSet Instances on ProDataSet Instances on OUTPUTOUTPUT
Client Server
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
Clie
nt
Pro
xy P
roce
du
reBY-REF
Ser
ver
Gat
eway
Pro
ced
ure
HANDLE
DATASET-
HANDLE BY-REF
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation15 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
AgendaAgenda
Introducing the Service Interface Layer Managing ProDataSet instances Context Management Creating a WebSpeed® User Interface Additional Topics and Futures Conclusions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation16 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Context Management BasicsContext Management Basics
Target environment is client to state-less or state-free AppServer
Each interaction is independent Maintain context between related
interactions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation17 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Passing Context between Passing Context between Client and ServerClient and Server
Context/Parameter temp-table passes context back and forth
Name & Value fields allow flexibility Context is maintained on the client Useful for small amounts of data
– Also for context used on the client
– And for context modified on the client
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation18 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
context/parameter
temp-table
Context Between Client and ServerContext Between Client and 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)
Clie
nt
Pro
xy P
roce
du
re
Ser
ver
Gat
eway
Pro
ced
ure
WhereString = “…”
NextRowid = 63524
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation19 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Context Maintained on the ServerContext 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 Requires a Context ID passed from the client
– GUID support in sample and in 10.1
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation20 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
context/parameter
temp-table
Context Stored on the ServerContext 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)
Clie
nt
Pro
xy P
roce
du
re
Ser
ver
Gat
eway
Pro
ced
ure
ContextID = 95847
95847 English Auth …
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation21 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
ProDataSet and Temp-table ContextProDataSet 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 Store successive updates before commit
– Allows partial validation on the server
– Final update ProDataSet rebuilt from context
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation22 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
ProDataSet or Temp-table Data ProDataSet or Temp-table Data as Contextas Context
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)
Clie
nt
Pro
xy P
roce
du
re
Ser
ver
Gat
eway
Pro
ced
ure
ContextID = 95847
95847 Order 1 Line 1
95847 Order 1 Line 2
95847 Order 1 Line 1
“OrderNum = 1”
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation23 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
AgendaAgenda
Introducing the Service Interface Layer Managing ProDataSet Instances Context Management Creating a WebSpeed® User Interface Additional Topics and Futures Conclusions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation24 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
AgendaAgenda
Introducing the Service Interface Layer Managing ProDataSet Instances Context Management Creating a WebSpeed® User Interface Additional Topics and Futures Conclusions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation25 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
White Paper:White Paper:Using an Unmanaged Data StoreUsing an Unmanaged Data Store
Uses an XML document in place of the database
Alternative Data-Source procedure identifies the document
Custom code populates the ProDataSet Remaining Business Entity code runs
unmodified
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation26 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
White Paper: Simple .NET Interface to White Paper: Simple .NET Interface to Business EntitiesBusiness Entities
Code generator creates a XSD file with a DataSet description
This in turn creates a C# class file for the DataSet
C# version of the client proxy runs the same gateway procedure on the AppServer
C# DataSet class file used to build the UI
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation27 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
White Paper:White Paper:Advanced Business LogicAdvanced Business Logic
The role of database trigger procedures One Business Entity accessing another One Data Access Object accessing
another When to allow direct database access
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation28 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
The Sample Implementation and The Sample Implementation and Future ReleasesFuture Releases
Significant new language extensions planned for 10.1 and beyond– Elements of an OO4GL such as classes
– Auditing and other built-in core services Materials to be revised and extended to
describe 10.1 best practices
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation29 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
AgendaAgenda
Introducing the Service Interface Layer Managing ProDataSet Instances Context Management Creating a WebSpeed User Interface Additional Topics and Futures Conclusions
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation30 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
In SummaryIn Summary
Think about and plan for services in your application
Think about which objects control the data Think about context and other aspects of
a stateless application server
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation31 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Questions?Questions?
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation32 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2
Thank you for Thank you for your time!your time!
Sim
plify
you
r bu
sin
ess
Sim
plify
you
r bu
sin
ess
© 2005 Progress Software Corporation33 ARCH07: Implementing the OpenEdge Reference Architecture – Part 2