Presentation is loading. Please wait.

Presentation is loading. Please wait.

White Star Software Exchange 2005 – DEV-15 DEV-15 All Dynamic Applications John Campbell White Star Software.

Similar presentations


Presentation on theme: "White Star Software Exchange 2005 – DEV-15 DEV-15 All Dynamic Applications John Campbell White Star Software."— Presentation transcript:

1 White Star Software Exchange 2005 – DEV-15 DEV-15 All Dynamic Applications John Campbell White Star Software

2 2 Exchange 2005 – DEV-15 My Background 20 years of Progress Written Several Books Created TailorPro Speaker at many Conferences Architect and Developer

3 3White Star SoftwareExchange 2005 – DEV-15 White Star Software Progress consulting since 1985 Performance and Disaster Recovery –(That’s Adam) Application architecture and development –(That’s me) Personal relationship with clients

4 4White Star SoftwareExchange 2005 – DEV-15 Presentation Overview Design for migrating existing character application to GUI and Web AP Background Application Goals Design and Architecture Technology

5 5White Star SoftwareExchange 2005 – DEV-15 Background Tasked to assist in software design and architecture Existing application partner Medical Practice Scheduling 18-year old Character Application Need to move to GUI for Windows and Full GUI on the Web

6 6White Star SoftwareExchange 2005 – DEV-15 Application Association Had worked on early development Knew Primary Developer Product Knowledge Architectural Skills

7 7White Star SoftwareExchange 2005 – DEV-15 Architecture Goals Too Easy to “code and go” Hard to revise later Good foundation is a key for –Scalability –Flexibility –Maintainability

8 8White Star SoftwareExchange 2005 – DEV-15 Client Profile Medical Scheduling Primarily ASP Model Some on-site installations Needed to support full GUI in web access –Off-site doctors –Off-site data entry

9 9White Star SoftwareExchange 2005 – DEV-15 Application Requirements Extremely Rich Application Some Highly Complex Browsers Complex Business Rules Simple Maintenance Screens No Compromise of Full GUI Run (quickly) Over Internet

10 10White Star SoftwareExchange 2005 – DEV-15 Long Range Goals High usability Realistic data model Ease of Extensibility Ease of Maintainability

11 11White Star SoftwareExchange 2005 – DEV-15 Possible Solutions No Initial Architectural Restrictions We considered the following – Non-Progress – ADM2 – DWP – Progress Dynamics® – Self-made

12 White Star Software Exchange 2005 – DEV-15 Application Design Choices

13 13White Star SoftwareExchange 2005 – DEV-15 Environment Choices Progress –Powerful, Rich Environment –In-house Progress expertise AppBuilder based GUI –Allows Local or Web Distribution WebClient™ for Web –Acceptable issues Dynamic Coding –Small footprint –Single point maintenance

14 14White Star SoftwareExchange 2005 – DEV-15 Data Management AppServer™ Enabled ProDataSets for data management Single server- and client-side apps for –Retrieval –Update –Maintenance

15 15White Star SoftwareExchange 2005 – DEV-15 Architecture Data retrieval modules separated on server Display components data independent Specialized uses means small footprint Many users do same task Reduces overhead of web client download

16 16White Star SoftwareExchange 2005 – DEV-15 Single Applications Data Retrieval Data Storage Lookup Browser Lookup Detail Data Entry

17 17White Star SoftwareExchange 2005 – DEV-15 Interface Some Static Interface Components for Maintainability Dynamic Lookup Browsers, Queries Dynamic Detail Screens Dynamic Data Entry Screens

18 18White Star SoftwareExchange 2005 – DEV-15 Objectives Partition –DB I/O –Validation –Business Rules –Interface Use AB to design –Screens –(Most) Browsers Dynamic Screen Objects Dynamic Data

19 19White Star SoftwareExchange 2005 – DEV-15 Validation and Business Rules Primary Validation on Client Some on server Business rules on server

20 20White Star SoftwareExchange 2005 – DEV-15 Associating Business Rules Data Driven Screens validation Business Rules “Hooks” in code

21 21White Star SoftwareExchange 2005 – DEV-15 Interface Architecture Primary (scheduler) Browser Secondary (lookup) Browse Lookup Detail Maintenance Screens Toolbar

22 22White Star SoftwareExchange 2005 – DEV-15 Scheduler Browser Starting point for all functions –Baseline is Static –Easier visualization –Columns and data dynamic –Individual Cell Colored –Multiple views of data

