Presentation is loading. Please wait.

Presentation is loading. Please wait.

ARCH-03: Implementing the OpenEdge™ Reference Architecture – Part 1 John Sadd Progress Fellow and OpenEdge Evangelist.

Similar presentations


Presentation on theme: "ARCH-03: Implementing the OpenEdge™ Reference Architecture – Part 1 John Sadd Progress Fellow and OpenEdge Evangelist."— Presentation transcript:

1 ARCH-03: Implementing the OpenEdge™ Reference Architecture – Part 1 John Sadd Progress Fellow and OpenEdge Evangelist

2 Simplify your business © 2005 Progress Software Corporation2 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1Agenda n Introducing the Sample Implementation n Business Entities and Data Access Objects n Business Logic Issues n Conclusions

3 Simplify your business © 2005 Progress Software Corporation3 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Separated presentation and integration layers Data access abstracted from storage Common business logic with advanced models OpenEdge Reference Architecture – a layered view Users Presentation Layer Business Servicing Layer Data Access Layer Managed Data Stores Managed Data Stores Unmanaged Data Stores Unmanaged Data Stores Enterprise Services Enterprise Services Integration Layer Modern Application Architecture

4 Simplify your business © 2005 Progress Software Corporation4 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 What are the Objectives of the Sample Implementation? n To provide an understanding of the OpenEdge Reference Architecture by describing a sample implementation n To help you understand best practices for using OpenEdge features n To motivate architects & lead developers to think about applying the Architecture to their own projects

5 Simplify your business © 2005 Progress Software Corporation5 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 What Are Non-goals? n Not a new framework n Not intended to be comprehensive or to cover all application use cases n Not intended to be commercialized n Not intended to be used without changes, extensions, and understanding

6 Simplify your business © 2005 Progress Software Corporation6 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 How Should I Use the Sample Implementation? n Use it to learn Architecture concepts more deeply n Use it to learn how best to use Progress 4GL constructs and other features n Consider it as a potential useful starting point for OpenEdge 10 application development

7 Simplify your business © 2005 Progress Software Corporation7 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 What Resources are Available? - White Papers and Example Code 1. Introduction 2. Business Entities and Data Access Objects 3. The Service Interface Layer 4. Using Advanced ProDataSet Language Features 5. Using an Unmanaged Data Store 6. Building a.NET™ Interface to Business Entities 7. Advanced Business Logic Issues 8. Context Management 9. Building a WebSpeed® User Interface 10. …

8 Simplify your business © 2005 Progress Software Corporation8 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 What is in the Sample Implementation Code Base? n Templates directory –Template procedures for BE’s, DAO’s etc. n Support directory –Supporting supers & other procedures n Samples directory –Code samples from the papers –These use sports2000 but there is nothing database-specific about any sample code

9 Simplify your business © 2005 Progress Software Corporation9 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Where Do I Find It? n The white papers and sample code are on the PSDN website at: –psdn.progress.com/library/product_info/ oera/index.ssp n There will be ongoing updates n Later material will describe best practices for using OpenEdge 10.1 and its OO4GL features

10 Simplify your business © 2005 Progress Software Corporation10 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1

11 Simplify your business © 2005 Progress Software Corporation11 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1Agenda n Introducing the Sample Implementation n Business Entities and Data Access Objects n Business Logic Issues n Conclusions

12 Simplify your business © 2005 Progress Software Corporation12 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 The Business Entity and Data Access Object in the Architecture Users Business Servicing Layer Data Access Layer Managed Data Stores Managed Data Stores Unmanaged Data Stores Unmanaged Data Stores Enterprise Services Enterprise Services Integration Layer Business Entity Data Access Object Presentation Layer

13 Simplify your business © 2005 Progress Software Corporation13 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 The Business Entity n Manages the logical, internal view of application data –Provides data to the UI and other integration layers –Contains business logic n Data is best represented as ProDataSets and their temp-tables n The Business Entity is the core value of building applications in OpenEdge Business Entity Data Access Object DB UI API logicalphysical

14 Simplify your business © 2005 Progress Software Corporation14 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 The Data Access Object n Manages the physical data store –Understands the schema or other description of the physical data –Maps between this and the logical view n All references to the physical data store should be confined to the Data Access Object Business Entity Data Access Object DB UI API logicalphysical

