Earlier Patterns-Patterns in Software Engineering-Lecture 1 Slides-Computer Engineering, Slides of Software Engineering

Earlier Patterns, Software Patterns, Software Design Patterns, Coad's OO Patterns, Item Description, Time Association, Event Logging, Roles Played, State over a Collection, Behavior over a Collection, Broadcast, Coad Patterns, Raman Ramsin, Lecture Slides, Patterns in Software Engineering, Department of Computer Engineering, Sharif University of Technology, Iran.

Typology: Slides

2011/2012

Uploaded on 02/19/2012

hester
hester 🇮🇷

4.5

(13)

84 documents

1 / 21

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Patterns in
Software Engineering
Software
Engineering
Lecturer: Raman Ramsin
Lecturer:
Raman
Ramsin
Lt
1
L
ec
t
ure
1
Earlier Patterns
Department of Computer Engineering 1Sharif University of Technology
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Earlier Patterns-Patterns in Software Engineering-Lecture 1 Slides-Computer Engineering and more Slides Software Engineering in PDF only on Docsity!

Patterns inSoftware EngineeringSoftware Engineering Lecturer: Raman RamsinLecturer:

Raman Ramsin

L^

t^

Lecture 1 Earlier Patterns

1

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Software Patterns „ Software Patterns support reuse of software architecture

pp

and design.

^

Patterns capture the static and dynamic structures and

^

Patterns capture the static and dynamic structures andcollaborations of successful solutions to problems that arisewhen building applications in a particular domain.

„^

Patterns represent solutions to problems that arise whendeveloping software within a particular contextdeveloping software within a particular context.

^

i.e., “Pattern == problem/solution pair in a context”

2

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Software Design Patterns „ “A

design pattern names, abstracts, and identifies the

key aspects of a common design structure that make ituseful for creating a reusable object-oriented design.”

„^

Design Patterns capture the static and dynamic structureand collaboration among key participants in softwaredesigns.

^

They are particularly useful for articulating how and why toresolve non-functional forcesresolve non-functional forces.

^

Patterns facilitate reuse of successful software architecturesand designs.

4

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Coad's OO Patterns „ Seven basic Patterns:

1.^

Item Description 2

Time Association

2.^

Time Association

3.^

Event Logging

4.^

Roles Played

5.^

State over a Collection

6.^

Behavior over a Collection 7

Broadcast

5

Sharif University of Technology

7.^

Broadcast

Patterns in Software Engineering – Lecture 1 Item Description

7

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Pattern 2: Time Association „ If one needs to express attributes or services regarding anassociation between two objects, then an object from "time

j^

,^

j

association" is needed. „^ A "time association" object often sends messages to itsparticipating objects to get values or get a sub-calculationparticipating objects to get values or get a sub calculationdone on its behalf. „^

Note that the association connection:^

captures the association for future queries about these objects. captures (for the sender) "to whom to send a message." „^ Use this pattern whenever the system is responsible to knowan association between two or more objects and to know ordo something about that association

8

Sharif University of Technology

do

something about that association.

Patterns in Software Engineering – Lecture 1 Pattern 3: Event Logging „ A "device" object monitors an external device; the object

^

is responsible for detecting that an event has occurred;

^

is responsible for detecting that an event has occurred;

^

is responsible for initiating a response to the event. P^

t^

f th

b^

t^

l^

th^

t'^

h^

thi

„^ Part of the response may be to log the event's occurrence; when thisis the case, a "device" object sends the message "create" to the"event remembered" class to create an object with historical values. „^ A "device" object may know about some number of "eventremembered" objects; an "event remembered" object must knowabout a corresponding "device" object. „^ Use whenever an event is detected, and you need to log itsoccurrence to support after-the-fact analysis or to meet legaleq i ements

10

Sharif University of Technology

requirements.

Patterns in Software Engineering – Lecture 1 Event Logging

11

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Roles Played

13

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Pattern 5: State over a Collection „ A "collection" object knows its state; this state applies to thecollection and may also apply to its parts, and each "member"

y^

pp y

p^

object has its own state, too. „^ Use this pattern whenever there is whole-part in a businessdomain or implementation domain, and one or more attributesapply to the whole (the collection)apply to the whole (the collection).

14

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Pattern 6: Behavior over a Collection „ A "collection" object has behavior that applies across an entire

j^

pp

collection of its "member" objects. „^ Each "member" object performs actions, knowing (by means

j^

p^

,^

g ( y

of its attributes) how to perform, without needed coordinationwith other "member" objects. „^ Use this pattern whenever there is whole-part in a domain,and a behavior (i.e., one or more services) applies across thewhole collection. „^ Caution: make the member objects do as much as they canwith what they know; only put behavior that really appliesacross the collection up in the "collection" object.

16

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Behavior over a Collection

17

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Broadcast

19

Sharif University of Technology

Patterns in Software Engineering – Lecture 1 Coad Patterns: Example Model

20

Sharif University of Technology