CS 490 Design Patterns. Introduce Yourself Your name Your name What attracted you to this course?...

23
CS 490 CS 490 Design Patterns Design Patterns

Transcript of CS 490 Design Patterns. Introduce Yourself Your name Your name What attracted you to this course?...

CS 490CS 490

Design PatternsDesign Patterns

Introduce YourselfIntroduce Yourself

Your nameYour name What attracted you to this course?What attracted you to this course? Experience with Design Patterns.Experience with Design Patterns. How would you define “Design How would you define “Design

Patterns” at this point.Patterns” at this point.

I’ll go first.I’ll go first.

Will this be a hard course?Will this be a hard course?

Why not? (sorry if that’s a disappointment)Why not? (sorry if that’s a disappointment) New material for me.New material for me. Exhaustion after two terms.Exhaustion after two terms.

Mine (and probably yours).Mine (and probably yours). Freedom to explore.Freedom to explore. Spring is coming!Spring is coming!

I will try to provide a framework in which you I will try to provide a framework in which you can productively learn a lot.can productively learn a lot.

I will not spend much time “cracking the whip”.I will not spend much time “cracking the whip”.

My modelMy model

Lewis and ClarkLewis and Clark A great book: A great book: Undaunted CourageUndaunted Courage by Stephen Ambrose. by Stephen Ambrose.

None of us have been this way before.None of us have been this way before. I organize the expedition.I organize the expedition. We are all scouts, exploring and reporting on what We are all scouts, exploring and reporting on what

we have seen.we have seen. Don’t know exactly where we will go or what we Don’t know exactly where we will go or what we

will see.will see. It worked well for AOP.It worked well for AOP. If you don’t like this approach, take a different If you don’t like this approach, take a different

trip!trip!

Things that influence your gradeThings that influence your grade

Project (which you propose and I approve).Project (which you propose and I approve). Class Participation (your presentations and Class Participation (your presentations and

otherwise).otherwise). Focus group at end of term where I will ask Focus group at end of term where I will ask

you to sit down with others and discuss you to sit down with others and discuss some course issues while I mainly listen.some course issues while I mainly listen.

Perhaps a few specific homework Perhaps a few specific homework assignments.assignments.

Journal of your course activities.Journal of your course activities. Day-by-day log of time spent and what you did.Day-by-day log of time spent and what you did. Reactions to things you have read.Reactions to things you have read. More details soon.More details soon.

The Blind Men and the The Blind Men and the ElephantElephant

by John Godfrey Saxeby John Godfrey Saxe

It was six men of Indostan It was six men of Indostan To learning much inclined, To learning much inclined, Who went to see the Elephant Who went to see the Elephant (Though all of them were blind), (Though all of them were blind), That each by observation That each by observation Might satisfy his mind Might satisfy his mind

The First approached the Elephant, The First approached the Elephant, And happening to fall And happening to fall Against his broad and sturdy side, Against his broad and sturdy side, At once began to bawl: At once began to bawl: ““God bless me! but the Elephant God bless me! but the Elephant Is very like a wall!” Is very like a wall!”

The Second, feeling of the tusk, The Second, feeling of the tusk, Cried, “Ho! what have we here Cried, “Ho! what have we here So very round and smooth and So very round and smooth and

sharp? sharp? To me ’tis mighty clear To me ’tis mighty clear This wonder of an Elephant This wonder of an Elephant Is very like a spear!” Is very like a spear!”

The Third approached the animal, The Third approached the animal, And happening to take And happening to take The squirming trunk within his hands, The squirming trunk within his hands, Thus boldly up and spake: Thus boldly up and spake: ““I see,” quoth he, “the Elephant I see,” quoth he, “the Elephant Is very like a snake!” Is very like a snake!”

The Fourth reached out an eager The Fourth reached out an eager hand, hand,

And felt about the knee. And felt about the knee. ““What most this wondrous beast is What most this wondrous beast is

