Design Patterns CSE 740 Software Engineering Presentation Tim Jowers October 10, 2002.

Slides:



Advertisements
Similar presentations
3 Copyright © 2005, Oracle. All rights reserved. Designing J2EE Applications.
Advertisements

©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 12Slide 1 Software Design l Objectives To explain how a software design may be represented.
2 Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how statecharts can be used to describe system behaviors  Use statecharts.
Design Patterns CS is not simply about programming
Object-Oriented Enterprise Application Development J2EE Blueprints.
James Tam Introduction To Design Patterns You will learn about design techniques that have been successfully applied to different scenarios.
Satzinger, Jackson, and Burd Object-Orieneted Analysis & Design
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Faculty of Information Technology © Copyright UTS Faculty of Information Technology 2004Design-1 Advanced Java Programming Design issues Chris Wong
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Software Engineering I Object-Oriented Design Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science.
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
Chapter 8 Object Design Reuse and Patterns. Finding Objects The hardest problems in object-oriented system development are: –Identifying objects –Decomposing.
Application Architectures Vijayan Sugumaran Department of DIS Oakland University.
Reuse Activities Selecting Design Patterns and Components
PRESENTED BY SANGEETA MEHTA EECS810 UNIVERSITY OF KANSAS OCTOBER 2008 Design Patterns.
Course Instructor: Aisha Azeem
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
UNIT-V The MVC architecture and Struts Framework.
Objektorienteret netværkskommunikation Presentation: Architectures for Distributed Systems.
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
J2EE DESIGN Thanh Nguyen - 10/8/12www.smartbiz.vn1.
Software Design Refinement Using Design Patterns Instructor: Dr. Hany H. Ammar Dept. of Computer Science and Electrical Engineering, WVU.
Model View Controller (MVC) Rick Mercer with a wide variety of others 1.
Copyright © 2012 Accenture All Rights Reserved.Copyright © 2012 Accenture All Rights Reserved. Accenture, its logo, and High Performance Delivered are.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
J2EE Structure & Definitions Catie Welsh CSE 432
® IBM Software Group © 2007 IBM Corporation J2EE Web Component Introduction
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
DaveAndAl.net Do Application Design Patterns Make Sense in ASP.NET? Alex Homer You may like to write these down now...
Patterns in programming 1. What are patterns? “A design pattern is a general, reusable solution to a commonly occurring problem in software. A design.
GoF Design Patterns (Ch. 26). GoF Design Patterns Adapter Factory Singleton Strategy Composite Façade Observer (Publish-Subscribe)
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
Source: Peter Eeles, Kelli Houston, and Wojtek Kozaczynsky, Building J2EE Applicationa with the Rational Unified Process, Addison Wesley, 2003 Prepared.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Core Indigo Patterns Ted Neward
ECE450S – Software Engineering II
Patterns in programming1. 2 What are patterns? Answers to common design problems. A language used by developers –To discuss answers to design problems.
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Enterprise Java Beans. Model 1 J2EE – Web View Model/View/Controller Model View Control Data base Web Server Model One Architecture HTTP Request HTTP.
Model View Controller (MVC) Bigger than a Pattern: It’s an Architecture Rick Mercer with help from many of others 1.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Java EE Patterns Dan Bugariu.  What is Java EE ?  What is a Pattern ?
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 7 1COMP9321, 15s2, Week.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
1 Copyright © 2004, Oracle. All rights reserved. Oracle Application Development Framework.
Example to motivate discussion We have two lists (of menu items) one implemented using ArrayList and another using Arrays. How does one work with these.
Java Programming: Advanced Topics1 Introduction to Advanced Java Programming Chapter 1.
Model View Controller (MVC) an architecture Rick Mercer with help from many of others 1.
Java Programming: Advanced Topics 1 Enterprise JavaBeans Chapter 14.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
CS 5150 Software Engineering Lecture 16 Program Design 3.
Lecture 21: Component-Based Software Engineering
©NIIT Introducing Enterprise JavaBeans (EJB) Lesson 1A / Slide 1 of 43J2EE Server Components Objectives In this lesson, you will learn about: The features.
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
The Chain of Responsibility Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Java Web 应用开发: J2EE 和 Tomcat 蔡 剑, Ph.D.. 本讲内容 网络系统设计模式 综合案例分析.
J2EE Platform Overview (Application Architecture)
COMP9321 Web Application Engineering Semester 2, 2016
Structure of a web application
Introduction to Advanced Java Programming
MPCS – Advanced java Programming
OO Methodology OO Architecture.
Instructor: Dr. Hany H. Ammar
Design and Maintenance of Web Applications in J2EE
Advanced Programming Behnam Hatami Fall 2017.
Model-View-Controller (MVC) Pattern
The Model Layer What is Model?
Chapter 8, Design Patterns Introduction
Presentation transcript:

Design Patterns CSE 740 Software Engineering Presentation Tim Jowers October 10, 2002

Agenda Summary Example Thoughts Questions?

de·sign pat·tern “A template of abstract architectural elements that can be used to guide you in generating your design.” Pfleeger, p.299 “Identifies the participating classes and instances, their roles and collaborations, and the distribution of responsibilities.” GoF, p.219 of Pfleeger Something that occurs again and again.

Inheritance vs. Aggregation Base InheritanceAggregation Method_1 Method_2 Method_3 Subclass Method_A Method_B Method_C Outer Method_1 Method_2 Method_3 Subclass Method_A Method_B Method_C Method_A Method_B Method_C Interface Method_1 Method_2 Method_3 Implements Method_1 Method_2 Method_3 Method_A Method_B Method_C Does it affect how the code is executed?

Viewpoint 1: Object Associations One class uses another internally. Visible Class “Inner Class” External Interface Adapter, façade, delegation, composition, … Controller + Model in MVC?

