Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exchange in Real Time DEV-06: The ProDataSet in OpenEdge™ 10 John Sadd Progress Fellow and OpenEdge Evangelist.

Similar presentations


Presentation on theme: "Exchange in Real Time DEV-06: The ProDataSet in OpenEdge™ 10 John Sadd Progress Fellow and OpenEdge Evangelist."— Presentation transcript:

1 Exchange in Real Time DEV-06: The ProDataSet in OpenEdge™ 10 John Sadd Progress Fellow and OpenEdge Evangelist

2 © 2005 Progress Software Corporation2 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Agenda n Distributed Data Management in Version 9 n ProDataSet Overview n Syntax Specifics and Demo n ProDataSet Directions

3 © 2005 Progress Software Corporation3 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Temp-Table Parameters n Define a temp-table –Based on a database table or not n Populate the temp-table on the server –One row or many n Pass the temp-table as a parameter –One parameter for each table n Modify the temp-table on the client and pass it back

4 © 2005 Progress Software Corporation4 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Temp-Table Limitations n Separate table and parameter for each two-dimensional data definition n Parent-child and other relationships need multiple parameters n No standard mechanism to record changes

5 © 2005 Progress Software Corporation5 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 SDOs and SBOs SmartDataObjects in the ADM and Progress Dynamics ® handle: –Distributed data management –Keeping track of changes –Automated update support –Standard events for validation and business logic n SmartBusinessObjects do the same for multiple related tables

6 © 2005 Progress Software Corporation6 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 The direction n Push valuable SDO/SBO behavior down into the 4GL n Define a core 4GL object to represent complex data relationships –One handle, one parameter n Associate validation and other business logic –Built-in events n Map directly to data objects on other platforms

7 © 2005 Progress Software Corporation7 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Agenda n Distributed Data Management in Version 9 n ProDataSet Overview n Syntax Specifics and Demo n ProDataSet Directions

8 © 2005 Progress Software Corporation8 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ProDataSet The ProDataSet 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

9 © 2005 Progress Software Corporation9 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 OpenEdge Business Logic 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 n ProDataSets become a driving force in OpenEdge Applications 4GL or WebSpeed Interface WebClient / HTML User Interface Jonas Grumby 110 Desert Isle Path Minnow, HI OK Cancel OpenEdge 4GL Interface 4GL OpenEdge Web Services Interface

10 © 2005 Progress Software Corporation10 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ProDataSet to ADO.NET DataSet n ProDataSet is a Progress in-memory data store n ProDataSet maps directly to an ADO.NET DataSet, allowing you to: –Design a.NET™ interface in terms of.NET DataSets –Pass data back and forth to Progress AppServer™

11 © 2005 Progress Software Corporation11 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Agenda n Distributed Data Management in Version 9 n ProDataSet Overview n Syntax Specifics and Demo n Futures

12 © 2005 Progress Software Corporation12 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 A ProDataSet is made of Temp-Tables n Define temp-tables in the usual way DEFINE TEMP-TABLE ttOrder /* fields from Order db table */ FIELD OrderTotal AS DECIMAL FIELD CustName LIKE Customer.Name FIELD RepName LIKE SalesRep.RepName. DEFINE TEMP-TABLE ttOrderLine… DEFINE TEMP-TABLE ttItem…

13 © 2005 Progress Software Corporation13 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Define the DataSet n Define the DataSet in terms of the temp-tables it combines DEFINE DATASET dsOrder FOR ttOrder, ttOline, ttItem DATA-RELATION OrderLine FOR ttOrder, ttOline RELATION-FIELDS (OrderNum, OrderNum) DATA-RELATION LineItem FOR ttOline, ttItem RELATION-FIELDS (ItemNum, ItemNum) REPOSITION.

