Download presentation
Presentation is loading. Please wait.
Published byDennis Hawkins Modified over 8 years ago
1
Lecture 1.11 Developing the Tools Montreal 2004 Introduction to J2EE Development John J. Salama
2
Lecture 1.12 Today’s Talk Introduction Server Centric Applications Tiered Application Design Design Patterns Introduction to Development Practices Resources
3
Lecture 1.13 INTRODUCTION
4
Lecture 1.14 Prerequisites Java –Objects and classes –Fundamental types –Arrays –Decisions (conditional statements) –Iteration (iterative statements) –Interfaces and polymorphism –Inheritance
5
Lecture 1.15 What We’re Working Towards
6
Lecture 1.16 Web Servers A machine connected to a network (usually the Internet) Has web server software installed. i.e. Apache, IIS, WebSphere, Tomcat, SUN One Has web sites/web applications associated with the web server
7
Lecture 1.17 How Web Servers And Clients Talk “http://” is the protocol and indicates the default port (in this case 80) the browser should connect to. This can be overridden by ‘:port number’ “www.bioinformatics.org” is the server name and is translated by a name server to an IP address. The IP address is used to connect to the server “tools.php” is the resource and specifies what should be sent back from the server The HTML document sent back is interpreted by your web browser and displayed URL: http://www.bioinformatics.ca/tools.php
8
Lecture 1.18 Client Side Programming Code written that is interpreted by the client only Server does not process document Example languages include HTML, JavaScript, CSS
9
Lecture 1.19 Server Side Programming Code written that is processed by the server prior to interpretation by the client Example languages include JSP/J2EE, ASP, PHP Common Gateway Interface (CGI) provides a means for a program written in any language to dynamically produce HTML
10
Lecture 1.110 A Few Flavours of Java J2SE –Standard Edition –Base language J2EE –Enterprise Edition –Designed for multi-tier server-centric applications J2ME –Micro Edition –Tailored for consumer and embedded electronics J2EE –Enterprise Edition –Designed for multi-tier server-centric applications
11
Lecture 1.111 SERVER CENTRIC APPLICATIONS
12
Lecture 1.112 Server Centric Applications An application typically running on a web server Accessible by many clients simultaneously Takes in a request (GET/POST) Returns a response
13
Lecture 1.113 Server Side Languages CGI: Common Gateway Interface Note: Not a language. Can use any language to develop a CGI. JSP (Servlets): Java Server Pages ASP: Active Server Pages PHP: PHP Hypertext Preprocessor Mod_Perl: Perl modules for Apache
14
Lecture 1.114 CGI
15
Lecture 1.115 FastCGI
16
Lecture 1.116 Moving Beyond CGIs Don’t have to spawn a new process Can take advantage of multiple thread execution Improved scalability and performance
17
Lecture 1.117 JSP/Servlets
18
Lecture 1.118 Java Web Servers Receives GET / POST requests via HTTP Sends a response via HTTP Runs a Java web application in an isolated virtual machine Maps Servlet requests to a Java class Also called the application container
19
Lecture 1.119 Java Application Containers Apache Tomcat –http://jakarta.apache.org/tomcat/ Sun Java System Application Server –http://wwws.sun.com/software/products/appsrvr/home_a ppsrvr.html IBM WebSphere –http://www- 306.ibm.com/software/info1/websphere/index.jsp
20
Lecture 1.120 Components of a Java Web Application LanguageLayer HTML, CSS, XSLTPresentation JavaScriptPresentation, Business Logic Servlets, JSP, Tag LibraryPresentation, Business Logic Java ClassesBusiness Logic SQL, JDBC, XMLData
21
Lecture 1.121 A Server Centric Application
22
Lecture 1.122 TIERED ARCHITECTURE
23
Lecture 1.123 Tiered Applications Distinct division of function and logic within an application Can also refer to physical division of an application Extensively used in web application design and deployment A logical/functional tier doesn’t mean physical separation
24
Lecture 1.124 Classical Three Tiered Applications Classically 3 component layers to an application –Data Layer Manages data used by the application –Business Logic Layer Contains various business rules performed on the data –Presentation Layer Interacts with the user (GUI)
25
Lecture 1.125 Three Tiered Applications
26
Lecture 1.126 Logical Versus Physical
27
Lecture 1.127 The “Half Tier”
28
Lecture 1.128 More Than Three Complex enterprise applications have lead to many distributed layers Referred to as multi-tier or N-tier applications Typically used for high performance, high availability applications
29
Lecture 1.129 N-Tiered Applications
30
Lecture 1.130 Advantages of Tiered Application Design 1.Manageability Each tier can be monitored, tuned, and upgraded independently. Different people can have clearly defined responsibilities. 2.Scalability More places within the application to add more hardware. Allows for clustering techniques 3.Maintainability Changes, upgrades, and maintenance can be performed without affecting other components
31
Lecture 1.131 Advantages of Tiered Application Design 4.Reliability Each operation is clearly distinguished from the others Changes to one tier does not affect another tier 5.Availability Recovering from failures is faster due to lowered dependence on individual machines Clustering and load balancing can provide even better availability 6.Extensibility Additional features can be added without having to redesign the entire system
32
Lecture 1.132 2.5 Physical Tier
33
Lecture 1.133 DESIGN PATTERNS
34
Lecture 1.134 What is a Design Pattern? “Each pattern describes a problem which occurs over and over again in our environment, and then describes the cord of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice” – Christopher Alexander
35
Lecture 1.135 Why Use Design Patterns? Provides a flexible framework for building complex architectures Helps ease the burden of complexity Proven solutions to common problems Provides a lexicon to describe problems and their solutions
36
Lecture 1.136 Model-View-Controller Popular design pattern used to develop user interfaces Decouples the graphical interface from the rest of the application that “does the work” Commonly referred to as MVC Not specific to one object-oriented language Many web applications employ MVC, or some variant thereof
37
Lecture 1.137 Model-View-Controller
38
Lecture 1.138 The Model The code that carries out some tasks Has no concern with “look and feel” Methods in the model include: –Query methods permitting user to get information on the state of the model –Mutator methods that permit the state to be modified –Methods to register views –Methods to notify registered views when the model state has changed java.util.Observable
39
Lecture 1.139 Model-View-Controller
40
Lecture 1.140 The View Can have several views Provides graphical user interface (GUI) components for the model Display is based on the state of the model Informs the controller of manipulations made by the user Can be built from AWT or SWING for standalone applications java.util.Observer
41
Lecture 1.141 Model-View-Controller
42
Lecture 1.142 The Controller Have associated views Can have several controllers typically one per view Updates the model state when necessary by calling a mutator method Event Listener
43
Lecture 1.143 Model-View-Controller
44
Lecture 1.144 MVC Example
45
Lecture 1.145 Putting It All Together
46
Lecture 1.146 Existing Frameworks Language specific architectural/deployment frameworks already exist Before trying to fit your existing code or designing new code within an architecture, determine if a framework already exists Java Architectural Framework Example –http://jakarta.apache.org/struts/ Java Deployment Framework Example –http://java.sun.com/products/javawebstart/
47
Lecture 1.147 INTRODUCTION TO DEVELOPMENT PRACTICES
48
Lecture 1.148 Development Practices Concurrent Versioning System –I.e. CVS –Manages revisions to code in a multi-developer environment IDE: Integrated Development Environment –I.e Eclipse –A GUI development environment combining several development tools (i.e. CVS, ANT, debugging)
49
Lecture 1.149 Development Practices Bug Tracking –I.e. bugzilla –Web based bug and feature request tracking application Automated Build Scripts –ANT –Platform independent build tool used for java compilation
50
Lecture 1.150 RESOURCES
51
Lecture 1.151 Web Sites SUN Java –http://java.sun.com/ Apache Jakarta Project –http://jakarta.apache.org/ SUN Design Patterns –http://java.sun.com/blueprints/patterns/ Google –http://www.google.ca/
52
Lecture 1.152 Books Design Patterns, Elements of Reusable Object-Oriented Software (Addison-Wesley) [ISBN: 0201633612] Developing Software for the User Interface (Addison-Wesley) [ISBN: 0201422948] The Pragmatic Programmer (Addison-Wesley) [ISBN: 020161622] Java Enterprise in a Nutshell, 2 nd Edition (O’Reilly) [ISBN: 0596001525] Building Java Enterprise Applications Volume 1: Architecture (O’Reilly) [ISBN: 0596001231]
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.