23 23White Star SoftwareExchange 2005 – DEV-15 Scheduler

24 24White Star SoftwareExchange 2005 – DEV-15 Lookup Browsers Static Window Browser Completely Dynamic Data Context Sensitive Availability is Data-driven Designed with AppBuilder Stored in Repository –Columns –Query –Key fields

25 25White Star SoftwareExchange 2005 – DEV-15 Lookups Dynamic Button if field can be looked up

26 26White Star SoftwareExchange 2005 – DEV-15 Simple Dynamic Browser Dynamic sort and search ability

27 27White Star SoftwareExchange 2005 – DEV-15 Dynamic Browse Code Sample if not valid-handle(hBrowse) then create browse hBrowse assign height = 5 width = 55 frame = frame BrowseFrame:handle row = 2 column = 5 query = hQuery visible = yes sensitive = yes separators = yes width = 65 allow-column-searching = true triggers: on start-search persistent run StartSearch in this-procedure. on value-changed persistent run Valuechanged in this-procedure. on any-printable persistent run AnyPrintable in this-procedure. on backspace persistent run Backspace in this-procedure. on return persistent run BrowseReturn in this-procedure. end triggers.

28 28White Star SoftwareExchange 2005 – DEV-15 Dynamic Browse Code Sample for each tBrowseColumn: /* point to the dynamic temp-table field which corresponds to our static temp-table structure; build the browse column exactly like the temp-table column, which is a proxy for the actual DB Column of the same name */ hTTColumn = hTTBuffer:buffer-field(ColumnName). /* c-race.race-code */ hBRColumn = hBrowse:add-like-column(hTTBuffer:name + "." + hTTColumn:name) no-error. if tBrowseColumn.ColumnLabel <> "" then hBRColumn:label = tBrowseColumn.ColumnLabel. /* let the browse know if we can sort on this column */ hBRColumn:private-data = string(sortable). end. assign fieldrow = hbrowse:row + hBrowse:height-chars +.1 hBrowse:fit-last-column = yes hFillin:row = hBrowse:row + hbrowse:height.

29 29White Star SoftwareExchange 2005 – DEV-15 Lookup Detail - Design Static window Dynamic Fields Designed with App Builder Stored in Repository

30 30White Star SoftwareExchange 2005 – DEV-15 Simple Detail Screen

31 31White Star SoftwareExchange 2005 – DEV-15 Lookup Detail - Function Not updateable Context sensitive Persistent window –Data changes if browse row changes

32 32White Star SoftwareExchange 2005 – DEV-15 Maintenance Screens - Design Similar to lookup Detail: –Static window –Dynamic fields –Build with AppBuilder + Tool Save screen definition data to repository

33 33White Star SoftwareExchange 2005 – DEV-15 Maintenance Screens - Function Single Toolbar for all Applications Able to associate maintenance screen with a specific browse –Data context sensitive Also can run any screen standalone

34 34White Star SoftwareExchange 2005 – DEV-15 Dynamic sort, search and filter

35 35White Star SoftwareExchange 2005 – DEV-15 Screen Repository Location of interface data Small Tables Easy to Transfer Data Simple to identify if already on client –(Don’t reload) Static temp-tables –Clarity –Maintenance

36 36White Star SoftwareExchange 2005 – DEV-15 Repository Structure Module Browse Maint Screen Detail Screen Program ColumnsProgramFields Program Fields

37 37White Star SoftwareExchange 2005 – DEV-15 Screen Scaling Originally None Ultimately –Agreed to limit Number of Browse Columns Number of Screen Fields

38 38White Star SoftwareExchange 2005 – DEV-15 Data Management Dynamic temp-tables defined for user data ProDataSets used for these TTs Dynamic query for context-sensitive data DataSource set to dynamic query

39 39White Star SoftwareExchange 2005 – DEV-15 Data Management Menu Choice Client App Server / DB Screen Data Request Screen Paint Data Selection User Data Request Data Presentation Data Update Data Storage

40 40White Star SoftwareExchange 2005 – DEV-15 1 – Menu Choice 2 – Screen Paint 3 – User Data 4 – Data Update