15 Simplify your business © 2005 Progress Software Corporation15 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 ProDataSet The ProDataSet as a Building Block Data-Relation1 CustomerTT 1Lift Line Skiing 2Urpon Frisbee 3Hoops Croquet OrderTT 6101/05/93 36101/19/93 79102/10/93 Database Customer Lift Line Skiing Urpon Frisbee Hoops Croquet Order 15301/01/93 28101/04/93 36601/04/93 Event Logic Dataset:Before-fill Buffer:Before-fill Before-row-fill Row-Add Row-Delete … Data-Source1 Field Map CustNum Name Contact Data-Source2 Field Map OrderNum CustNum OrderDate Query… Q1 for Customer Query… Q2 for Order

16 Simplify your business © 2005 Progress Software Corporation16 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Constructing the Objects – Temp-table Definitions n Define temp-tables for logical data definitions –Each temp-table in its own include file DEFINE TEMP-TABLE eOrder FIELD OrderNum… DEFINE TEMP-TABLE eOrderLine FIELD OrderNum… FIELD LineNum… etOrder.i etOrderLine.i n Separate physical from logical data definitions

17 Simplify your business © 2005 Progress Software Corporation17 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Guidelines for Temp-table Definitions n Prefix table name with e –For example n eCustomer n Prefix include files with et –etCustomer.i n Rename fields for consistency or comprehensibility n Remove unwanted: –Fields –Indexes n Add other joined DB fields n Add calculated fields that might be required for ease of use n Add BEFORE-TABLE to end of definition when tracking changes n Don’t use LIKE syntax –Temp-table LIKE database-table –Field LIKE database- field

18 Simplify your business © 2005 Progress Software Corporation18 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 TEMP-DB Maintenance Tool (10.0B)

19 Simplify your business © 2005 Progress Software Corporation19 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Constructing the Objects – Data-source Objects n Build Data-Source object procedure –Each maps a temp-table to its physical data etOrder.i etOrderLine.i DEFINE DATA-SOURCE srcOrder FOR QUERY qOrder. ATTACH-DATA-SOURCE() DEFINE DATA-SOURCE srcOrderLine FOR BUFFER OrderLine. ATTACH-DATA-SOURCE() sceOrder.p sceOrderLine.p Application Database

20 Simplify your business © 2005 Progress Software Corporation20 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Constructing the Objects – ProDataSet Definitions n Define ProDataSets for sets of related data –Each is the basis for a Business Entity DEFINE DATASET dsOrder FOR eOrder, eOrderline… etOrder.i etOrderLine.i dsOrder.i

21 Simplify your business © 2005 Progress Software Corporation21 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Constructing the Objects – Data Access Object n Build Data Access Object for the DataSet –Manages all the Data-Source objects daOrder.p sceOrderLine.p dsOrder.i sceOrder.p

22 Simplify your business © 2005 Progress Software Corporation22 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 All the Data Access Components Together Application Database daSupport.p initDataSources: SUPER daOrderValidate.p (optional) eOrderLineModifyBeginTrans: sceOrder.p DEF DATA-SOURCE ATTACH-DATA-SOURCE RowFill handler sceOrderLine.p DEF DATA-SOURCE ATTACH-DATA-SOURCE sceItem.p DEF DATA-SOURCE ATTACH-DATA-SOURCE daOrder.p {dsOrder.i} {daEntity.i}

23 Simplify your business © 2005 Progress Software Corporation23 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Constructing the Objects – Business Entities n Build a Business Entity for each ProDataSet –Manages business logic on the logical data –Defines the API for access from other objects DEFINE DATASET dsOrder FOR eOrder, eOrderline… BusinessLogic: END PROCEDURE. etOrder.i etOrderLine.i dsOrder.i

24 Simplify your business © 2005 Progress Software Corporation24 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Business Entity Components Together beOrder.p {dsOrder.i} {beEntity.i} beEntity.i RUN daOrder.p dsOrder.i {etOrder.i} {etOrderLine.i} {etItem.i} DEFINE DATASET… beOrderValidate.p (optional) eOrderLineModifyPreTrans: beSupport.p fetchCustom saveChanges SUPER Data Access Object

