Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.

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

18-1 Verifying Object Behavior and Collaboration Role playing – the act of simulating object behavior and collaboration by acting out an object’s behaviors.
More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott.
Patterns Reusable solutions to common object-oriented programming problems When given a programming problem, re-use an existing solution. Gang of Four.
05/26/2004www.indyjug.net1 Indy Java User’s Group June Knowledge Services, Inc.
(c) 2009 University of California, Irvine – André van der Hoek1June 13, 2015 – 21:42:16 Informatics 122 Software Design II Lecture 8 André van der Hoek.
Dept. of Computer Engineering, Amirkabir University of Tech. 1 Design Patterns Dr. Noorhosseini Introduction.
Design Patterns CS is not simply about programming
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.
(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 Standardized Recurring model Fits in many location Opposite of customization Fundamental types of pattern Choose and use as desired and.
樣式導向設計 (Pattern-Oriented Design) 課程簡介 Ku-Yaw Chang Assistant Professor, Department of Computer Science and Information Engineering.
05 - Patterns Intro.CSC4071 Design Patterns Designing good and reusable OO software is hard. –Mix of specific + general –Impossible to get it right the.
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
SOEN 6011 Software Engineering Processes Section SS Fall 2007 Dr Greg Butler
January 12, Introduction to Design Patterns Tim Burke References: –Gamma, Erich, et. al. (AKA, The Gang of Four). Design Patterns: Elements of Reusable.
Powerpoint Templates Page 1 Powerpoint Templates What is Design Patterns ? by Indriati Teknik Informatika – UB.
SOFTWARE DESIGN AND ARCHITECTURE LECTURE 27. Review UML dynamic view – State Diagrams.
SOEN 343 Software Design Section H Fall 2006 Dr Greg Butler
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
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.
CSE 403 Lecture 14 Design Patterns. Today’s educational objective Understand the basics of design patterns Be able to distinguish them from design approaches.
Unit 1 General Introduction Summary prepared by Kirk Scott 1.
CSE 403, Spring 2008, Alverson Software Design “There are two ways of constructing a software design: one way is to make it so simple that there are obviously.
Methods: Deciding What to Design In-Young Ko iko.AT. icu.ac.kr Information and Communications University (ICU) iko.AT. icu.ac.kr Fall 2005 ICE0575 Lecture.
ECE450S – Software Engineering II
Design Patterns CSIS 3701: Advanced Object Oriented Programming.
Introduction to Design Patterns. Questions What is a design pattern? Who needs design patterns? How different are classes and objects in APL compared.
1 Design Patterns Object-Oriented Design. 2 Design Patterns 4Reuse of design knowledge and experience 4Common in many engineering disciplines 4Avoids.
Creational Patterns
What to know for the exam. Smalltalk will be used for questions, but there will not be questions about the grammar. Questions might ask – how particular.
Proxy.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
Copyright © Active Frameworks Inc. - All Rights Reserved - V2.0Design Pattern Catalog - Page L3-1 PS95&96-MEF-L10-1 Dr. M.E. Fayad Creationa.
CS616: Software Engineering Spring 2009 Design Patterns Sami Taha.
Software Design Patterns Curtsy: Fahad Hassan (TxLabs)
Design Patterns. 1 Paradigm4 Concepts 9 Principles23 Patterns.
Design Patterns Introduction
CS251 – Software Engineering Lectures 18: Intro to DP Slides by Rick Mercer, Christian Ratliff, Oscar Nierstrasz and others 1 و ابتغ فيما آتاك الله الدار.
Design Patterns Introduction “Patterns are discovered, not invented” Richard Helm.
Design Patterns in Context ©SoftMoore ConsultingSlide 1.
Five Minute Design Patterns Doug Marttila Forest and the Trees May 30, 2009 Template Factory Singleton Iterator Adapter Façade Observer Command Strategy.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Patterns: MORE Examples
The Object-Oriented Thought Process Chapter 15
Object-Oriented Analysis and Design
Chapter 10 Design Patterns.
樣式導向設計 (Pattern-Oriented Design) 課程簡介
Chapter 5:Design Patterns
Software Design Patterns
MPCS – Advanced java Programming
Introduction to Design Patterns
Design Patterns Lecture part 2.
Introduction to Design Patterns
More Interfaces, Dynamic Binding, and Polymorphism
How to be a Good Developer
Unit 1 General Introduction
object oriented Principles of software design
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
Software Engineering Lecture 7 - Design Patterns
Informatics 122 Software Design II
CSE 403 Software Design.
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2005 Instructor: Patrice Chalin.
DESIGN PATTERNS : Introduction
SOEN 343 Software Design Computer Science and Software Engineering Department Concordia University Fall 2004 Instructor: Patrice Chalin.
Informatics 122 Software Design II
Chapter 8, DesignPatterns Facade
Presentation transcript:

Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1

Intended Audience, Coverage, etc. The classic book, Design Patterns, was written by Gamma, Helm, Johnson, and Vlissides This book covers the same set of 23 patterns The book is intended for software programmers/developers who know Java and want to improve their skills as designers 2

What is a Pattern? A pattern is a way of doing something It can be thought of as a technique for accomplishing some goal This book dwells on the intent of patterns as an organizing characteristic 3

Where do Patterns Come From? Software development is repetitive: Quite often, different programmers have to solve the same problem Experienced programmers have compared notes and discovered that they arrived at common solutions to the same problem Over time, these common solutions, have been documented as the best know approach to solving a given problem 4

Why Design Patterns? Observe that in school, you learn to program first and learn about design later When you compare your solution to a problem with someone else’s solution, you may realize that the other solution is simpler, more efficient, or more desirable in some other way In practice, it is helpful to have knowledge of design before trying to code a solution to a problem 5

Why Design Patterns? Cont’d. Design patterns are one step up from straight code writing They represent recognized software solutions in terms of (small) collections of classes related in a certain way and containing certain sets of methods It is important to keep in mind that the implementation is not the pattern—a pattern is the abstract design which embodies the intent 6

Why Design Patterns? Cont’d. Design patterns have been developed most extensively in the object-oriented realm The authors point out that there are currently over 100 documented design patterns The 23 covered in the book have been chosen for historic reasons They are certainly worth knowing, whether they are absolutely the most important 7

Why Design Patterns? Cont’d. In particular, whether the most important or not, the 23 chosen patterns provide a broad introduction to and illustration of what patterns are and what good they are The authors assert that if a person wants to become a good Java programmer, it is necessary to study design patterns Design patterns are the first step out of the swamp of syntax that an introduction to programming is 8

Why Java? Java is a consolidation language This means that it is a kitchen sink language in the footsteps of C and C++, and for this reason, if no other, it is popular The object-oriented programming is based on classes and instances, and this paradigm is currently the most popular approach to implementing graphical user interfaces, for example Java’s characteristics make it likely that future popular languages will follow in Java’s footsteps 9

UML Implementations of patterns are done in code However, the pattern itself consists of the relationships among classes and so on UML is one of several notations for diagramming notations, but it is certainly a popular one The point is that some abstract representation of patterns is desirable, rather than appealing always to the code of a particular implementation 10

Challenges The book contains questions These may be short answer questions They may also be programming questions based on the book’s example code This course will not give these challenges as assignments Instead, the challenges and the authors’ solutions will be examined to see what can be gained from them 11

The Organization of the Book The patterns in a book of this kind could be given in the same order as the original design patterns book They could also be grouped together according to similarity in structure This book organizes the patterns according to the intent which the authors ascribe to them 12

The Organization of This Book, cont’d. This raises the question of how to classify intent The authors suggest that categories of patterns can be recognized according to how the patterns make it possible to go beyond the basic characteristics built into the structure of Java They use as an initial example the idea of interfaces 13

The Organization of This Book, cont’d. Suppose you have a class/method which requires an object of a class which implements a given interface Suppose that you would like to apply the above to an object of a class which does not implement the required interface Short of rewriting the given class, what approach could be taken? 14

The Organization of This Book, cont’d. The answer is that there is a pattern known as the Adapter pattern (not to be confused with adapter classes in Java) which accomplishes this goal The Adapter pattern, and others with similar intents, are classified in an intent category known as Interfaces To recapitulate, these patterns help the programmer accomplish things using interfaces, going beyond the syntax provided in Java 15

The Organization of This Book, cont’d. The book classifies patterns into these five categories: – Interfaces – Responsibility – Construction – Operations – Extensions 16

The Organization of This Book, cont’d. The book, as a consequence is organized in the same way The authors admit that various patterns may fit more than one category In such cases, the pattern is given in detail in the first category where it fits, and is mentioned briefly in subsequent sections The classification of patterns is not an absolute, but some classification is useful and necessary, and is a starting point for suggesting alternative classifications 17

The Organization of This Book, cont’d. What follows is a complete preview of the contents of the book Intent Category: Interfaces. Patterns: Adapter, Façade, Composite, Bridge Intent Category: Responsibility. Patterns: Singleton, Observer, Mediator, Proxy, Chain of Responsibility, Flyweight 18

The Organization of This Book, cont’d. Intent Category: Construction. Patterns: Builder, Factory Method, Abstract Factory, Prototype, Memento Intent Category: Operations. Patterns: Template Method, State, Strategy, Command, Interpreter Intent Category: Extensions. Patterns: Decorator, Iterator, Visitor 19

Welcome to Oozinoz! The book’s examples are based on an integrated code base which is collectively known as Oozinoz (oohs and ahs), which deals with software needed for the production of fireworks The authors’ examples will be studied, but as noted already, the challenges will not be given as assignments 20

Summary This is the book’s summary of the chapter, verbatim: – Patterns are distillations of accumulated wisdom that provides a standard jargon, naming the concepts that experienced practitioners apply. – The patterns in the classic book Design Patterns are among the most useful class-level patterns and are certainly worth learning. 21

Summary, cont’d. – This book explains the same patterns as those documented in Design Patterns but uses Java and its libraries for its examples and challenges. – By working through the challenges in this book, you will learn to recognize and apply an important part of the wisdom of the software community. 22

The End 23