1 / 14

Lecture 7

Lecture 7. Interaction. Topics. Implementing data flows An internet solution Transactions in MySQL 4-tier systems – business rule/presentation separation Forms and URL in PHP User modelling Long running processes. Service Provider. Consolidator. extract. Schedule data.

ernie
Download Presentation

Lecture 7

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 7 Interaction

  2. Topics • Implementing data flows • An internet solution • Transactions in MySQL • 4-tier systems – business rule/presentation separation • Forms and URL in PHP • User modelling • Long running processes

  3. Service Provider Consolidator extract Schedule data Validate and load Consolidated schedules

  4. Typical implementation • The provider prepares the schedule file – e.g. extract process in scheduling software • The file is transmitted to the consolidator • mailing a floppy disk • emailing the file • ftp’ing the file … • The consolidator’s system has a scheduled task to pick up new schedule files, process them against the database and log any errors. • The report of the success or the list of errors must be returned to the provider

  5. Internet solution • Consolidator provides form • Provider selects schedule file • Schedule file sent to server • Server executes script to: • validate data • Update database • Return log of actions and errors

  6. Summary of actions • Script generates the form and returns it • User selects file • PUT action sends file to server • Script reads (parses) file (from temporary folder) • Script validates file • Script creates SQL statements to update the database • Script executes SQL in a TRANSACTION • Script returns the log of actions and errors

  7. 4-tier systems • Consider the task of displaying the number of minutes to the next bus on a given route. • This information can be requested • Via a web form • Via a Wap phone • Via SMS • From a partner system • Need to separate: • Logic to process the request and get the minutes to go – Business logic • Logic to respond to input and present data appropriate to interface - Presentation

  8. SMS caller Browser routettg?rn=70 SMS message Sms request HTML Get view of data and format as Web Page (source) Get view and return SMS message Nextbus?routeno=70 minutes Compute next bus time(source) 4-tier system

  9. user browser Server1 Server2 db Sequence diagram

  10. PHP and forms • Fields on form are named • e.g. route • When form submitted with GET, name/value pairs are attached to URL • e.g. prog.php?route=70 • In script, values are accessed with variables of the same name • e.g. If ($route == ’70’)…

  11. PHP and URLs • PHP can open URL just like a file • e.g. $fn= fopen(“http://www.google.com/search?q=SMS”); • Parameters can be included in URL • Web services provide more powerful interface

  12. User models

  13. Long Running Processes • Users are concerned with units of work which are bigger than a single interaction • Issuing a new schedule (with all the attendant changes that have to take place) • On-line shopping order and delivery • Exam preparation and monitoring • Much interest in support for ‘Business Processes’ • Languages and notations to define business processes • ebXML, RAD, Activity Diagrams

  14. Tutorial • To discuss the issues in the Exercises • Design, no implementation (unless you want to) • Questions appropriate to the exam

More Related