41 41White Star SoftwareExchange 2005 – DEV-15 Code Sample /* --------------- get actual table data ------------------ */ /* first, create an empty DB buffer structure */ create buffer hDBBuffer for table pTableName. /* create the empty temp-table structure handle */ create temp-table hDataTT. /* clone the DB structure into the temp table */ hDataTT:create-like(pTableName). /* add the rowid field so we can find the DB record later */ hDataTT:add-new-field("fRowid","rowid"). /* set it to undo-able so we can set tracking changes on */ hDataTT:undo = yes. /* create the temp-table with a name of "t" + the table name: tc-race note -- this is critical in the submitchanges.p program -- q.v. */ hDataTT:temp-table-prepare("t" + pTableName). /* get a buffer handle for the temp table */ hTTBuffer = hDataTT:default-buffer-handle.

42 42White Star SoftwareExchange 2005 – DEV-15 Code Sample Continued /* now create a dataset for the t-t buffer */ create dataset hDataSet. hDataset:set-buffers(hTTBuffer). /* Next, create the query to the DB */ create query hDbQuery. hDBQuery:set-buffers(hDBBuffer). /* now, a data-source for the query and tt-buffer */ create data-source hDataSource. hDataSource:query = hDBQuery. hTTBuffer:attach-data-source(hDataSource). /* set an event method to populate each row with the rowid */ hTTBuffer:set-callback-procedure("after-row-fill","SetRowid",this- procedure). /* create a query for getting records out of the DB */ hDBQuery:query-prepare(pQueryPhrase). /* fill the dataset from the query */ hDataSet:fill().

43 43White Star SoftwareExchange 2005 – DEV-15 Submitting Changes assign hAfterBuffer = hSaveDataSet:get-buffer-handle(1) hBeforeBuffer = hAfterBuffer:before-buffer. /* temp-table name = "t" + tablename, so table name is obtained by shaving off the leading "T" */ create buffer hDBTable for table substring(hAfterBuffer:name,2). /* build a query so we can process the T-T records */ create query hQuery. hQuery:add-buffer(hBeforeBuffer). /* knows about both creates and deletes */ hQuery:query-prepare("for each " + hBeforeBuffer:name). hQuery:query-open(). hQuery:get-first().

44 44White Star SoftwareExchange 2005 – DEV-15 Saving Updated Records do while not hQuery:query-off-end transaction: case hBeforeBuffer:row-state: when row-modified then do: /* get the rowid of the databse table from the t-t record */ pRowid = hBeforebuffer:buffer-field("frowid"):buffer-value. /* find the DB record */ hDBTable:find-by-rowid(pRowid) no-error. /* see if the "before" T-T and the DB are different */ RecordUnchanged = hBeforeBuffer:buffer-compare(hDBTable). /* if the db record isn't changed, we can save data back */ if RecordUnchanged and hDBTable:available then do: /* but it's the AFTER record which holds the changes */ hAfterBuffer:find-by-rowid(hBeforeBuffer:after-rowid) no-error. /* if everything is OK, then we copy the after to the DB */ hDBTable:buffer-copy(hAfterBuffer). end. end. /* modified */

45 45White Star SoftwareExchange 2005 – DEV-15 Save Row Changes Simple method for saving ProDataSet changes Seems to work fine if DataSource is buffer, or static query Apparently need to have individual code blocks for modified, created and deleted if DataSource is dynamic query

46 46White Star SoftwareExchange 2005 – DEV-15 Validation Programs Simple validation on client Complex validation on server Data driven

47 47White Star SoftwareExchange 2005 – DEV-15 Validation Programs Maintenance Screen repository has field for validation program Server side program associated with buffer name –Table level validation –Field level –Internal procedures –Code looks for program and internal procedures according to naming conventions

48 48White Star SoftwareExchange 2005 – DEV-15 Conclusion Progress offers significant value in application development Application partners are choosing it to build new apps with Language is unbelievably powerful and flexible

49 49White Star SoftwareExchange 2005 – DEV-15 More Conclusions There are many Progress development paradigms Sometimes, you don’t need to use an existing model Full development model does not need to be –Complex –All-encompassing

50 50White Star SoftwareExchange 2005 – DEV-15 Dynamic Coding Distinct advantage of Progress Gives significant versatility Can be well written (if documented) Highly compact Extremely powerful Very flexible

51 51White Star SoftwareExchange 2005 – DEV-15 White Star Software Contact us at wss.com Questions?


Download ppt "White Star Software Exchange 2005 – DEV-15 DEV-15 All Dynamic Applications John Campbell White Star Software."

Similar presentations


Ads by Google