Slides0417 - Introduction to Object Oriented Design,...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Object Oriented Design, Continued Patterns and Architectures
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Agenda Design Patterns - What are they? - Common ones - What they are *not* Architectures - Model-View-Controller - Layers
Background image of page 2
Design Patterns Design Patterns are object interactions that come up as solutions to a wide variety of problems. As with anything in design, it is very subjective. There are dozens of recognized patterns (GoF “Design Patterns”) Provides a common vocabulary to simplify discussions on OO design
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Design Patterns Design Patterns are NOT always a solution. Too many people first read the book and go hog-wild, using them everywhere. Most of the time, in a large project, you’ll see examples at least several In small projects, zero
Background image of page 4
Factory A factory method is a method that constructs an object. Slightly different from a constructor, in that it’s the same as any other method. Often used when construction of an object needs information that that object’s constructor shouldn’t have.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Two Kinds of Factories Static factories - Usually implemented in the object itself. i.e., object “A” might have a static method “create”, so you’d call “A.create()” to make new A’s Outside factories - Just a method somewhere, designed to make objects for someone else
Background image of page 6
Factory Example In Comets: Ship.fire - Factory for Shot objects. - Alternative: CometsMain gets lots of information from Ship (position, velocity, orientation) and constructs the shot itself - Much better for encapsulation and modularity to just let the Ship construct them internally.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 02/09/2010 for the course CS COP 3330 taught by Professor Douglass during the Spring '09 term at University of Central Florida.

Page1 / 27

Slides0417 - Introduction to Object Oriented Design,...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online