240 likes | 365 Views
GR01E - Electronic Commerce Overview. Module 1 Technology:. D. Distributed Computing. Why distributed systems: Benefits & Challenges. The Sydney Olympic game system: see text page 29-30. Divide-and-conquer. Interacting autonomous systems. Concurrencies. Transactions.
E N D
GR01E - Electronic Commerce Overview Module 1 Technology: D. Distributed Computing
Why distributed systems: Benefits & Challenges The Sydney Olympic game system: see text page 29-30 Divide-and-conquer Interacting autonomous systems Concurrencies Transactions
A three-tier architecture What is middleware?
How to get it work Open systems, standards, protocols Message passing Distributed objects technology: e.g. CORBA (multi-language technology) RMI (Java-based technology) etc
Clients and Servers Servers: File server, Database server, Web server, print server, object server Not mainframe-terminal, not necessarily big vs. small (rather specialized) The new hype: peer-to-peer
Database servers Relational database: series of tables that can contain links • Functions of a database server: • To interpret SQL statements • To optimize queries • To prevent the errors from concurrent access • To ensure internal consistency (referential integrity) • To detect and act upon deadlock • To administer security • To administer backup and recovery. A distributed database is one whose tables are distributed among a number of networked computers downloading, data replication, fragmentation
SQL (Structured Query Language) Most common database access language often embedded within another language such as C++ or Java. There are several dialects such as ANSI/ISO SQL, IBM DB2, Ingres variant, a Microsoft SQL server variant and an Oracle variant. Example: SELECT BookId, Title, Borrowings.BorrowerName FROM Borrowings, Privileged WHERE Borrowings.BorrowerName = Privileged.BorrowerName Commit, rollback, locks …
The history of SQL and relational databasesSQL was based on ideas propounded in the early 1970s from the ideas of the research scientist Ted Codd at the IBM San José Research Laboratories. It was originally developed in order to provide a semi-natural language interface to the IBM relational database system. Originally relational databases had a number of competitors which were much more efficient in terms of performance, for example database management systems which were based on a network model of data. However, more and more efficient implementations emerged in the late 1980s and this has lead to the situation where relational databases and SQL now dominate the software industry. D. Ince, Developing Distributed and E-commerce Applications, Addison Wesley 2002
Web Servers How Web servers work Web pages: HTML
Static pages, dynamic pages, … web services HTML (see text page 111-113) Server side programs: Forms, CGI, Perl, ASP, Servlets (memory resident), … Client side programs: Java applets, JavaScript, VBScript, …
<HTML><HEAD><TITLE> Links Page </TITLE></HEAD><BODY><H1> Darrel Ince's links </H1>You really ought to look at these sites:<UL> <LI> <A HREF = "http://www.WelshRugby.com/home"> The home of Welsh rugby </A> </LI> <LI> <A HREF = "http://www.open.ac.uk/staff/Darrel"> My home page</A></LI> <LI> <A HREF = "http://www.open.ac.uk/Faculty/Computing"> My department's page</A></LI></UL></BODY></HTML>
Computer Person Execute Read/Scan Process Goals Interface Output Evaluate Web design and usability
Jamie Blustein’ resources: http://www.cs.dal.ca/~jamie/course/CS/4173/Resources/#UI … for example: http://www.usability.gov/guidelines/
Server side programs: Servlets Forms, CGI, Perl, ASP, Servlets (memory resident), … HTML GET and POST
They are portable across a wide variety of servers. • Since servlets are written in Java they can access a huge variety of Java features including CORBA, RMI, Java security facilities and database connectivity facilities. • Servlets are resident in memory. With CGI programming in languages such as Perl every time a request comes in from a Web browser a new process has to be spawned and terminated when the connection ends. This means that there can be quite a heavy overhead on the Web server when it loads and unloads programs. • Since servlets are Java-based they will contain all the security and safety features that are built into the language. • Servlets can maintain state across requests, something that in the early days of the World Wide Web proved difficult. This means that a servlet can remember data and details from a previous request. • The object-oriented model within Java is a much cleaner model than is found with languages such as C and Perl. When you look at Perl CGI programs you often see huge, monolithic, difficult-to-understand programs. The object-oriented nature of Java also provides the potential for greater reuse. • Servlets, because they integrate well with the security technology associated with Java can be configured to be highly secure.
Client side programs: Java applets, JavaScript, VBScript, … Examples: Java applet: <OBJECT code = "java:name" WIDTH = n HEIGHT = n></OBJECT> <SCRIPT LANGUAGE = "JavaScript">document.writeln( "<H3> Hello there");</SCRIPT> JavaScript:
XML: eXtensible Markup Language What is XML? markup language, language to define languages
attribute tag <PRODUCT Postage = “Heavy”><PRODUCTNAME> CoatBlue</PRODUCTNAME><PRODUCTPRICE> 34000</PRODUCTPRICE>..</PRODUCT>
Document type definition:language definition <?xml version = "1.0" encoding ="UTF-8"?><!DOCTYPE ENTRY[<!ELEMENT ENTRY ENTRYPAIR*><!ELEMENT ENTRYPAIR (NAME, DEFINITION)><!ELEMENT NAME (#PCDATA)><!ELEMENT DEFINITION (#PCDATA)><]> Example: <ENTRY> <ENTRYPAIR> <NAME>Dodo</NAME> <DEFINITION> A dead bird</DEFINITION> </ENTRYPAIR> <ENTRYPAIR> <NAME>Blackbird</NAME> <DEFINITION> A thieving bird</DEFINITION> </ENTRYPAIR> </ENTRY>
Processing XML documents: XML browsers XML parsers XML API
SGML: General Markup Language FSML: Financial Services Markup Language SVG: Scalable Vector Graphics (www consortium) MathML XHTML: proposed successor of HTML …
Concurrencies and Locks • Thread: chunk of code that can be executed in parallel (independent) of other • chunks of code. A scheduler supervises the execution of threads. • In a distributed system we relay on independent processes, for example, we might have to wait for some requested data. In the meantime we could use the processor time other tasks that might be pending. • good distributed systems are multi-threaded • parallel computing: `utilization of multiple processors’ However, if a thread depends on some data that should not be modified by another thread during its processing, then we have to lock that data. Client-servers: Write locks, read locks, … and dead locks (time limits, lock manager, …) Database servers: Row-, page-, table-, database-locking
Transactions Sequence of operations ACID: Atomicity, Consistency, Isolation, Durability Server transactions vs concurrent transactions Transaction monitors e.g. Sun’s Enterprise JavaBeans interfaces classes containers servers transaction monitor …
(Ro)bots, agents and spiders • Program that `travel the web’ to gather information • Static argents • Mobile agents For example, search engines, web tools such as inactive-link alert, news agents, e-mail harvesting for spamming, …