Design Patterns Standardized Recurring model Fits in many location Opposite of customization Fundamental types of pattern Choose and use as desired and.

Slides:



Advertisements
Similar presentations
Welcome to. Who am I? A better way to code Design Patterns ???  What are design patterns?  How many are there?  How do I use them?  When do I use.
Advertisements

Lecture # 2 : Process Models
Object-Oriented Software Development CS 3331 Fall 2009.
Unit 2. Software Lifecycle
18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
CS590L - Lecture 6 1 CS590L Distributed Component Architecture References: - E. Gamma, R. Helm, R. Johnson, J. Vlissides, Design Patterns: Elements of.
DESIGN PATTERNS OZGUR RAHMI DONMEZ.
Patterns Reusable solutions to common object-oriented programming problems When given a programming problem, re-use an existing solution. Gang of Four.
Design Patterns Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
05/26/2004www.indyjug.net1 Indy Java User’s Group June Knowledge Services, Inc.
Fall 2007CS 225 Introduction to Software Design Chapter 1.
Design Patterns CS is not simply about programming
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Design Patterns. What are design patterns? A general reusable solution to a commonly occurring problem. A description or template for how to solve a problem.
Automatically Extracting and Verifying Design Patterns in Java Code James Norris Ruchika Agrawal Computer Science Department Stanford University {jcn,
(c) 2010 University of California, Irvine – André van der Hoek1June 29, 2015 – 08:55:05 Informatics 122 Software Design II Lecture 8 André van der Hoek.
Design Patterns Module Name - Object Oriented Modeling By Archana Munnangi S R Kumar Utkarsh Batwal ( ) ( ) ( )
Spring 2009CS 225 Introduction to Software Design Chapter 1.
Design Patterns academy.zariba.com 1. Lecture Content 1.What are Design Patterns? 2.Creational 3.Structural 4.Behavioral 5.Architectural 6.Design Patterns.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Software Waterfall Life Cycle Requirements Construction Design Testing Delivery and Installation Operations and Maintenance Concept Exploration Prototype.
Rational Unified Process Fundamentals Module 4: Disciplines II.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Software Processes.
Software Processes lecture 8. Topics covered Software process models Process iteration Process activities The Rational Unified Process Computer-aided.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Introduction to Software Design Chapter 1. Chapter Objectives  To become familiar with the software challenge and the software life cycle  To understand.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
Unified Modeling Language* Keng Siau University of Nebraska-Lincoln *Adapted from “Software Architecture and the UML” by Grady Booch.
DESIGN PATTERNS CSC532 Adv. Topics in Software Engineering Shirin A. Lakhani.
18 April 2005CSci 210 Spring Design Patterns 1 CSci 210.
Software Design Patterns (1) Introduction. patterns do … & do not … Patterns do... provide common vocabulary provide “shorthand” for effectively communicating.
Object Oriented Software Engineering Chapter 16 and 17 review 2014/06/03.
Design Patterns Gang Qian Department of Computer Science University of Central Oklahoma.
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Testing Extensible Design Patterns in OO Frameworks through Scenario Templates D.S. Sanders Software Verification & Validation.
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Génie logiciel Software Engineering Summary C. Petitpierre.
Introduction to Design Patterns. Questions What is a design pattern? Who needs design patterns? How different are classes and objects in APL compared.
Creational Patterns
DESIGN PATTERNS COMMONLY USED PATTERNS What is a design pattern ? Defining certain rules to tackle a particular kind of problem in software development.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns Introduction
Design Patterns SE464 Derek Rayside images from NetObjectives.com & Wikipedia.
Java Design Patterns Java Design Patterns. What are design patterns? the best solution for a recurring problem a technique for making code more flexible.
Interface Patterns. Adapter Provides the interface a client expects, using the services of a class with a different interface Note Avoid using object.
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 4 Slide 1 Software Processes.
PROTOTYPE. Design Pattern Space Purpose ScopeCreationalStructuralBehavioral ClassFactory MethodAdapterInterpreter Template Method ObjectAbstract factory.
7 April 2004CSci 210 Spring Design Patterns 2 CSci 210.
1 Process activities. 2 Software specification Software design and implementation Software validation Software evolution.
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Software Design Patterns
MPCS – Advanced java Programming
Introduction to Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
How to be a Good Developer
object oriented Principles of software design
WARNING These slides are not optimized for printing or exam preparation. These are for lecture delivery only. These slides are made for PowerPoint 2010.
How to be a Good Developer
Software Engineering Lecture 7 - Design Patterns
Chapter 8, Design Patterns Introduction
Chapter 8, Design Patterns Singleton
CIS 644 Tues. Nov. 30, 1999 W15A … patterns.
Chapter 8, DesignPatterns Facade
Presentation transcript:

Design Patterns Standardized Recurring model Fits in many location Opposite of customization Fundamental types of pattern Choose and use as desired and befitting Adapt the pattern to your application

Loop pattern –Initialize loop parameter values and loop variant –Loop – if (check condition) – { – statements – } – else – { – quit/exit Loop – } – change loop variant – continue Loop Is syntax diagram a pattern?

This is an algorithmic code pattern for iteration You need to know what the loop parameters are, their initial values, and how they should be initialized You need to know the condition to be checked Obviously, the statements to be executed when the condition is true Precisely how the loop variant is to be changed for your application

Definite iteration Going from 0 to N Going from –M to +N by step k Indefinite iteration How to obtain loop variant? How to validate loop variant? We have a pattern for definite iteration; and another for indefinite iteration How about a pattern for linear search? How about pattern for search in a 2-D array?

Why we use Design Patterns We use patterns to make the design and implementation flexible Flexible w.r.t. requirements Flexible w.r.t. to inputs Flexible w.r.t. to implementation – move things around an plug in components

Fundamental types of Design Patterns Creational Structural Behavioral One may find patterns pertinent to domains that you may not find in other domains Patterns for dynamic behavior may also be identified

Creational Patterns Factory Abstract Factory Builder Prototype Singleton

The Factory Pattern Constructor creates an object of a particular class Similar objects based on input values are to be created then you can have different class and the driver parses the input and uses the appropriate constructor A factory pattern streamlines this

The Abstract Factory Pattern Level higher in abstraction to the factory pattern In some cases it actually returns a Factory for that group of classes Example: –Type of garden –Types of plants in the garden Investment example

The Builder Pattern Configurable system – configuration file (XML files) Assembles objects to make a new object or system Based on the data in the config. File Uses a factories to build objects Separates construction from representation

The Prototype Pattern Copies or clones an existing class Used when creating a new instance is expensive Use java clone() method Classes have to implement cloneable

The Singleton Pattern Is a pattern that insures there is one and only one instance of an object Globally accessible object Final class with static methods Constructor is privatized Avoids global variables getInstance() method returns reference to this object

Maintain a registry of singletons Pass singletons to other objects Type checking may be needed on singletons – if using a registry How to adapt singletons for X instances

More info and examples s.aspxhttp:// s.aspx F-patterns/ F-patterns/ tterns.htmhttp:// tterns.htm

Structural Patterns Adapter –Adapt a user familiar interface to an available class interface Composite –A mechanism to camouflage the distinction between like items with different constraints Proxy –An intermediary assisting until the actual is available Flyweight –A mechanism to avoid having many classes – differing only by a few parameters – a sharable instance of a class Façade –A simplified interface to the generic system, as the system evolves Bridge –A class that integrates interface to implementation Decorator –A class with possible decorators (rather than derived classes)

Behavioral Pattern Observer or listener class Mediator – communication interface (stub?) Chain of Responsibility – chain of mediators Template – abstract definition of an algorithm Interpreter – appears like a language construct Strategy – a mechanism to choose algorithm by the driver Visitor – driver on multiple instance of a class (non-object oriented approach used for efficiency) State – class retains its state and switches its choice of class Command – traps and forwards the command to a specific class Iterator – a mechanism to move through a collection through an interface

Framework Domain oriented design Can take this design (as a whole) and utilize it for multiple applications Service industry Distribution industry Health care industry Manufacturing Marketing Embedded Controls –Aircraft controls –Chiller controls

Summary What is UML? What is it unifying? What is the fundamental premise of UML? Define system Architecture. List the views of a system What is UP? Describe the axioms of UP. List the phases and workflows prescribed in UP

Summary (cont.) Who is responsible for the inception Phase? Who is responsible for other phases? Do we have to do all the workflows for every requirement? How are testing benchmarks to be developed? What would make systems developed using UML and UP obsolete?

Summary (Cont.) Argue for and against maintaining legacy systems. What is meant by a Quality Product? What is a Quality Process? Is UML/UP applicable to areas other than software development? Suggest some applications

Summary (Cont.) What is not covered in the UP? When can we consider the software a success? Who is responsible for the ultimate success or the failure of the software? When can we consider the software development process a success?

Not covered Human Factors –Timeliness –Judgments and Evaluations –Sufficiency, Completeness, Soundness –Effect of culture Technical Factors –Choice of tools may affect product –Unknown exceptions in the domain –Technical issues intentionally/unintentionally ignored

Other topics Patterns and their effects Frameworks and their effects

Non Programmer Roles Systems Analyst Requirements Engineer Use-case engineer Software analyst Design Engineer Architect Component Engineer

Overall Experience Adoption of UP and UML Experience in large scale software Analysis and Design Experience in inter-group and intra-group discussions Multiple projects assist in revisiting analysis and design Development from other team deliverables Communication - oral and written Opportunity to contribute and assimilate from other projects First hand view of commonality among various software Non Programmer roles