14 © 2005 Progress Software Corporation14 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Data-Relations n Data-Relations define the relationship between parent-child tables n The Relation-Fields define fields in parent and child to use for selection …DATA-RELATION OrderLine FOR ttOrder, ttOline RELATION-FIELDS (OrderNum, OrderNum)… n Relation-Fields are used to determine how to populate the DataSet by default n They also tell Progress how to navigate the DataSet by default

15 © 2005 Progress Software Corporation15 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Populating with Data-Relations n When a DataSet is populated, Progress retrieves children of the current parent …DATA-RELATION OrderLine FOR ttOrder, ttOline RELATION-FIELDS (OrderNum, OrderNum)… ProDataSet Data-Relation OrderTT 6101/05/93 36101/19/93 79102/10/93 OrderLineTT 6100009 6200009 6300011 36100009 36200009 36300011

16 © 2005 Progress Software Corporation16 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Navigating with Data-Relations n When a DataSet is navigated, Progress filters on children of the current parent …DATA-RELATION OrderLine FOR ttOrder, ttOline RELATION-FIELDS (OrderNum, OrderNum)… ProDataSet Data-Relation OrderTT 6101/05/93 36101/19/93 79102/10/93 OrderLineTT 6100009 6200009 6300011 36100009 36200009 36300011

17 © 2005 Progress Software Corporation17 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Defining Data-Sources n You can define a Data-Source for each temp-table buffer in the DataSet n Each Data-Source can define database buffers or a query or both n Data-Source is separate from any DataSet Database OrderOrderLine 15301/01/93 28101/04/93 36601/04/93 Data-Source SrcOrder Data-Source SrcOline Query… Q1 for Order Query… Q2 for OrderLine 15301/01/93 28101/04/93 36601/04/93 ProDataSet OrderTT OrderLineTT

18 © 2005 Progress Software Corporation18 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Defining a Data-Source with a Query n Define a query for a top-level table –For example, which Order(s) to start with –Or to define a join between buffers DEFINE QUERY qOrder FOR Order, Customer, SalesRep. DEFINE DATA-SOURCE srcOrder FOR QUERY qOrder Order KEYS (OrderNum), Customer KEYS (CustNum), SalesRep KEYS (SalesRep). QUERY qOrder:QUERY-PREPARE ("FOR EACH Order WHERE Order.OrderNum = " + STRING(iOrderNum) + ", FIRST Customer OF Order, FIRST SalesRep OF Order").

19 © 2005 Progress Software Corporation19 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Defining a Data-Source without a Query n If there’s a Data-Relation, its fields can tell Progress how to construct a query DEFINE DATA-SOURCE srcOline FOR OrderLine KEYS (OrderNum). …DATA-RELATION OrderLine FOR ttOrder, ttOline RELATION-FIELDS (OrderNum, OrderNum)… ProDataSet OrderLineTT Data-Relation OrderTT 6101/05/93 36101/19/93 79102/10/93 6100009 6200009 6300011

20 © 2005 Progress Software Corporation20 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Attaching Data-Sources n Data-Sources are defined separately from the DataSet –You can attach a particular Data-Source without changing the DataSet definition –Data-Sources do not travel with the DataSet Database Order Data-Source SrcOrder Query… Q1 for Order 15301/01/93 28101/04/93 36601/04/93 ProDataSet OrderTT 6101/05/93 36101/19/93 79102/10/93

21 © 2005 Progress Software Corporation21 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ATTACH-DATA-SOURCE Method n Relates a Data-Source to a DataSet buffer n Optional arguments: –Field mapping for fields with different names –Except-list to skip unwanted fields, or –Include-list to include only certain fields BUFFER ttOrder:ATTACH-DATA-SOURCE (DATA-SOURCE srcOrder:HANDLE, "Customer.Name,CustName"). BUFFER ttOline:ATTACH-DATA-SOURCE (DATA-SOURCE srcOline:HANDLE). BUFFER ttItem:ATTACH-DATA-SOURCE (DATA-SOURCE srcItem:HANDLE).

