OpenEdge™ John Sadd Progress Fellow and OpenEdge Evangelist.
Developing a 21 st Century Point of Service using the latest OpenEdge tools Brian Preece Business...
-
Upload
coleen-robbins -
Category
Documents
-
view
216 -
download
1
Transcript of Developing a 21 st Century Point of Service using the latest OpenEdge tools Brian Preece Business...
Developing a 21st Century Point of Service using the latest OpenEdge tools
Brian Preece
Business Computer Projects
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Session Objectives
• To describe how we used OpenEdge features both old and new to create an Operationally Responsive Point of Service
2Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Who are BCP?• Major supplier in Europe of Food Wholesale,
Retail and Cash and Carry systems • Users: Spar, NISA, Pets at Home, BWG,
Musgrave, ADM, Morrisons, etc…• Area: currently UK and EU, keen to expand!• 1st “Extranet” - Late 1970s Telspar
• 1st Scanning in convenience stores in UK• Early adopter of SonicMQ with our AIMS
wholesale/ retail messaging hub• Continuous innovators
3Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
4Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
5Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Business velocity is increasing
Typical Business SLAs 106 105 104 103 100 10 1 0 Seconds
Source: Gartner, Inc.
Automated share trading100 ms 20 ms
Supply chain updates1 day 15 min
Phone activation1 min3 days
1 week 0.5 hour Refresh data warehouse
Track financial position5 min1 day
Airline operations20 min 30 sec
Trade settlement5 days 2 hrs.
mail express fax e-mail real time Business Process
same-day service
Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Supply Chain Operational Responsiveness
Developing a 21st Century Point of Service using the latest OpenEdge tools
7
GS1Cost effective
Product information
EPOSReal time links
Essential demand tracking
Demand ForecastingSophisticated buying
Voice Deliver stock cheaply
Through Accuracy
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
8Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
The Retail Challenge
• Many stores and no IT expertise in the stores• Fixes and new features need to be rolled out as
fast as possible• But visiting each store is very expensive• This implies a thin client solution
BUT• MUST BE RESILIENT - the store must continue
to trade as long as one till still works– Even if: no back office
no AppServer™
no comms9Developing a 21st Century Point of Service using the latest OpenEdge
tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Changes to Business Model
• Independent stores coalescing into chains• Wholesalers buying retail stores and running as
multiple chain• Hence desire for
– Centralised control
– Centralised data management
– Centralised data analysis
10Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
11Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
“Classic” WebClient Architecture
12Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Semi-disconnected Architecture
13Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• 9.0 WebClient• 10.1 Sonic Integration features• 10.1 XML features• 10.2 GUI for .NET• 10.1/ 10.2 OO ABL
Tools we used
Developing a 21st Century Point of Service using the latest OpenEdge tools
14
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
15Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale 16
Demo
Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Demo setup
Developing a 21st Century Point of Service using the latest OpenEdge tools
17
Host laptop
“PoS” laptop
LAN
BackOffice
VM
SonicBroker
BODB
CentralManagement
VM
SonicBroker
CMDB
Software Download Site
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
18Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• WebClient for easy deployment– Use temp-tables to store product/ price data, deals, etc.
• Sonic for real time messaging– Transactions are sent to the AppServer in real time
• Sonic Local Persistence to handle disconnection– Connection/ Disconnection handled in the background
• XML to ProDataSet/ Temp-table– Very fast transformation to and fro
– Also give loose coupling between PoS and Back Office
The Basics
Developing a 21st Century Point of Service using the latest OpenEdge tools
19
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Old PoS
Developing a 21st Century Point of Service using the latest OpenEdge tools
20
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of SaleDEV-32: Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale 21
GUI for .NET Transformation
Dynamically coloured buttons
Much cleaner
overall look
Gradient fill spans across
group of objects
Object Oriented
GUI
Bitmap embedded
within button object
Developing a 21st Century Point of Service using the latest OpenEdge tools
Style sheets
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Can use UML to design• More robust since more checking is done at
compile time• Easier to unit test because of small objects with
well defined interfaces• Easier to customise• Defined API• Facilitates continuous integration and other
Agile techniques
OO ABL
Developing a 21st Century Point of Service using the latest OpenEdge tools
22
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
23Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Total rewrite from the ground up• Thin OO wrapper round existing procedural
code• In between solution
We chose the latter on a case by case basis
• Only possible because Progress allow mixing of OO and procedural code!
Three approaches
Developing a 21st Century Point of Service using the latest OpenEdge tools
24
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Essential where code interacts with GUI for .NET
• Highly desirable for main program structure• Highly desirable for code that has either been
badly written or much amended• New code needs to be audited against the
original code• Our example: Scanning
– Core part of the system
– Existing logic must be reused in business entities
OO Redesign
Developing a 21st Century Point of Service using the latest OpenEdge tools
25
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• LibPoSService.p
– Structured procedure
– Reads and Writes to the database
– Contains code for locating product information, creating transaction records, adding items to a transaction, etc
Scanning – Starting Point
Developing a 21st Century Point of Service using the latest OpenEdge tools
26
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• First, the domain level classes are identified
Scanning – Class Model
Developing a 21st Century Point of Service using the latest OpenEdge tools
27
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Next, internal procedures that can be moved to the domain level classes are selected
• In LibPoSService.p we have:
– GetItemDetails:
• Finds a product based on a scanned code
• Outputs product details as a temp-table parameter
– AddItemToBasket:
• Receives product details as a temp-table parameter
• Adds scanned product details to the current basket
Scanning – Code Refactoring
Developing a 21st Century Point of Service using the latest OpenEdge tools
28
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Procedural code is changed to:
– run from temp-tables instead of database tables
– use data access objects to read / write data within the functional code
• Procedures are transformed into class methods in associated domain level classes
Scanning – Code Refactoring
Developing a 21st Century Point of Service using the latest OpenEdge tools
29
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Scanning – Code Refactoring
Developing a 21st Century Point of Service using the latest OpenEdge tools
30
==
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Finally, any remaining “control” code is translated to use the domain level objects.
• As our PoS uses MVC, scanning control code was added to the controller for the main scanning screen
Scanning – Plugging it together
Developing a 21st Century Point of Service using the latest OpenEdge tools
31
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Scanning – Plugging it together
Developing a 21st Century Point of Service using the latest OpenEdge tools
32
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Scanning – Plugging it together
Developing a 21st Century Point of Service using the latest OpenEdge tools
33
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Performed after recoding is complete• Each line of the old code is checked to ensure
that it has been represented in the new code or is definitely not required
Scanning – Code Auditing
Developing a 21st Century Point of Service using the latest OpenEdge tools
34
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
...
run GetItemDetails in hLibPoSService (input dProductID, output table ttItemDetails).
...
run AddItemToBasket in hLibPoSService (input table ttItemDetails, input iQuantity).
...
/* Refresh transaction display */{&OPEN-QUERY-br_saleline}apply “ENTRY” to code-entry in frame f-main.apply “END” to browse br_saleline.
...
/* Recalculate total due and number of items */dTotal = 0.iNumItems = 0.
for each saleline where saleline.trans-id = iTransID no-lock: dTotal = dTotal + saleline.sales-value. iNumItems = iNumItems + saleline.quantity.end.
for each b-tendtran where b-tendtran.trans-id = iTransID no-lock:dTotal = dTotal - b-tendtran.amount.
end.
Scanning – Code Auditing
Developing a 21st Century Point of Service using the latest OpenEdge tools
35
Harvested for reuse in Product class
Harvested for reuse in Product class
Harvested for reuse in Transaction class
Harvested for reuse in Transaction class
Functional equivalent exists as a method in the
ScanningForm class
Functional equivalent exists as a method in the
ScanningForm class
These global variables are now properties of the Transaction class.
These global variables are now properties of the Transaction class.
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• Requires well-structured code• Relies on interworking between OO and
procedural code• Normally achieved by wrapping procedural code
within an OO wrapper• Our example: Deals engine
– Self-contained
– Stateless
– Well defined interface
Re-using Procedural code
Developing a 21st Century Point of Service using the latest OpenEdge tools
36
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• 720 possible combinations! – which is best?
– 4 Cokes for £1
– 4 Soft drinks for £1.25
– Meal deal: drink, sandwich and snack for £2.50
– World Cup deal: 4 beers and 4 crisps for £3
– Bulk buy beer deal: 4 beers for £2.50, 8 beers for £4.50, 16 beers for £8.50
– Customer buys 4 Cokes, 2 Fantas, 6 packets of crisps, 2 sandwiches and 12 beers
• 5000 lines of stateless ABL code!• Must recalculate in real time when an item is scanned!• Development cost £200k 2 years ago
Deals Engine – The problem
Developing a 21st Century Point of Service using the latest OpenEdge tools
37
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
• DealsEngine.p
– Structured procedure with a single entry point
– Reads “static” data from the database
• e.g. the items that make up each deal
– Does not write to the database
• No functional changes required• But the PoS has no database access
Deals Engine – Starting Point
Developing a 21st Century Point of Service using the latest OpenEdge tools
38
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
/*------------------------------------------------------------------------ File : DealsEngine.p Purpose : Deals Procedure Library Syntax : Description : Author(s) : BCP Created : 15/12/2006 Notes : ---------------------------------------------------------------------*//* This .W file was created with the Progress AppBuilder. *//*----------------------------------------------------------------------*/{dsParameters.i}{dsDeal.i}
define buffer stparam for ttParameters.define buffer DealLiveMain for ttDealLiveMain.define buffer DealLiveList for ttDealLiveList.define buffer DealLiveItem for ttDealLiveItem.define buffer LinkedDeals for ttLinkedDeals.
DAParameters:Instance:FetchWhere("", output dataset dsParameters).DADeal:Instance:FetchWhere("", output dataset dsDeal).
...
Deals Engine – Code Changes
Developing a 21st Century Point of Service using the latest OpenEdge tools
39
Define the temp-tables and datasets that will be used in place of the database
tables
Define the temp-tables and datasets that will be used in place of the database
tables
These buffers have the same name as the
database tables in the old procedure
These buffers have the same name as the
database tables in the old procedure
Data access objects are used to populate the temp-
tables
Data access objects are used to populate the temp-
tables
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
class DealsEngine final:
define private variable hDealsEngine as handle no-undo.
constructor public DealsEngine (): super (). run DealsEngine.p persistent set hDealsEngine. end constructor.
destructor public DealsEngine ( ): if valid-handle(hDealsEngine) then delete procedure hDealsEngine. end destructor.
method public character ApplyDealsToBasket(input-output table tBasket, input iLineNumber as integer): run ApplyDealsToBasket in hDealsEngine (input-output table tBasket, input iLineNumber as integer).
end method.
end class.
Deals Engine – OOABL Wrapper
Developing a 21st Century Point of Service using the latest OpenEdge tools
40
Private handle for referencing the structured
procedure
Private handle for referencing the structured
procedure
Constructor loads the procedure persistenlyConstructor loads the procedure persistenly
Destructor deletes the procedure instance
Destructor deletes the procedure instance
Methods expose entry points to the structured
procedure
Methods expose entry points to the structured
procedure
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Agenda
• Business Acceleration and Operational Responsiveness
• The PoS Dilemma• Solving the dilemma using the latest
OpenEdge tools• Demo• A closer look at the tools• Moving to an Object Oriented world• Conclusions
41Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Conclusions
• Business logic is very hard-won – don’t throw it away
• By allowing OO and procedural code to co-exist, Progress have given us choices denied by other vendors when they introduced OO
• Strike a balance between retaining code and rewriting in OO
• Audit the code you rewrite
42Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Questions
43Developing a 21st Century Point of Service using the latest OpenEdge tools
Using the Advanced GUI, Structured Error Handling and SonicMQ to build a Semi-Disconnected Point of Sale
Thank you for your time!
[email protected] our Expo booth!
44Developing a 21st Century Point of Service using the latest OpenEdge tools