840 likes | 960 Views
Introduction . 3-Tier Client/Server Overview by Gary Rau DS513 April 29, 1999 http://people.ce.mediaone.net/grau/clientserver.html. What is Client/Server?.
E N D
Introduction 3-Tier Client/Server Overview by Gary Rau DS513 April 29, 1999 http://people.ce.mediaone.net/grau/clientserver.html
What is Client/Server? • 1) Client/Server describes the relationship between two computer programs in which one program, the client, makes a service request from another program, the server, which fulfills the request. • 2) Tiers describe the logical partitioning of an application across clients and servers.
2-Tier and 3-Tier Architecture • 2-Tier splits the processing load in two. Application logic runs on client, which communicates with data on server. • 3-Tier splits the processing load between clients that run user interface logic, application server running business logic, and database/legacy application.
Characteristics of Client/Server Systems • Service • Shared resources • Asymmetrical protocols • Transparency of location • Platform independence • Message-based exchanges • Encapsulation of services • Scalability • Integrity
2-Tier vs 3-Tier Comparison I 2 3 Comments Characteristic
2-Tier vs 3-Tier Comparison II 2 3 Comments Characteristic
2-Tier vs 3-Tier Comparison III 2 3 Comments Characteristic
2-Tier vs 3-Tier Comparison IV 2 3 Comments Characteristic
Client/Server Technologies • File Servers • Database Servers • Transaction Servers • Groupware Servers • Object Application Servers • Web Application Servers
ProductionData Client/Server withFile Servers Client Communication Protocols Server Server PageServer Application File Server File Calls
ProductionData Client/Server with Database Servers Client Communication Protocols Server Server PageServer Application DBMS Server SQL Calls
ProductionData Client/Server withTransaction Servers Client Communication Protocols Server Server PageServer Application DBMS & TP Monitor Transactions
ProductionData Client/Server with Groupware Servers Client Communication Protocols Server Server PageServer Application Groupware Server Groupware Messages
Objects Client/Server with Object Application Servers Client Communication Protocols Server ORB ORB Server PageServer Application Object Services Remote Method Invocation
HTML Documents HTML & Forms Java Client/Server with Web Application Servers Client Communication Protocols Server Server PageServer Application CGI Application HTTP over TCP/IP
Middleware I • The “/” in Client/Server • All the distributed software needed to support interactions between clients and servers • Client-side API to invoke a service • Transmission of request and response over network
Middleware II • Provide platform for running server-side components; responsible for: • Load balancing • Integrity of transactions • High availablity • Secure environment
Objects Web Groupware OLTP DBMS Client/Server Software Infrastructure Client Middleware Server Service-Specific ODBC | TxRPC | Mail | ORB | HTTP Browser DSM GUI/OOUI SNMP | CMIP | Tivoli/ORB NOS Directory | Security | Distributed File DSM RPC | Messaging | Peer-to-Peer DSM CustomServer Transport Stack OS OS NetBIOS | TCP/IP | IPX/SPX | SNA
Component-Based Architecture • Develop in small steps (4X4) • Applications reuse components • Encapsulate services • Off-the-shelf, mix-and-match • Component environments get better with age
Component Types • Services encapsulate a business function • Objects encapsulate specific data with the associated business functions • Stateless objects retrieve required instance data when needed, and update database when done • Stateful objects are unique. Changes in state must be captured by the infrastructure.
Design Patterns • Greenfield • Turbocharger • Integrator
DBMS Greenfield Pattern Graphical User Interface Services Database GUI/OOUI TP Monitor or OTM
DBMS Turbocharger Pattern Existing System Graphical User Interface Services and Data GUI/OOUI TP Monitor or OTM Middle-Tier Database
DBMS Integrator Pattern Existing System Graphical User Interface Services and Data GUI/OOUI TP Monitor or OTM Middle-Tier Database
When to use 3-Tier • > 50 services or classes • > 1 application language or development organization • > 1 different data source • > 3 years application life (especially if modifications/additions are expected) • > 50,000 transactions per day • > 300 users on same system using same database • significant interapplication communication • growth expectations
Secrets for 3-Tier Success • Keep it simple • Design up front • Buy, don’t build • Rely on industry standards • Use a TP Monitor or OTM • Take baby steps • Use outside help • Address system management during development • Test, test, test • Develop a rollout plan
Overview of scripting lang. • Scripting languages are used for adding client side interaction, publishing live and dynamic data to web site and an ability to communicate with components in application server is making them a very important in building multitier architecture for organizations.
Where scripting lang is important • 1) Datawarehousing. Plays a major role in publishing data out to web • 2) Internet and Intranet Applications. eg Fed Ex. • 3) Applications where deployment is major pain and has lot of remote users.
FileSystem HTML Pages Where they fit in mutitier architecture Client Middle Tier Data Web Server
FileSystem ProductionData HTML Pages Templates, Scripts Runtime Environment Client Middle Tier Data Web Server PageServer
FileSystem ProductionData HTML Pages ProductionData Templates, Scripts ProductionData Components: Enterprise JavaBeans, ActiveX, CORBA Runtime Environment Client Middle Tier Data Web Server PageServer TransactionServer
FileSystem ProductionData HTML Pages ProductionData Templates, Scripts ProductionData Components: Enterprise JavaBeans, ActiveX, CORBA ProductionData ProductionData Custom Objects Runtime Environment Client Middle Tier Data Web Server PageServer TransactionServer Interface CustomServer
FileSystem ProductionData HTML Pages ProductionData Templates, Scripts ProductionData Components: Enterprise JavaBeans, ActiveX, CORBA ProductionData ProductionData Custom Objects Runtime Environment Client Middle Tier Data Web Server Browser Very Thin PageServer TransactionServer Interface CustomServer
FileSystem ProductionData HTML Pages ProductionData Templates, Scripts ProductionData Components Components: Enterprise JavaBeans, ActiveX, CORBA ProductionData ProductionData Custom Objects Runtime Environment Client Middle Tier Data Web Server Browser Very Thin PageServer Browser Thin TransactionServer Interface CustomServer
FileSystem ProductionData HTML Pages ProductionData Templates, Scripts ProductionData Components Components: Enterprise JavaBeans, ActiveX, CORBA ProductionData ProductionData Custom Objects Components Scripting in Multitier Architecture Client Middle Tier Data Web Server Browser Very Thin PageServer Browser Thin TransactionServer Interface CustomServer Stand-aloneApplication Rich
Thick or thin client ?? How user utilize system? Heavy dataentry VB Client VB Client Heavy Batchprocessing Instant ReportAccess ASP Client ASP Client Mainly External Access System consideration based on heavy database access and development team
Major vendors supporting scripting language deployment Page Server client Sybase PowerDynamoActive Server pages Netscape Livewire(javascript)Cold Fusion browser Database JaguarCTS MTS SilverStream Oracle app server NetDynamics Thick client Component Server
Where CGI fits in • CGI. The classic way to perform server-side functions is via Common Gateway Interface (CGI). Many CGI programs use Perl, a scripting language well-suited to the task. However, you can write CGI programs in practically any language including C++, Python, and Java. Without careful planning, CGI can introduce security holes in your server, and CGI programs are usually hard to debug and difficult for casual programmers to write.
Server side scripting(eg ASP) • ASP is a deployment environment for server side scripting • Client call the page server where the scripts resides. • Scripts then query against the database or components to create dyanamic content on the client.
Server side scripting(eg ASP) • Jscript(competition of javascript) and Vbscript are the scripting languages used in ASP environment. • ASP files on the server can be updated at any time. Simply save the changes to the file and the script will be automatically compiled the next time the Web page is loaded.
Server side scripting(eg ASP) • ASP includes five standard objects for global use • Request -- To get information from the user • Response -- To send information to the user • Server -- To control the Internet Information Server • Session -- To store information about and change settings for the user's current Web-server session • Application -- To share application-level information and control settings for the lifetime of the application
VBscript(Overview) • Visual Basic Scripting Edition, also known as VBScript, enables authors to create scripts using a subset of the Microsoft Visual Basic language. If you are already a Visual Basic programmer, or if you are not a programmer but are looking for a scripting language that is easy to learn, VBScript might be the right language for you. VBScript is implemented as a fast, portable interpreter for use in Web browsers and applications that use ActiveX™ controls, Java applets, and OLE Automation servers.
VBScript -- Features • Error handling. VBScript has a subset of the error handling provided by Visual Basic. This includes the error object and on error resume next. Error handling is very important when developing server-side code, since most of the functionality will require access to external COM objects, which could throw errors. • Formatting. VBScript has the ability to format dates, numbers, and currency built into the language.
VBScript -- Features • Easier COM integration. Many COM objects return information in the form of a collection. VBScript has built-in support for iterating through collections • Standard Event-binding Syntax. Visual Basic developers will immediately recognize the object_event (sub button1_onclick) naming convention for event handlers. VBScript works in exactly the same way, so in any application that supports event binding (such as Internet Explorer, Outlook, and Windows Scripting Host), you can use this syntax for your event hook-up code.
VBScript -- Advantages • Easy to understand and master. VBScript's biggest asset is that it's Basic, a language designed to be learned quickly. Visual Basic has brought Basic users some of the advantages of more complex languages, while not losing sight of the fact that the language should be easy to understand. • It's Visual Basic. All the skills learned with VB instantly apply to VBScript. Also, an enormous community exists to provide training, books, and magazines for learning Visual Basic. • Flexible. VBScript can be used in a wide variety of applications, and Microsoft is committed to ensuring that wherever script is part of an application, VBScript will be included.
VBScript --- Syntax • <CENTER> • <P> • <H2>Hello, world sample</H2> • <INPUT TYPE=BUTTON VALUE="Click me" NAME="BtnHello"> • </CENTER> • <SCRIPT LANGUAGE="VBScript"> • <!-- • Sub BtnHello_OnClick • MsgBox "Hello, world!", 0, "My first active document" • End Sub • --> • </SCRIPT>
JScript(Overview) • JScript is Microsoft's implementation of an ECMA-compliant scripting language (like JavaScript) that is targeted specifically to the Internet. Like VBScript, JScript is implemented as a fast, portable interpreter for use in Web browsers and applications that use ActiveX controls, Java applets, and OLE Automation servers. JScript is not Java and has nothing to do with Java. It is closer in syntax to C or C++.
Jscript Features • Dynamic: JScript was designed as a completely dynamic language; that is, you can effectively redefine your program on the fly. While this has a number of potential disadvantages, it does give you the ultimate flexibility in your scripts. This is particularly useful in DHTML programming, since DHTML allows you to dynamically manipulate the object model. If you really want to drive DHTML, you might want to consider using JScript instead of VBScript. • Object oriented: JScript certainly isn't a traditional class-based, object-oriented language, but it does provide an effective alternative based on prototypes. This allows you to reap the benefits of object orientation without the statically defined nature of classes.
Jscript - Features • Regular expressions: A main reason why Perl has such a huge following. Regular expressions add the ability to search for expressions in strings. This is exceptionally useful on the server and, increasingly, on the client. • Eval: Provides the ability to immediately evaluate code at runtime. This allows you to dynamically redefine logic dependent at run time. This is especially useful when used in conjunction with Remote Scripting, which works with VBScript as well.
Jscript -- Advantages • Broad reach. JScript is pretty much guaranteed to run in any browser, anywhere. If your page really must work in any browser, this is the language for you. • All those books in the bookstore. How many books can there be? If you want to learn JScript, there are myriad books to help you. • Similarity to C and Java. If you are a C or Java programmer, the JScript syntax is going to be familiar to you.