22 © 2005 Progress Software Corporation22 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Populating a ProDataSet n Use the FILL method to populate the DataSet n FILL on the DataSet fills every table starting with top-level buffers n FILL on a buffer fills that table and its descendents n FILL-MODE –NO-FILL – skip this table –EMPTY – empty the table first –APPEND – add more records to the table –MERGE – add recs & eliminate dups –REPLACE – replace existing recs

23 © 2005 Progress Software Corporation23 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Event Callback Procedures n You can define event procedures for: –Before and After FILL of the ProDataSet –Before and After FILL of any temp-table buffer –Before and After FILL of any record n Use ProDataSet events to prepare queries, attach Data-Sources, etc. n Use Buffer events to manipulate the table n Use Record events to populate calculated fields n You can use these events when there is no Data-Source at all

24 © 2005 Progress Software Corporation24 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Record-level Event Procedure n Fills a calculated OrderTotal field hBuff:SET-CALLBACK-PROCEDURE ("AFTER-ROW-FILL","postRecordFill",THIS-PROCEDURE). PROCEDURE postRecordFill: DEFINE INPUT PARAMETER DATASET FOR dsOrder. hBuff = hDset:GET-BUFFER-HANDLE(“ttOrder”). FOR EACH OrderLine WHERE OrderLine.OrderNum = INTEGER(hBuff:BUFFER-FIELD("OrderNum"):BUFFER-VALUE): dTotal = dTotal + OrderLine.ExtendedPrice. END. hBuff:BUFFER-FIELD("OrderTotal"):BUFFER-VALUE = dTotal. END PROCEDURE.

25 © 2005 Progress Software Corporation25 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ProDataSet demo…

26 © 2005 Progress Software Corporation26 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Passing a ProDataSet as a Parameter n You can pass a DataSet parameter as: –DATASET – static reference like TABLE for temp-tables –DATASET-HANDLE – dynamic reference to the DataSet and its definition, like TABLE- HANDLE for a temp-table –HANDLE – passes a simple DataSet handle to a local procedure n Note! –Within a single session DataSet parameters can be passed BY-REFERENCE

27 © 2005 Progress Software Corporation27 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Local DataSet Parameter RUN OrderDset.p ON hSession (INPUT iOrderNum, OUTPUT DATASET dsOrder BY-REFERENCE). /* OrderDset.p -- Test proc for Order Dataset */ {dsOrderTT.i} {dsOrder.i} DEFINE INPUT PARAMETER iOrderNum AS INTEGER. DEFINE OUTPUT PARAMETER DATASET FOR dsOrder. ProDataSet OrderTT 6101/05/93 36101/19/93 79102/10/93

28 © 2005 Progress Software Corporation28 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Remote DataSet Parameter RUN OrderDset.p ON hSession(INPUT iOrderNum, OUTPUT DATASET dsOrder BY-REFERENCE). /* OrderDset.p */ DEFINE OUTPUT PARAMETER DATASET FOR dsOrder. ProDataSet OrderTT 6101/05/93 36101/19/93 79102/10/93 ProDataSet OrderTT 6101/05/93 36101/19/93 79102/10/93

29 © 2005 Progress Software Corporation29 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Dynamic ProDataSets n Every element of a ProDataSet can be dynamic –CREATE DATASET –ADD-BUFFER() –ADD-RELATION() n A Data-Source can also be dynamic: –CREATE DATA-SOURCE n And a DataSet can use dynamic temp-tables –CREATE TEMP-TABLE n Attributes and methods manipulate the DataSet through its handle

30 © 2005 Progress Software Corporation30 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Updating Through the ProDataSet n ProDataSet tables have a companion before-image temp-table to record updates (add/change/delete) –Used to pass changes to the server to be made in the Data-Source –Maps to.NET support for update versions

31 © 2005 Progress Software Corporation31 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Before-Image Table for a DataSet n Original values for every modified record ProDataSet Data-Relation OrderTT 6101/05/93 36101/19/93 79102/10/93 OrderLineTT 6100009 6200010 6300011 6400077 0 0 00000A 6 2 00009M 6 5 00022D n Initial values for every added record n Original values for every deleted record Before- Table