Adapter Convert the inner class’ interface into an interface usable by another object. Adaptee Adapter Adaptee Target Adapter Adaptee Target GoF, p141 Pat. Java, p178 GoF, p141

Subsystem Classes Façade Provide a unified interface to a set of interfaces in a subsystem. Package Façade Façade (e.g. Compiler) Scanner Code Generator Parser Bytecode Stream Java GoF, p187 1Ifc3 Interface 2 4 ifc5

Delegate To allow an object to share implementation without inheritance, send part of its work to another object. Pat. Almanac, p155 Person Instructor TA Student Problem: Inheritance is fixed. Roles are mutually exlusive. Person Instructor TAStudent Solution: Variously instantiate appropriate class. Issue? Does aggregation properly model Plays-Role- Of? - Bonnell

How many class relations exist? Visible Class “Inner Class” External Interface Visible Class “Inner Class” The Visible Class can … 1.Expose functionality. 2.Return an inner class by interface, casting to [abstract] base class 3.Relay data and/or method calls to inner class(es)

Viewpoint 2: Context/Domain Patterns in Scientific Computing Accounting software Architectural software Banking, Business Customer Interaction Inventory Control Telemetry …

Viewpoint 3: Categorization Behavioral Structural Security Concurrent Systems Distributed Systems Fault-tolerant Systems Frameworks Integration Transaction Processing Performance Database

Sample Application Small World Phenomenon / Six Degrees of Separation –Randomly pick anyone on earth. –You know someone who knows someone who knows someone ( Six Degrees) … who knows that person. Relate people by –Friends –Ancestry –Experiences

GUI Patterns (1) Message loop – Microsoft Windows –Based on a “Window”. May be Command Pattern in GoF p233. Message handlers – X Windows –Based on a widget. Callback pattern. Listeners – Java Swing –Based on a component –Same as “Observer” pattern in GoF. Sun built on the Work of Others – specifically GoF See Sun’s Design Patterns at java.sun.com –Iterator in GoF and Java etc.

GUI Patterns (2) At least Four Possible GUI’s 1.Edit personal data 2.View/Edit friend relationships 3.View/Edit family relationships 1.Import from Ancestry files 2.Manual Interface 4.View/Edit experiences on self and/or others 1.Updates from Events Organizers 2.Maybe import from government HIPAA database Called the “Views” in Model-View-Controller pattern. P288 of Pfleeger.

MVC (1) VIEWS CONTROLLER Factory Method Controller List-based Controller Tree-based instantiates MODEL

MVC (2) Factory Method Controller List-based Controller Tree-based instantiates HTTPJEE SERVER

J2EE MVC Java Server Programming. J2EE Edition, Wrox, 2000, p Web Browser Applet Servlet Engine JSP Servlet Web Server EJB Server Session Bean Entity Bean Database View Presentation Logic Controller Business Process Model Business Logic & State

Some Patterns on Sun’s Site Pattern NameDescription Business DelegateBusiness Delegate [ACM01] Reduce coupling between Web and Enterprise JavaBeans TM tiersACM01 Composite EntityComposite Entity [ACM01] Model a network of related business entitiesACM01 Composite ViewComposite View [ACM01] Separately manage layout and content of multiple composed viewsACM01 Data Access Object (DAO)Data Access Object (DAO) [ACM01] Abstract and encapsulate data access mechanismsACM01 Fast Lane ReaderFast Lane Reader Improve read performance of tabular data Front ControllerFront Controller [ACM01] Centralize application request processingACM01 Intercepting FilterIntercepting Filter [ACM01] Pre- and post-process application requestsACM01 Model-View-ControllerModel-View-Controller Decouple data representation, application behavior, and presentation Service LocatorService Locator [ACM01] Simplify client access to enterprise business servicesACM01 Session FacadeSession Facade [ACM01] Coordinate operations between multiple business objects in a workflowACM01 Transfer ObjectTransfer Object [ACM01] Transfer business data between tiersACM01 Value List HandlerValue List Handler [ACM01] Efficiently iterate a virtual listACM01 View HelperView Helper [ACM01] Simplify access to model state and data access logicACM01 Reference:

Thoughts How do Design Patterns relate to … Algorithms … are these software design patterns? Data Structures …essential to Patterns and Algorithms. Software Architectures …Design Patterns “In the Large”? …Terminology often How To setup Product X. … How to apply patterns to COTS integration.

Broadened Vision Read the patterns Think about the patterns Think about your software design Use the patterns Life is good When you Build on the Work of Others

References Design Patterns. Elements of Reusable Object-Oriented Software, Erich Gamma et al, Software Engineering. Theory and Practice, Shari Pfleeger, The Pattern Almanac, Linda Rising, Patterns in Java, Mark Grand, Java Server Programming. J2EE Edition, Wrox, Web links… Sun J2EE Java BluePrints, Knowledge and Design Specification Reuse: the Domain Theory, Pattern-Oriented Software Architecture: Patterns for Concurrent and Networked Objects, Also has a nice tutorial for this semester, Oct Architecture as Object Models of Software, Eyoun Eli Jacobsen, 2201.

Extra Time Slides Chain of Responsibility Design Pattern

/**Instances of this class are used to represent an open area in a * warehouse, an office building or retail floor. */ class Area extends SecurityZone { //... /** * This method is called by the notify method so that this object can have * a chance to handle measurements. */ boolean handleNotification(int measurement, Sensor sensor) { if (sensor instanceof TemperatureSensor) { if (measurement > 150) { fireAlarm(this); return true; } // if } //... //... return false; } // handleNotification(int, Sensor) } // class Area Chain of Responsibility Patterns in Java, Vol. 1