Faculty of Information Technology Advanced Internet Programming Architecture UTS 2009 Architecture Architect Topics Faculty of Information Technology Generic Architectures Client/Server Three-tier N-tier Sample configurations
Technology Architectures Java EE Microsoft .NET UTS 2009 Architecture Architect Motivation Faculty of Information Technology Architectures: see the big picture abstract away from implementation details focus on design principles allow comparison of seemingly different applications
UTS 2009 Architecture Architect Tiered architectures Faculty of Information Technology One way of classifying enterprise systems is based on the number of tiers In principle, each tier represents a different system executing one piece of the overall application One-tier: non-networked application Two-tier: client/server application Three-tier: business logic is distinct tier N-tier: distributed application UTS 2009 Architecture
Architect One Tier Advantages: simple Faculty of Information Technology Disadvantages: no resource sharing monolithic applications needs powerful computer difficult to maintain difficult to integrate UTS 2009 Architecture not scalable etc.
Architect Two Tier Clien t UTS 2009 Architecture Faculty of Information Technology Server Architect Two Tier Faculty of Information Technology Examples: web browser (client) + web server (server) viewing static HTML pages custom client + database server applications (e.g. order processing, inventory, etc)
UTS 2009 Architecture Architect Two Tier Advantages: shared access to data, resources typically robust, reliable (over private network) less complex UTS 2009 Architecture Faculty of Information Technology Disadvantages: multiple requests for data - tax the network difficult to maintain or extend functionality exposes to security violations
not scalable (especially to web audiences) ties to one presentation type Architect Three Tier User Interface Client PC Business Logic Application Server UTS 2009 Architecture Faculty of Information Technology Data Database Server(s) Other Data
Source(s) Architect Three Tier Faculty of Information Technology Examples: web browser (user interface), CGI program on web server (business logic), database (data) Java Swing client, network connection to remote web services server (business logic) which accesses a database UTS 2009 Architecture Architect Three Tier Advantages: separation of business logic as distinct tier makes maintenance
easier multiple user interfaces can be built and deployed supports applications that use multiple data sources Faculty of Information Technology Disadvantages: complexity vendor incompatibility single point of failure enterprise database, XML documents, directory service encourages applications to reuse data sources UTS 2009 Architecture Architect
N-Tier User Interface Client PC Presentati on Logic Web Server(s) UTS 2009 Architecture Faculty of Information Technology Business Logic Data Application Server(s) Database Server(s)
Other Data Source(s) Architect N-Tier Faculty of Information Technology Examples: component-based application implemented using a web application server e.g. Java Enterprise the focus in this subject UTS 2009 Architecture Architect N-Tier Advantages: supports distributed applications applications are built from reusable
components highly scalable UTS 2009 Architecture Faculty of Information Technology Disadvantages: complexity cost performance load balancing issues complex Architect Which architecture? Faculty of Information Technology
Depends on size of application: One-tier: cannot share data/resources Two-tier: only 1 data source, simple website Three-tier: small application, future integration & reuse of business logic unlikely N-tier: most flexible solution, but complex (more hardware, software, skills) UTS 2009 Architecture Architect B2C: Simple 2-tier caf site Client(s) 2. Faculty of Information Technology Web Server(s) HT T P Request for
Date.html B row ser on Workstation 1. User c lic ks on menu link (on Index.html) to see dates for upc oming events at the Cafe. (Date.html) 4. Date.html displayed in brow ser Index.html Date.html HT T P Response w ith Date.html 3.
UTS 2009 Architecture Architect B2C: 3-tier chat room site 2. Client(s) HT T P Request for form.jsp Business & P resentation L ayer Web or Web Applic ation Server 3. SQL c ommand from form.jsp to save details to the database Index.html
7. User registers on c hat room by c ompleting registration form and then c lic ks on "Submit" button. form.jsp displayed in brow ser Data L ayer Database Servers Registrations Brow ser on Workstation 1. Faculty of Information Technology
4. HT T P Response w ith dynamic ally c reated HT ML page from form.jsp form.jsp Data saved to database SQL Result ie saved 5. 6. HT ML (maybe w ith J avasc ript) + J SP UTS 2009 Architecture Architect
B2C: n-tier grocery shopping site Client(s) 2. HTTP Request for c hec kout.jsp w ith cart details P resentation Logic L ayer 4. Cart details (typic ally sent w ith RMI) Data Layer J ava (Objects)
checkout.jsp Registrations Brow ser on Workstation 3. 5. checkout.jsp runs and sends on cart details 1. User c licks on menu link to "c hec kout" 12. c heckout.jsp displayed in brow ser Business
L ogic L ayer 6. SQL query with quantity of products ordered. Faculty of Information Technology J ava saves details to database 7. HTTP Response w ith dynamically c reated HTML from c heckout.jsp 9.
additem.jsp removeitem.jsp Chec kout details 10. Checkout details calculated and sent on. Data saved to database Reply from database 8. 11. UTS 2009 Architecture Architect
n-tier can get complex...! CLIENT SERVICES WEB "CONTACT" SERVICES CORPORATE DATA SERVICES SERVICES LEGACY SYSTEMS transaction server WEB SERVER Application Servers, ORB, TPM INTERNET SERVICE PROVIDER
WEB SERVER FIREWALL FIREWALL PDA LOAD BALANCER INTERNET Content Management systems, Workflow WEB SERVER BROWSER INTELLIGENT APPLIANCES APPLICATION
SERVICES Faculty of Information Technology DATA BASE ERP DATA BASE Security, Systems Management UTS 2009 Architecture Architect Components/Services Infrastructure Application
Operating System Web Server Application Server Database Server Directory Server Load Balancer Firewalls Proxies/caches
UTS 2009 Architecture Faculty of Information Technology Search Engines Content Management Commerce servers Personalisation and Profiling servers Scenario servers Traffic Analysis servers Site Management servers Monitoring servers Streaming multimedia Architect Technology architectures Faculty of Information Technology
Vendors provide different development and deployment environments Programmers want to code in different languages Programmers need support for building complex applications database interaction transactional interactions (CICS, TUXEDO) application and data security etc. UTS 2009 Architecture Architect Before standard architectures Faculty of Information Technology
Vendors would provide a proprietary software product (development/deployment environment) Programmers would write their code to suit the vendors product Locked into that one vendors product Difficult to integrate applications written using different vendor products UTS 2009 Architecture Architect The current situation Faculty of Information Technology Standards There are two main de-factor standard architectures for developing enterprise applications 1. Java Enterprise (aka Java EE) (& variations e.g. Spring) 2. Microsoft .NET Of course there are other alternatives eg:
Cold Fusion, PHP, etc UTS 2009 Architecture Architect Java EE Overview Faculty of Information Technology Java EE is a specification, not a product it is implemented by a collection of products specifies roles and interfaces to build applications a runtime infrastructure for managing applications The Java EE specification describes: A component model Container requirements Containers hold and manage components. Standard services and APIs Database, Transactions, Security,... etc UTS 2009 Architecture
Architect Java EE Components & Containers UTS 2009 Architecture Faculty of Information Technology Architect Java EE Components Faculty of Information Technology A component is an application-level software unit Like JavaBeans in Java SE Java EE platform supports the following components: Client based: Applets eg: Browser based
Application clients eg: Swing or AWT Java applications, Server based: Web components eg: static or dynamic web pages UTS 2009 Architecture Architect Java EE Containers Faculty of Information Technology Components need an execution environment This is called a Container A container is an application that runs, manages the lifecycle and provides services to components The Web browser is a container for Applets The Java runtime + operating system is the container for Java applications The Web server is the container for Servlets/JSPs The
UTS 2009Application Architecture server is the container Architect for Java EE Containers Faculty of Information Technology For convenience, many vendors have combined these into one package: The Web Application Server UTS 2009 Architecture Architect Java EE Containers Faculty of Information Technology Containers also provide some support
services: database connection pooling container managed persistence local naming and directory services integration with transaction services integration with messaging services UTS 2009 Architecture Architect Java EE Containers Faculty of Information Technology Java EE platform consists of 4 containers 1. Applet container - provides environment for Java applets
1. Application-Client container - provides environment for Java EE application clients 1. Web container - management of servlets and JavaServer pages 1. EJB container - management of EJB UTS 2009 Architecture Architect Java EE Container Architecture Faculty of Information Technology A container can be divided into 4 parts: 1. 2. 3. 4. component contract container service API declarative services
other container services UTS 2009 Architecture Architect Java EE Container Architecture Faculty of Information Technology 1. component contract applications should be developed according to a defined framework Applet is a good example applet container calls init(), start() and other methods you extend Applet class - that allows it Servlet is another example 2. container service API allows access to various services, eg., JNDI, JMS provides a consolidated view of various APIs
UTS 2009 Architecture Architect Java EE Container Architecture Faculty of Information Technology 3. declarative services deployment descriptor defines the contract between the container and component explicit invocation vs declarative invocation a declarative service is a service performed by the container for us 4. other container services lifecycle management resource pooling
populating the namespace clustering UTS 2009 Architecture Architect Java EE Architecture Faculty of Information Technology Lets fit the Java EE component/container model together with the n-tier architectures.... UTS 2009 Architecture Architect Java EE & n-Tier model UTS 2009 Architecture Faculty of Information
Technology Architect Java EE Services Faculty of Information Technology Java EE provides many services for components to use. This includes: JMS Java Message Service JNDI Java Naming & Directory Interface JTA Java Transaction API JavaMail & JAF - Java Activation Framework RMI-IIOP Java Remote Method Invocation, CORBA IIOP JDBC Java Database JCA Java Connectors
Java EE Databases Faculty of Information Technology JDBC Java Data Base Connectivity For writing database-enabled applications JDBC is an API that allows access to databases from within Java code The API is generic and works with a variety of database implementations Typically access databases from EJBs, although can be done from servlets/JSP (or even from applets, though usually a poor architectural choice) UTS 2009 Architecture Architect Java EE Directories Faculty of Information Technology JNDI Java Naming and Directory Interface
For accessing directory servers, particularly LDAP LDAP = Lightweight Directory Access Protocol JNDI is an API that allows access to LDAP directories from within Java code the concept is similar to using JDBC for accessing databases, although obviously the details are different UTS 2009 Architecture Architect Java EE - Transactions Faculty of Information Technology JTA Java Transaction API allows Java applications to participate in ACID transactions (ACID =Atomicity, Consistency, Isolation, Durability) Allows applications to declare units of work
Providing Commit/Rollback calls Declarative or Programmatic Often Container can use legacy transaction managers UTS 2009 Architecture Architect Java EE - JMS Faculty of Information Technology Use the JMS (Java Message Service) for asynchronous programming model and legacy Message Oriented Middleware integration eg: IBM MQseries, MSMQ Supports point-to-point (queuing) programming model publish/subscribe (pub/sub) programming model Not related to Mail or instant-messaging (ICQ etc)!! UTS 2009 Architecture
Architect Java EE - Mail Faculty of Information Technology JavaMail is a standard API to invoke email services both send and receive mail Additional API JAF - Java Activation Framework allows JavaMail to also deal with MIME attachments Also allows multipart messages eg: can have Images, Binary, text files attached to mail We dont cover this in this course... ! UTS 2009 Architecture Architect Java EE Connectors Faculty of Information Technology
Java EE Connectors are used for integrating Java applications with existing systems Java EE defines a Connector Architecture to provide a standard mechanism for integration There are also other options for integration that we will explore, e.g. CORBA, messaging services UTS 2009 Architecture Architect Developing Java EE Applications Faculty of Information Technology 1. Develop application components ie: model business rules in the form of components 2. Compose components into modules.
1. Compose modules into applications ie: integrate multiple modules 2. Deploy & Install UTS 2009 Architecture Architect Components into Modules Faculty of Information Technology Web Modules consists of Java Servlets, JSP, HTML/XML etc. packaged is called Web Archive File (WAR) web.xml is the deployment descriptor EJB Modules consists of EJBs, JARs and resources into JAR files ejb-jar.xml is the deployment descriptor Java Modules Java client classes into JAR files application-client.xml is the deployment
descriptor UTS 2009 Architecture Architect Modules into Applications Faculty of Information Technology Application Consists of one or more WAR & JAR files Packaged into an Enterprise Archive (EAR) file application.xml is the deployment descriptor Is the highest level of Java EE packaging Is an independent unit of code Java EE applications can call and invoke each other too...
UTS 2009 Architecture Architect Application Deployment Faculty of Information Technology Prepare the application for installing depends on each vendors implementation Usually by copying the EAR file to a run-time directory Most vendors supply a deployment tool Vendor may generate additional supporting classes Configure creating data sources & connection pools creating connection factories various tuning and runtime parameters UTS 2009 Architecture Architect
Application Development Roles Faculty of Information Technology Java EE platform implementer vendor usually does this or open source! Sun provide reference platform for free Application Component Provider application developer Application Assembler package application components Deployer deploy packaged applications and configures UTS 2009 Architecture Architect Application Development Roles (2)
Faculty of Information Technology Tester performs unit and integration testing System Administrator administers the application Tool Provider provides tools for the development UTS 2009 Architecture Architect Benefits of Java EE Architecture Faculty of Information Technology To the Application Developer (you)
simplicity portability reusability simplifies building of complex applications separation of business logic from presentation logic deployment in many operating environments distributed deployment integration with non-Java systems educational resources UTS 2009 Architecture Architect Benefits of Java EE
Architecture Faculty of Information Technology To Customers choice of server application management tools integration with existing resources security UTS 2009 Architecture Architect Microsoft .NET Faculty of Information Technology
Java EE is developed by Sun Microsystems under an open process (Java Specification Request) Main competitor to Java EE architecture is Microsoft .NET Supports roughly equivalent concepts to Java EE UTS 2009 Architecture Architect .NET Overview Faculty of Information Technology .NET is a set of specifications: Implemented as collection of products Some of the services required are part of base operating system (Windows 2000/2003 server, Windows XP) The .NET specification includes: component model
container requirements standard services and APIs (Database, Transactions, Security,...) Sound familiar? UTS 2009 Architecture Architect .NET ++ Faculty of Information Technology .NET is also a set of Microsoft products designed to work smoothly together. UNLIKE Java EE, includes: Smart client software eg: .NET framework on PCs, mobile devices (.NET Compact Framework), embedded (.NET Embedded) XML services tightly integrated XML & web services Enterprise services eg: Biztalk server Systems Management Development toolset Visual Studio.NET
You could buy 3rd party tools for Java EE though... UTS 2009 Architecture Architect .NET Architecture Faculty of Information Technology http://www.javaworld.com/javaworld/jw-06-2002/jw-0628-j2eevsnet_p.html UTS 2009 Architecture Architect .NET architecture Faculty of Information Technology Like Java EE, Microsoft .NET consists places components and containers in n-tier layers. Presentation Layer using ASP.NET web forms & embedded code (.aspx files)
Business Logic layer Using Managed classes (ActiveX objects & DLLs) Data access layer Using ADO.net (and ODBC) UTS 2009 Architecture Architect .NET Run-Time Faculty of Information Technology .NET requires a run-time framework installed on the host OS Supports multiple langs via CLR and MSIL Common class libraries shared by all languages
UTS 2009 Architecture Architect .NET Framework Faculty of Information Technology Microsoft .NET supports multiple languages by compiling these languages into an Intermediate Language (IL or MSIL) This MSIL is interpreted by the Common Language Runtime (CLR). .NET framework also provides a common framework of classes which all supported languages can use (eg: C#, VB.net, J#, managed C++ etc). .NET also defines a Common Type System (CTS) for common object data types Restricted to Windows environment (but open source .NET framework, mono, under development) Much like Java with its Runtime Environment (JRE) and standard Java APIs UTS 2009 Architecture
Faculty of Information Technology Business logic in .NET is provided by components Server-side components are implemented as managed objects Can re-use COM/DCOM objects .NET runtime supports transactions manual and automatic .NET remoting allows objects to be shared between applications and servers. Unlike Java EE, objects are not distributed automatically. Scale by adding more web UTSservers... 2009 Architecture Architect .NET Databases Faculty of Information Technology Developers use ADO.NET to connect to
databases This can be SQL based using ODBC (Open Data Base Connectivity) or XML ADO Active Data Objects. This provides direct object database mapping. ODBC is an API that allows access to databases from within Microsoft (C#, VB, etc.) code The API is generic and works with a variety of UTSdatabase 2009 Architecture Architect implementations .NET Other services Faculty of Information Technology The .NET architecture describes a number of servers which are used:
Application Center (for deployment management) SQL Server (for database) Exchange Server (for email/messaging) Commerce Server (for e-business functionality) Transaction Server (for transactional components) UTS 2009 Architecture Architect Java EE vs .NET Faculty of Information Technology They are two different architectures for accomplishing the same task One is based around Java One language, Many platforms One is based around Microsoft products Many languages, One platform * Both have the potential to be highly scalable, available, reliable, etc.
* see www.mono-project.com for open source unix version of .Net framework UTS 2009 Architecture Architect Java EE vs .NET Faculty of Information Technology .NET allows many languages: VB.NET, C#, J#, Managed C++ Perl, Python, Eiffel, COBOL & many more These languages can invoke objects written in other languages: Common Language Runtime/Common Type System Common Base class libraries eg: C# can instantiate VB.NET class!! Can run on Unix via MONO project (beta??)
UTS 2009 Architecture Architect .NET terminology Faculty of Information Technology Assembly = module to be executed by CLR eg: .exe or .dll file Nearest equivalent to Java is JAR file Attributes = similar to Java annotations, but contained in metadata in assembly ASP.NET like JSP, but has more (codebehind & event driven web controls) UTS 2009 Architecture Architect .NET versus Java Client GUI WinForms
AWT/Swing Data Access ODBC, ADO.NET JDBC, JDO Directory access ADSI/ LDAP JNDI / LDAP Remote invocation .NET remoting UTS 2009 Architecture Faculty of Information Technology
RMI-IIOP Architect .NET versus Java EE Faculty of Information Technology Web GUI ASP.NET JSP Scripting ISAPI Servlet, Filter Web server IIS
Apache, Tomcat Server side business logic COM+ Session Beans Server-side data logic (manual) COM+ & ADO.NET BMP Server-side data access component n/a CMP Directory access
ADSI / LDAP JNDI / LDAP Messaging MSMQ JMS Transactions COM+ & DTC JTA UTS 2009 Architecture Architect Main differences Faculty of Information
Technology .NET has no hosting/application server equivalent for EJB The Windows Operating System is the host (eg: you can run assembly as a service, thru IIS) Nearest equivalent is Component services aka COM+ services UTS 2009 Architecture Architect Java EE vs .NET (2) Faculty of Information Technology Often the choice of architecture is based on non-technical factors: existing application base cost support
Web Services are paving the way for both to have equal shares of the market place Interoperability UTS 2009 Architecture Architect Summary Faculty of Information Technology Understand 1, 2, 3, N Tiers and the applicability of each Be familiar with some basic design patterns for N Tier applications Understand the broad architecture of Java EE well fill in the details later Understand that Java EE is not the only option Microsoft .NET is an alternative Well stick to Java EE to avoid confusion UTS 2009 Architecture
Architect Todays Lab Faculty of Information Technology In todays lab, you will set up your development environment We will use Oracle Weblogic Server 10 for the labs and Oracle Workshop for Weblogic (Eclipse Europa) Optionally: You can use Eclipse-all-in-one (Eclipse Ganymede) UTS 2009 Architecture Architect Questions? Faculty of Information Technology ?
UTS 2009 Architecture Architect Appendix Faculty of Information Technology Distributed Systems lectures from 31284 Web Services Development The following explain the different types of Gartner client/server models UTS 2009 Architecture Architect Distributed Systems Faculty of Information Technology Some key characteristics of a distributed system / distributed application include:
Resource Sharing Openness Concurrency Scalability Fault Tolerance Transparency UTS 2009 Architecture Architect Characteristic: Resource Sharing Faculty of Information Technology Resource sharing is a fundamental goal of distributed applications Enabled by use of architectures we've seen: client/server three-tier n-tier Also peer-to-peer (internet file sharing
anyone?) UTS 2009 Architecture Architect Principle of Sharing Faculty of Information Technology Resources should be shared so as to minimise load on elements of the distributed system Sharing amongst servers Work to be done should be partitioned between servers Sharing data Locking must be used to prevent simultaneous modification of shared data UTS 2009 Architecture Architect
Back to Client/Server ... Faculty of Information Technology How do you decide whether to do most of the processing at the client, or at the server? Fat client vs. thin client Fat client do lots of work at client, little at server Thin client do little work at client, lots at server This is about distributed applications in general, not specifically web-based applications Web-based apps are mostly thin client UTS 2009 Architecture Architect Gartner classification of C/S presentatio n logic business logic
presentatio n logic business logic presentatio n logic business logic presentatio n logic presentatio n logic business logic business
logic presentatio n logic business logic data access data access data access data access server data access
distribute d data data access remote data UTS 2009 Architecture Faculty of Information Technology distribute d transactio n remote presentati on distributed
presentatio n Architect Gartner: Distributed Data presentatio n logic business logic data access data access Faculty of Information Technology The majority of the code runs on the client's computer Some of the data is remote, some is local e.g.
application that accesses one or more distributed databases distribute d data UTS 2009 Architecture Architect Gartner: Remote Data presentatio n logic business logic Faculty of Information Technology The majority of the code runs on the client's computer All of the data is remote e.g.
data access remote data applications that access data on Networked File Systems NFS on Unix SMB on Windows UTS 2009 Architecture Architect Gartner: Distributed Transaction presentatio n logic business logic business
logic data access distribute d transactio n Faculty of Information Technology The business logic processing is split between the client and the server some business logic at client some business logic at server Not a particularly good model difficulty in updating business logic e.g. Gartner example is the web assuming a Java applet on the client with business logic
UTS 2009 Architecture Architect Gartner: Remote Presentation presentatio n logic business logic Faculty of Information Technology Most of the processing is done at the server, including all business logic The server has no concern for how the application will display to the user data access e.g.
remote presentati on web services applications, Java RMI client, vendor applications UTS 2009 Architecture Architect Gartner: Distributed Presentation presentatio n logic presentatio n logic business logic data access distributed
Project Audit Project audit is done during and after projects are complete. The outcome of project audit is a report that suggests: Are we doing the right thing (at each milestone)? Did we do the right thing (for completed projects)?...
In metals it is more difficult to associate specific electrons as belonging to a particular element. Further discoveries in the development of Atomic Theory Conservation of mass (sort of) Law of definite proportions: the composition of the same pure substance...
Emphasis of curriculum change from dead languages to live ones . Ben Franklin started the school that would become the University of Pennsylvania. Colonial Arts. Though there was little time for recreation (due to farm work, fear of Indians, etc…),...
Yes; when any of the segments were deleted, the expression level dropped to less than 100% of the control. No; they did not delete the promoter, so the gene could still be expressed even without the segments.
Pace your lecture No more than one slide per minute of lecture time Remember each hour of lecture is actually only 50 minutes of time with the students Use Pictures Consider including pictures, diagrams, or other representations that help students...
Section 5.3 Big Business & Economic Choices (Appleby 194-199) Agenda for Today Gibson Girl Presentation Homework Read textbook pages 194-195 and answer question 1 & 2 in Analyzing Visuals Review What is a tenement? Who was Lewis Hine? Who was...
DG MARKT database . ECHI mobility indicator. WP4 Questionnaire Survey. Interviews - also including Knowledge Brokers Network, DG . Markt, experts, other. stakeholders. Discussion on the applicability of the . WHO Global Code . of Practice on the International Recruitment...
ScottishModern Apprenticeship FrameworkinWood and Timber Industries Levels 2 & 3. ... Including the Modern Apprenticeship in Wood and Timber Industries. Graduate Level Apprenticeships ( GLA ) ... Round Timber Conversion. B ) Secondary Conversion. at SCQF level 5. GG2M 45.
Ready to download the document? Go ahead and hit continue!