Presentation is loading. Please wait.

Presentation is loading. Please wait.

ITEC 370 Lecture 12 Design. Review Questions? Design patterns –How useful are they? –Command pattern What is it? What can it do for you?

Similar presentations


Presentation on theme: "ITEC 370 Lecture 12 Design. Review Questions? Design patterns –How useful are they? –Command pattern What is it? What can it do for you?"— Presentation transcript:

1 ITEC 370 Lecture 12 Design

2 Review Questions? Design patterns –How useful are they? –Command pattern What is it? What can it do for you?

3 Design Objectives Design patterns –A few good ones

4 Design Review Design patterns Command pattern –Definition –Example

5 Design Adapter Square peg, round hole problem Use aggregation or inheritance Pass-through for a system Example

6 Design Bridge Two software parts, and a desire to not strongly couple them Class A / Class B A and B only interact with each other using class C Only C has to be changed if A/B changes Examples

7 Design Factory Used to create instances of a class –Not just a constructor Many variants –Static interfaces –Separate class (similar to a bridge) Goal –Have something that takes information and returns a class that can be used –DB entry

8 Design Flyweight Bookmark or easily recognizable piece of information Goal: create one and use it everywhere –NULL –Leaves on a tree Memory saver

9 Design Facade Used to hide the gory details from the end user Abstraction layer Many functions combined into one –Depends on what the API requires Lego Robot example

10 Design Observer Notification pattern One source of events Many classes interested in said events When one happens, they are informed from it How would you design this functionality?

11 Design Memento Saves information so it can be restored later Create a save function Create a recall function Self contained or use an archive class Undo

12 Design Strategy Task –Multiple algorithms to accomplish this task –Pick one at run-time –How/Why? JVM

13 Design Chain of responsibilit y Mimic chain of command One class multiple choices Based on the “ranking” of an action, a particular choice Example –Threat level of an warning/error

14 Design Review Design patterns


Download ppt "ITEC 370 Lecture 12 Design. Review Questions? Design patterns –How useful are they? –Command pattern What is it? What can it do for you?"

Similar presentations


Ads by Google