Design Patterns I Encapsulation, Observer, and Decorator CS 370 SE - - PowerPoint PPT Presentation

design patterns i
SMART_READER_LITE
LIVE PREVIEW

Design Patterns I Encapsulation, Observer, and Decorator CS 370 SE - - PowerPoint PPT Presentation

Design Patterns I Encapsulation, Observer, and Decorator CS 370 SE Practicum, Cengiz Gnay (Some slides courtesy of Eugene Agichtein and the Internets) CS 370, Gnay (Emory) Design Patterns I Spring 2014 1 / 9 Agenda Upcoming project


slide-1
SLIDE 1

Design Patterns I

Encapsulation, Observer, and Decorator CS 370 SE Practicum, Cengiz Günay

(Some slides courtesy of Eugene Agichtein and the Internets) CS 370, Günay (Emory) Design Patterns I Spring 2014 1 / 9

slide-2
SLIDE 2

Agenda

Upcoming project milestones: Today: setup a meeting with Bob to get help about your progress 4/3 get ready to deploy! 4/10 in-class demo and functional prototype opens for testing

CS 370, Günay (Emory) Design Patterns I Spring 2014 2 / 9

slide-3
SLIDE 3

Agenda

Upcoming project milestones: Today: setup a meeting with Bob to get help about your progress 4/3 get ready to deploy! 4/10 in-class demo and functional prototype opens for testing Today: Some design patterns you can use. . .

CS 370, Günay (Emory) Design Patterns I Spring 2014 2 / 9

slide-4
SLIDE 4

Patterns in Software Engineering

CS 370, Günay (Emory) Design Patterns I Spring 2014 3 / 9

slide-5
SLIDE 5

Patterns in Software Engineering

Don’t reinvent the wheel! Re-use existing patterns!

CS 370, Günay (Emory) Design Patterns I Spring 2014 3 / 9

slide-6
SLIDE 6

Entry/Exit Surveys

Exit survey: Version control

What’s the difference between centralized and distributed VCs? Which

  • ne is better and why?

Does version control help you recover from a situation where you deleted some files by mistake? If so, explain how.

Entry survey: Design Patterns

How do you design software? What are some components that need designing in your project? What kind of patterns can be reused during the design of your project? If possible, give some examples.

CS 370, Günay (Emory) Design Patterns I Spring 2014 4 / 9

slide-7
SLIDE 7

UML Cont'd: Use Cases & Stories

  • Sequence diagrams:
  • http://www.uml-diagrams.org/sequence-diagrams-examples.html
  • Use case diagrams:

http://www.agilemodeling.com/artifacts/useCaseDiagram.htm

  • Use case tips: http://www.andrew.cmu.edu/course/90-754/umlucdfaq.html
slide-8
SLIDE 8

Click on me!

slide-9
SLIDE 9

Example: SimUDuck

slide-10
SLIDE 10
slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14

Recap: Strategy Pattern

slide-15
SLIDE 15

Your class hierarchies?

Need some volunteers Tell us about your project classes:

CS 370, Günay (Emory) Design Patterns I Spring 2014 6 / 9

slide-16
SLIDE 16

Your class hierarchies?

Need some volunteers Tell us about your project classes:

1

Uses inheritance for what?

CS 370, Günay (Emory) Design Patterns I Spring 2014 6 / 9

slide-17
SLIDE 17

Your class hierarchies?

Need some volunteers Tell us about your project classes:

1

Uses inheritance for what?

2

Would encapsulation be useful?

CS 370, Günay (Emory) Design Patterns I Spring 2014 6 / 9

slide-18
SLIDE 18
slide-19
SLIDE 19

Example of the observer pattern!

slide-20
SLIDE 20

Observer Pattern

slide-21
SLIDE 21
slide-22
SLIDE 22

Observer Pattern

slide-23
SLIDE 23
slide-24
SLIDE 24

Observer Pattern

slide-25
SLIDE 25

Observer Pattern Defined

slide-26
SLIDE 26
slide-27
SLIDE 27

Java Observable

slide-28
SLIDE 28
slide-29
SLIDE 29

Observer pattern in your project?

Can you think of a place that will be useful in your project?

CS 370, Günay (Emory) Design Patterns I Spring 2014 8 / 9

slide-30
SLIDE 30

Observer pattern in your project?

Can you think of a place that will be useful in your project?

◮ User notification ◮ Likes ◮ Button press in games CS 370, Günay (Emory) Design Patterns I Spring 2014 8 / 9

slide-31
SLIDE 31

Decorator Pattern

slide-32
SLIDE 32
slide-33
SLIDE 33
slide-34
SLIDE 34
slide-35
SLIDE 35

Next week

Scrum now! Next week: Javascript

CS 370, Günay (Emory) Design Patterns I Spring 2014 9 / 9