like like Is mighty plain,” quoth he; Is mighty plain,” quoth he; “ ‘“ ‘Tis clear enough the Elephant Tis clear enough the Elephant Is very like a tree!” Is very like a tree!”

The Fifth, who chanced to touch the The Fifth, who chanced to touch the ear, ear,

Said: “E’en the blindest man Said: “E’en the blindest man Can tell what this resembles most; Can tell what this resembles most; Deny the fact who can Deny the fact who can This marvel of an Elephant This marvel of an Elephant Is very like a fan! Is very like a fan!

The Sixth no sooner had begun The Sixth no sooner had begun About the beast to grope, About the beast to grope, Than, seizing on the swinging tail Than, seizing on the swinging tail That fell within his scope, That fell within his scope, ““I see,” quoth he, “the Elephant I see,” quoth he, “the Elephant Is very like a rope!” Is very like a rope!”

And so these men of Indostan And so these men of Indostan Disputed loud and long, Disputed loud and long, Each in his own opinion Each in his own opinion Exceeding stiff and strong, Exceeding stiff and strong, Though each was partly in the right, Though each was partly in the right, And all were in the wrong! And all were in the wrong!

So oft in theologic wars, So oft in theologic wars, The disputants, I ween, The disputants, I ween, Rail on in utter ignorance Rail on in utter ignorance Of what each other mean, Of what each other mean, And prate about an Elephant And prate about an Elephant Not one of them has seen! Not one of them has seen!

What do some who may be What do some who may be less blind than I say?less blind than I say?

Most of these quotes are Most of these quotes are from James Cooper’s from James Cooper’s Java Java Design Patterns, a Tutorial, Design Patterns, a Tutorial, available available viavia Safari On-line. Safari On-line.

"Design patterns are recurring "Design patterns are recurring solutions to design problems you solutions to design problems you see over and over." [see over and over." [Smalltalk Smalltalk CompanionCompanion]]

"Design patterns constitute a set "Design patterns constitute a set of rules describing how to of rules describing how to accomplish certain tasks in the accomplish certain tasks in the realm of software development." realm of software development." [Pree, 1994][Pree, 1994]

"Design patterns focus more on reuse "Design patterns focus more on reuse of recurring architectural design of recurring architectural design themes, while frameworks focus on themes, while frameworks focus on detailed design... and implementation." detailed design... and implementation." [Coplien and Schmidt, 1995][Coplien and Schmidt, 1995]

"A pattern addresses a recurring design "A pattern addresses a recurring design problem that arises in specific design problem that arises in specific design situations and presents a solution to it." situations and presents a solution to it." [Buschmann and Meunier, et al., 1996][Buschmann and Meunier, et al., 1996]

"Patterns identify and specify "Patterns identify and specify abstractions that are above the level abstractions that are above the level of single classes and instances, or of of single classes and instances, or of components." [Gamma, Helm, components." [Gamma, Helm, Johnson, and Vlissides, 1993]Johnson, and Vlissides, 1993]

Textbook choiceTextbook choice

Most important and influential Most important and influential Patterns book?Patterns book? What do you think?What do you think?

Gang of Four bookGang of Four book Why not use it as main textbook?Why not use it as main textbook? Most influential math books?Most influential math books? Most influential CS books?Most influential CS books?

How to use the textbookHow to use the textbook

Don’t gloss over the Challenges.Don’t gloss over the Challenges. They are the most important part of the They are the most important part of the

book.book. Don’t look at answers too quickly.Don’t look at answers too quickly. Do look at answers before you go on.Do look at answers before you go on. My experience.My experience.

Had more trouble with early challenges than Had more trouble with early challenges than with late ones.with late ones.

Read Foreword, Preface, and Chapters 1 Read Foreword, Preface, and Chapters 1 and 2.and 2.

Overview vs. example.Overview vs. example.

VideoVideo

Richard HelmRichard Helm Write down Write down

terms that need defining for you.terms that need defining for you. reactionsreactions questions.questions.