Presentation is loading. Please wait.

Presentation is loading. Please wait.

Information Systems Development 3 Lecture 2 3-tier application architecture A technical view.

Similar presentations


Presentation on theme: "Information Systems Development 3 Lecture 2 3-tier application architecture A technical view."— Presentation transcript:

1 Information Systems Development 3 Lecture 2 3-tier application architecture A technical view

2 Themes Architecture : The large scale structure of a system, especially a computer systemArchitecture Communications : The interaction between componentsCommunications Description: Patterns and story-tellingPatternsstory-telling Choice –Design decisions: design decisions which face a developerDesign decisions –Infrastructure choice: selecting the most appropriate software from the available range.Infrastructure choice

3 Displaying a Web page in a Browser Lecture 2 URL is decoded : protocol/host/file Page requested from host Page is returned HTML codes determine how text is rendered If page contains links e.g., browser must repeat the same process on each

4 Dynamic Web page needed when: consistent look and feel on each page of a large site data is derived from a database depends on real time pages depend on user choice business transactions e.g. e-commerce…

5 3-tier architecture A Presentation layer using Browser technologyPresentation An Application layer using a web application server platform + application programsApplication A Persistence layer using a relational database or other data store technologyPersistence

6

7 Presentation layer arch arch Issue request to remote server accept the returned HTML (or JPEG..) file render (i.e. create a 2-d image ) the HTML allow plug-ins to handle new file types execute client-side scripts in JavaScript support interaction between client-side scripts and the web page accept user input via a variety of controls on a form

8 Persistence layer arch arch interaction with the database using standard languages e.g SQL queries and table returns define and modify the data structures (e.g. tables) themselves ( the Database Schema) insert, update and delete data maintain data persistently, with backup and recovery handle transactions to support concurrent access to the database via locking et optimise access by compilation of queries, indexing, replication of tables etc.

9 Application Layer arch arch accepting requests from the Presentation layer interpreting the requests according to business rules and past transactions from this client requesting the appropriate data from the Persistence layer computing derived data creating the HTML (or GIF, MIDI..) for the page providing run-time support for: – thousands of concurrent users –compilation to machine code –multi-threading [ allow multiple processes to run concurrently] –caching [holding results in a temporary store to reduce re- calculation]

10 Web Application Platforms Server side includes - files with a.shtml extensionServer side includes Cgi using Perl or other scripting language PHP like SSI, a scripting language which is embedded in an HTML page.PHP Microsoft’s ASP (Active Server Pages ) J2EE –JSP for page scripting –Java + class library –Multiple runtime vendors Tomcat, BEA.NET is the latest technology from MS..NET –range languages (VB.NET, C#,, C++, Cobol... ) –compiled to a common intermediate code (MSIL) –Extensive class library –ASP.NET scripting page scripting

11 3-tier Issues Advantages: –Re-use of appropriate software –Software can be located on different machines for convenience and performance –Resolves one-many relationships – many clients – one application, many applications – one database Challenges: –well-defined, standardised interfaces between layers required. –Software must be built to conform to interface standards –The designer has to decide where to locate specific functions

12 Communication The ‘glue’ in this architecture is communication between software in the layers A single request from a user results in a complex flurry of communications and executions The flurry is composed of hundreds of simple interactionssimple interactions Sequence diagrams can be useful to provide a simplified description

13 Simple Interaction Call/reply pattern caller callee parameters function reply

14 A function call in PHP in a php script –the script is the caller –the date procedure is the callee –the string “H:I” is the parameter – –the function is to get the current date and time – –the reply – a string containing the time in the required format e.g. “13:45”

15 A browser requests a page The user clicks on a link on a page. The link has an href=http://host/dir/page.html –The browser is the caller –The web server program(Apache or IIS) on the machine host is the callee. –The string “dir/page.html” is the parameter –The function is to read that file in its file store –The reply is the contents of the file

16 A browser requests a script to execute The user clicks on a link on a page. href=http://host/dir/getemp.php?empno=5 –The browser is the caller –The web server on the machine host is the callee. –The string “dir/getemp.php?empno=5” is the parameter –The function when the suffix is php is to find the script, call it with the parameter and get the output.call it –The reply is the reply from getemp.php

17 Server runs a PHP script The web server is the caller The getemp.php script is the callee The parameter is empid = 5 The function is to find the details of employee 5 and format a report to perform this function, the script calls mysql_connect procedures which in turn calls the mySQL server …. The reply is HTML text

18 Simple Interaction Variations How does the caller find the callee? What does the caller do when is waiting for a reply? What happens if the callee doesn’t reply? How long should the caller wait until it thinks the callee isn’t going to reply? Is a reply always required?

19 Sequence diagram of SMS bus times request

20 A Pattern A pattern recurs in different guises –have the same overall structure and purpose, –with slight differences Patterns help us understand and describe complex systems Patterns ‘normalise’ descriptions – one thing in one place Same unit plays different ‘roles’ –webserver is callee with respect to (wrt) browser, caller wrt getemp.php Patterns are ‘fractal’

21

22

23 Other layered architectures ANSI/SPARC Database model –The external or user level, characterised by Views –The Conceptual level, comprising the full corporate data model at a logical level –The Physical level, where data is stored in files

24 Channels between Layers Layered communications model (Tanenbaum) Application Layer Transport Layer Network Layer Data Link Layer Physical Layer Presentation <> Middleware –HTTP (The protocol which supports GET and POST messages) carrying a limited number of types of content (MIME types) Middleware <> Data stores –ODBC with SQL request and table returns (whole table or row at a time)

25 Review Questions Place the following terms in the 3-tier architecture: –JavaScript, SSI, J2EE, MySQL, Oracle, CSS, PHP, ASP.NET, Flash, Java Applets, JSP, Dreamweaver, Visual.NET

26 Straw Poll application Which parts belong to which tier of the 3- tier model script? What is the ER model of the database? What must be done to make selected improvements to this application? Describe the interaction when a user votes; when the tally page is requested.

27 Platform Comparision Enterprise solutions J2EE versus.NET –Simple words such as “better” or “faster” are best used by simpletons. Life, especially when it involves critical enterprise applications, is more complicated. PHP versus.NET –Language wars

28 Comparison criteria Other considerations, such as the perception of the vendor as an “enterprise company”, conformance to standards, strength of the ecosystem around the product, the degree to which the product is a de facto standard amongst its class, stability of the product or technology, ease of use, IDE integration and other tool support, total cost of ownership (TCO), portability and lock-in (or lack thereof), scalability and many other such factors often outweigh Performance among our customers.


Download ppt "Information Systems Development 3 Lecture 2 3-tier application architecture A technical view."

Similar presentations


Ads by Google