32 © 2005 Progress Software Corporation32 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Saving Changes To The Database n Use ATTACH-DATA-SOURCE to reattach the DataSet to the database tables for it n SAVE-ROW-CHANGES method for saving a row to the database –Uses the before-table for optimistic locking –Allows full control in the event of a conflict n ERROR, ERROR-STRING, REJECTED, DATA-SOURCE-MODIFIED attributes

33 © 2005 Progress Software Corporation33 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ProDataSet update demo…

34 © 2005 Progress Software Corporation34 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Agenda n Distributed Data Management in Version 9 n ProDataSet Overview n Syntax Specifics and Demo n ProDataSet Directions

35 © 2005 Progress Software Corporation35 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Enhancements in OpenEdge 10.0B and 10.0B01 n COPY-DATASET method enhancements –Also COPY-TEMP-TABLE –Behavior changed to allow copies between non-identical tables and DataSets n GET-CHANGES and MERGE-CHANGES –include parents of modified rows n FILL-MODE “REPLACE” –Refreshes rows already in the tables –Slower than MERGE because it requires FINDing each row as it is added to the temp-table

36 © 2005 Progress Software Corporation36 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Enhancements in OpenEdge 10.0B and 10.0B01 -- continued n Additional events to support data retrieval transparency –OFF-END for a ProDataSet query –FIND-FAILED for a FIND on a buffer n Extended support for data batching –BATCH-SIZE attribute for a buffer –LAST-BATCH attribute signals end of data –NEXT-ROWID for repositioning a query n See white paper for examples: –psdn.progress.com/library/product_info/ oera/index.ssp

37 © 2005 Progress Software Corporation37 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10

38 © 2005 Progress Software Corporation38 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Data batching demo…

39 © 2005 Progress Software Corporation39 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 D I S C L A I M E R Under Development n This talk includes information about potential future products and/or product enhancements. n What I am going to say reflects our current thinking, but the information contained herein is preliminary and subject to change. Any future products we ultimately deliver may be materially different from what is described here. D I S C L A I M E R

40 © 2005 Progress Software Corporation40 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ProDataSet Features in OpenEdge 10.1 n Direct to-or-from XML conversion –This supports ProDataSets as parameters to Web services n Mapping from ProDataSets to Java™ SDOs n REFERENCE-ONLY to use called procedure’s ProDataSet instance –Also parameter passing BY-REFERENCE for temp-tables

41 © 2005 Progress Software Corporation41 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 ProDataSets address these three key OpenEdge goals 3 Strategic Elements Process Centric Design Business Logic Capabilities SOA Enabled User Interface Independence

42 © 2005 Progress Software Corporation42 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 In Conclusion… n The ProDataSet is a key part of the future of 4GL applications n It is part of a focus on building complex data definitions and business logic in the 4GL n The ProDataSet is a standards-conformant object that will integrate with.NET and Web services as part of a global Service- Oriented Architecture

43 © 2005 Progress Software Corporation43 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Additional Resources n Expert Series book: Using ProDataSets –Now available through amazon.com! n PSDN white paper on Using Advanced ProDataSet Language Features –Part of a series on implementing the OERA n Two-day instructor-led or self-study course: Using ProDataSets n OpenEdge online documentation

44 © 2005 Progress Software Corporation44 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10

45 © 2005 Progress Software Corporation45 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Questions?

46 © 2005 Progress Software Corporation46 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10 Thank you for your time!

47 © 2005 Progress Software Corporation47 Simplify your business Simplify your Business DEV-06: The ProDataSet in OpenEdge 10


Download ppt "Exchange in Real Time DEV-06: The ProDataSet in OpenEdge™ 10 John Sadd Progress Fellow and OpenEdge Evangelist."

Similar presentations


Ads by Google