Top Banner
©2007 · Georges Merx and Ronald J. Norman Slide 1 Chapter 11 Chapter 11 Reality Check: Reality Check: Java Programming Java Programming in the Real in the Real World World
25

©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

Dec 26, 2015

Download

Documents

Madeline Clarke
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 1

Chapter 11Chapter 11

Reality Check: Java Reality Check: Java Programming in the Programming in the

Real WorldReal World

Page 2: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 2

AgendaAgenda

• Multi-tier architecture– Clients and servers

• Remote-Method Invocation (RMI)

Page 3: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 3

Multi-Tier Architecture (1)Multi-Tier Architecture (1)

• Most practical software applications today are divided into three (or more) architectural tiers with client and server software logically separated– The client tier provided the user interface– The server tier provides services to the

client; it is often subdivided into additional service tiers, such as web server, application server, etc.

– The third architectural tier is the database server tier: it provides information management services

• The server tiers may be distributed across multiple hardware systems, if the software was implemented for full scalability

Page 4: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

(2)

Page 5: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 5

Java PackagesJava Packages

• A greater diversity of Java classes and packages are required to implement distributed functionality – Java 2 Enterprise Edition (J2EE)

• Java servlets• Java Server Pages (JSPs)• Enterprise Java Beans (EJBs)

• While these components add complexity and provide many new capabilities not covered in this text, in the end, this means just a broader collection of classes that follow now familiar object-oriented behavior patterns

Page 6: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 6

Learning LayoutLearning Layout

Page 7: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 7

Learning ConnectionsLearning Connections

Page 8: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 8

Reviewing Major Java PackagesReviewing Major Java Packages

• J2SE™ (Java 2 Platform, Standard Edition) – Desktop solutions for standalone applications and also for browser-based applets

• J2EE™ (Java 2 Platform, Enterprise Edition) – Enterprise solutions for eCommerce and eBusiness. For example, software developers may create server-side and client-side, large scale distributed applications, such as a web shopping cart application for an online retail site

• J2ME™ (Java 2 Platform, Micro Edition) – Used for resource-constrained consumer solutions for cell phones and other mobile devices (embedded solutions)

Page 9: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 9

Remote Method Invocation Remote Method Invocation (RMI) (1)(RMI) (1)

• When an application follows the client-server model, the Java Remote Method Invocation (RMI) technology may be used– RMI is used when all components of a

distributed application are developed in Java

– CORBA support is also available in Java for integration of heterogeneous (java/non-Java), distributed application components

Page 10: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 10

Remote Method Invocation Remote Method Invocation (RMI) (2)(RMI) (2)

Page 11: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 11

Java AppletsJava Applets

• The simplest form of a web-centric Java application is the Java applet

• An applet is a program written in Java, stored on a web server, and delivered via the user computer’s web browser, but otherwise logically very similar to a Java client application run on the client computer

• When a user runs a Java technology-enabled browser to view a web (HTML) page that contains an applet reference, the applet code is transferred to her system and executed by the Java Virtual Machine (JVM) embedded in the browser (assuming appropriate security permissions)

Page 12: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 12

Applet ExampleApplet Example

Page 13: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 13

Distributed Computing Distributed Computing TechnologiesTechnologies

• The technologies participating in web-centric applications and their development include:– Web services, e.g. Apache HTTP

Server– Application services, e.g. JBoss, IBM

Websphere, BEA Weblogic, Borland Enterprise Server, Microsoft Internet Information Server (IIS), Tomcat

– J2EE (servlets, JavaServer Pages, Enterprise Java Beans, JavaServer Faces)

– XML and SOAP

Page 14: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 14

Design PatternsDesign Patterns

• Origins: field of architecture | patterns in designing buildings and towns - Christopher Alexander:– “Each pattern describes a problem which occurs

over and over again in our environment and then describes the core 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.”

• In software engineering, Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (“The Gang of Four”) applied Alexander’s principles to software design– “Solution to a problem in a context”

Page 15: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 15

DefinitionDefinition

• A design pattern names, abstracts, and identifies the key aspects of a common design structure that make it useful for creating a reusable object-oriented design.

(GOF)

Page 16: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 16

Pattern ElementsPattern Elements

• Pattern name– Design vocabulary– “Handle” for communication

• Problem description– Context, pattern target

• Solution description– Abstract description of design

elements

• Consequences– Results, trade-offs from the pattern

applications

Page 17: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 17

PurposePurpose

• Name, explain, and standardize important and recurring design patterns in object-oriented systems– Easier to successfully reuse previous

designs and architectures– Expressed patterns are more

accessible to more developers– Improved documentation and training– Easier maintenance

• The choice of language is important– Smalltalk, C++, C#, and Java support

object-oriented design patterns

Page 18: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 18

Pattern DescriptionPattern Description

• Pattern descriptions follow a consistent format– Pattern Name and Classification– Intent– Also Known As– Motivation– Applicability– Structure– Participants– Collaborations– Consequences– Implementation– Sample Code– Known Uses– Related Patterns

Page 19: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 19

Types of PatternsTypes of Patterns

• Purpose– Creational– Structural– Behavioral

• Scope– Classes

• Applies primarily to class relationships

– Objects• Most patterns are in the object scope

Page 20: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 20

Some of the Most Popular Some of the Most Popular PatternsPatterns

Pattern Description Abstract Factory Provide an interface for creating families of related or dependent

objects without specifying their concrete classes Singleton Ensure a class only has one instance, and provide a global point

of access to it. Adapter Convert the interface of a class into another interface clients

expect. Façade Provide a unified interface to a set of interfaces in a subsystem.

Façade defines a higher-level interface that makes the subsystem easier to use.

Observer Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Page 21: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 21

Generic MethodsGeneric Methods

• The most recent release of the Java Software Development Kit, J2SE SDK 5.0, added support for generic methods and classes– Generics further support

polymorphism by enabling a generic code component to determine safely at runtime what the type of a parameter is and to handle it accordingly

Page 22: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 22

Position in ProcessPosition in Process

• the supporting disciplines, here Project Management, span the entire life cycle, albeit with varying intensity across the spectrum of iterations

• The need for smart and flexible project management is critical in completing quality projects on time, on budget, and according to stakeholder requirements

Page 23: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 23

Macro/Micro-Level Project Macro/Micro-Level Project PlanningPlanning

Page 24: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 24

Macro-Level Plan using Macro-Level Plan using Microsoft ProjectMicrosoft Project®®

Page 25: ©2007 · Georges Merx and Ronald J. NormanSlide 1 Chapter 11 Reality Check: Java Programming in the Real World.

©2007 · Georges Merx and Ronald J. Norman Slide 25

Example Agile Project Example Agile Project Management Tool: xProcessManagement Tool: xProcess®®

Copyright IVIS/Andy Carmichael