Introduction Design Patterns and UML class diagrams Linda Marshall - - PowerPoint PPT Presentation

introduction
SMART_READER_LITE
LIVE PREVIEW

Introduction Design Patterns and UML class diagrams Linda Marshall - - PowerPoint PPT Presentation

What are Design Patterns? What is UML? Class diagrams and delegation References Introduction Design Patterns and UML class diagrams Linda Marshall Department of Computer Science University of Pretoria 24 July 2015 Linda Marshall


slide-1
SLIDE 1

What are Design Patterns? What is UML? Class diagrams and delegation References

Introduction

Design Patterns and UML class diagrams Linda Marshall

Department of Computer Science University of Pretoria

24 July 2015

Linda Marshall Introduction

slide-2
SLIDE 2

What are Design Patterns? What is UML? Class diagrams and delegation References

Overview

1

What are Design Patterns? Definitions Why do I use Design Patterns? Design Patterns in COS121

2

What is UML? Background UML diagrams

3

Class diagrams and delegation Class diagram structure Associations Example Dependency

4

References Linda Marshall Introduction

slide-3
SLIDE 3

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 1

Patterns identify and specify abstractions that are above the level of single classes and instances or of components.

Gamma et al (1995) [Gang of Four (GoF)] Linda Marshall Introduction

slide-4
SLIDE 4

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 2

Design Patterns constitute a set of rules describing how to accomplish certain tasks in the realm of software development.

Pree (1995) Linda Marshall Introduction

slide-5
SLIDE 5

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 3

Design Patterns focus more on reuse of recurring architectural design themes, while frameworks focus on detail design and implementation.

Coplien and Schmidt (1995) Linda Marshall Introduction

slide-6
SLIDE 6

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 4

A pattern addresses a recurring design problem that arises in specific design situations and presents a solution to it.

Buschmann et al (1996) Linda Marshall Introduction

slide-7
SLIDE 7

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 5

Design Patterns are recurring solutions to design problems you see over and over.

The Smalltalk Companion (1998) Linda Marshall Introduction

slide-8
SLIDE 8

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 6

Experienced OO developers build up a repertoire of general principles and idiomatic solutions that guide them in the creation of

  • software. These may be called patterns.

Craig Larman(2006) Linda Marshall Introduction

slide-9
SLIDE 9

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Definition 7

Design Patterns are programming tools to improve code to be:

easier to implement, and easier to maintain. are good answers to common and specialised problems. define a common ( programming language independent) programming model that standardise common programming tasks into recognisable forms, giving your projects better cohesiveness. CG Lasater (2007) Linda Marshall Introduction

slide-10
SLIDE 10

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

When design patterns are applied we achieve: Improved maintainability of code Improved adaptability of code Improved reliability of code Programmers who are more effective in their work.

Linda Marshall Introduction

slide-11
SLIDE 11

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

There are 23 classic patterns categorised as: Creational Behavioural Structural

Linda Marshall Introduction

slide-12
SLIDE 12

What are Design Patterns? What is UML? Class diagrams and delegation References Definitions Why do I use Design Patterns? Design Patterns in COS121

Each design pattern is further categorised by the strategy used in the implementation. The two implementation strategies are Delegation and Inheritance. These strategies are further refined in terms of the interaction between classes or the interaction between objects.

Linda Marshall Introduction

slide-13
SLIDE 13

What are Design Patterns? What is UML? Class diagrams and delegation References Background UML diagrams

Unified Modelling Language (UML) is a standard notation for the modelling of real-world objects as a first step in developing an object-oriented design methodology.

http://searchsoftwarequality.techtarget.com/definition/ Unified-Modeling-Language Linda Marshall Introduction

slide-14
SLIDE 14

What are Design Patterns? What is UML? Class diagrams and delegation References Background UML diagrams

UML unifies three OO methodologies: OMT - 1991 - James Rumbaugh OOA and OOD - early 1990’s - while Grady Booch worked at Rationale OOSE - 1992 - Ivor Jacobson The ideas of these “Three Amigos” and

  • thers, under the sponsorship of Rationale,

lead to UML in 1995. UML 2 adapted by OMG in 2005.

Linda Marshall Introduction

slide-15
SLIDE 15

What are Design Patterns? What is UML? Class diagrams and delegation References Background UML diagrams Linda Marshall Introduction

slide-16
SLIDE 16

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Class diagram is UML structure diagram which shows structure of the designed system at the level of classes and interfaces, shows their features, constraints and relationships - associations, generalisations, dependencies, etc.

Linda Marshall Introduction

slide-17
SLIDE 17

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

A class is a classifier which describes a set of

  • bjects that share the same:

features (or members) constraints semantics (meaning)

Linda Marshall Introduction

slide-18
SLIDE 18

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Features

Features of a class are attributes and

  • perations.

Linda Marshall Introduction

slide-19
SLIDE 19

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Features cont.

+ (public), # (protected) and − (private) are used to specify the visibility of the respective features. Always list features in order from public to private in each of the sections of the class.

Linda Marshall Introduction

slide-20
SLIDE 20

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Static members are underlined.

Linda Marshall Introduction

slide-21
SLIDE 21

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency Linda Marshall Introduction

slide-22
SLIDE 22

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Navigatibility

Linda Marshall Introduction

slide-23
SLIDE 23

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Multiplicity

Multiplicity Meaning n..n Exactly n 0..n 0 to n 0..∗ 0 or more m..n At least m and at most n

Linda Marshall Introduction

slide-24
SLIDE 24

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Multiplicity cont.

Linda Marshall Introduction

slide-25
SLIDE 25

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency Linda Marshall Introduction

slide-26
SLIDE 26

What are Design Patterns? What is UML? Class diagrams and delegation References Class diagram structure Associations Example Dependency

Interface SiteSearch is used (required) by SearchController

Linda Marshall Introduction

slide-27
SLIDE 27

What are Design Patterns? What is UML? Class diagrams and delegation References

http://www.uml-diagrams.org

Linda Marshall Introduction