25 Simplify your business © 2005 Progress Software Corporation25 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1Agenda n Introducing the Sample Implementation n Business Entities and Data Access Objects n Business Logic Issues n Conclusions

26 Simplify your business © 2005 Progress Software Corporation26 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Business Entity Logic Issues n How strictly do I adhere to logic separation –Do I use an API call just for a CAN-FIND? –Do I defer that to a database trigger? n How much standard behavior should be automated by “magic”? n How do I adjust logic to allow for re-use of tables in other ProDataSets? n When do I use static versus dynamic table and ProDataSet references?

27 Simplify your business © 2005 Progress Software Corporation27 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Accessing other Entities Through their APIs n Avoid direct database access to other tables from your Business Entities FIND eOrder WHERE eOrder.OrderNum = eOrderLine.OrderNum {&NoError}. hCustomer = SIfindRow("Customer", "eCustomer", "CustNum", STRING(eOrder.CustNum)). IF hCustomer:BUFFER-FIELD("Discount"):BUFFER-VALUE <.35 THEN DO: ASSIGN BUFFER eOrderLine:ERROR = YES BUFFER eOrderLine:ERROR-STRING = "Line " + STRING(eOrderLine.LineNum) + ": Changes not allowed … ". RETURN. END.

28 Simplify your business © 2005 Progress Software Corporation28 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Standard “Magic” Behavior PROCEDURE initDataSources : IF LOOKUP(phDataSet:NAME + "BeforeFill", cEntries) NE 0 THEN phDataSet:SET-CALLBACK-PROCEDURE ("BEFORE-FILL", phDataSet:NAME + "BeforeFill", TARGET-PROCEDURE). IF LOOKUP(phDataSet:NAME + "AfterFill", cEntries) NE 0 THEN phDataSet:SET-CALLBACK-PROCEDURE ("AFTER-FILL", phDataSet:NAME + "AfterFill", TARGET-PROCEDURE). n Callback procedures set up through a naming convention

29 Simplify your business © 2005 Progress Software Corporation29 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Organizing Logic for Maximum Re-use n Logic that references more than one table in the ProDataSet –This should go into the Data Access Object itself PROCEDURE eOrderLineAfterFill: DEFINE INPUT PARAMETER DATASET FOR dsOrder. DEFINE VARIABLE dTotal AS DECIMAL NO-UNDO. FOR EACH OrderLine WHERE OrderLine.OrderNum = eOrder.OrderNum: dTotal = dTotal + OrderLine.ExtendedPrice. END. eOrder.OrderTotal = dTotal. END PROCEDURE.

30 Simplify your business © 2005 Progress Software Corporation30 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Static Versus Dynamic Code PROCEDURE eItemAfterRowFill: DEFINE INPUT PARAMETER DATASET-HANDLE phDataSet. …. hItemName = phDataSet:GET-BUFFER- HANDLE("eItem"):BUFFER-FIELD("ItemName"). DO iType = 1 TO NUM-ENTRIES(cItemTypes): cType = ENTRY(iType, cItemTypes). IF INDEX(hItemName:STRING-VALUE, cType) NE 0 THEN hItemName:BUFFER-VALUE = REPLACE(hItemName:BUFFER-VALUE, cType, cType). END. END PROCEDURE. n Dynamic table reference allows reuse

31 Simplify your business © 2005 Progress Software Corporation31 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1Agenda n Introducing the OpenEdge Reference Architecture Implementation n Business Entities and Data Access Objects n Business Logic Issues n Conclusions

32 Simplify your business © 2005 Progress Software Corporation32 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 In Summary n View the sample implementation materials as a basis for discussion and learning n Use parts that are useful n Extend or replace for your own purposes n Expect it continue to grow and change n Don’t expect it to be completed or formally supported

33 Simplify your business © 2005 Progress Software Corporation33 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1Questions?

34 Simplify your business © 2005 Progress Software Corporation34 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1 Thank you for your time!

35 Simplify your business © 2005 Progress Software Corporation35 ARCH-03 – Implementing the OpenEdge Reference Architecture – Part 1


Download ppt "ARCH-03: Implementing the OpenEdge™ Reference Architecture – Part 1 John Sadd Progress Fellow and OpenEdge Evangelist."

Similar presentations


Ads by Google