Unit 11 Generic Interfaces and Encapsulation, Continued

Slides:



Advertisements
Similar presentations
Welcome to. Who am I? A better way to code Design Patterns ???  What are design patterns?  How many are there?  How do I use them?  When do I use.
Advertisements

Systems Analysis and Design 8th Edition
Unit 7 Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott.
More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Object Oriented Programming
ADAPTER PATTERN BY Sravanthi Karumanchi. Structure Pattern Structure patterns are concerned with how classes and objects are composed to form large structures.
Design Patterns in Java Chapter 13 Flyweight Summary prepared by Kirk Scott 1.
Unit 2 Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet,
An Introduction to Design Patterns. Introduction Promote reuse. Use the experiences of software developers. A shared library/lingo used by developers.
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Unit 7 Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott.
Unit 15 Java Interfaces: Using an Interface to Accomplish a Specific Goal Kirk Scott.
Design Patterns CSCI 5801: Software Engineering. Design Patterns.
GRASP: Designing Objects with Responsibilities
Design Patterns CS 124 Reference: Gamma et al (“Gang-of-4”), Design Patterns.
Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see.
Structural Design Patterns
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Design Patterns in Java Part II Responsibility Patterns Chapter 7 Introducing Responsibility Summary prepared by Kirk Scott 1.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns VIII Chain of Responsibility, Strategy, State.
Title Carolina First Steering Committee October 9, 2010 Online Voting System Design Yinpeng Li and Tian Cao May 3, 2011.
CSC 131 Fall 2006 Lecture # 6 Object-Oriented Concepts.
Composite and Related Patterns Kirk Scott. The pitohui, a poisonous bird of New Guinea.
Today… Modularity, or Writing Functions. Winter 2016CISC101 - Prof. McLeod1.
Slide 1 Unified Modeling Language, Version 2.0 Object-Oriented SAD.
Cascading Style Sheets for layout
Generic Interfaces and Encapsulation, a Class in the Middle
OOP - Object Oriented Programming
GRASP – Designing Objects with Responsibilities
Design Patterns: MORE Examples
CompSci 280 S Introduction to Software Development
Summary prepared by Kirk Scott
Design Patterns in Java Chapter 22 State
Chapter 1: Introduction to Systems Analysis and Design
Business System Development
Design Patterns in Java Chapter 23 Strategy
Chapter 10 Design Patterns.
Chapter 5:Design Patterns
Introduction to Design Patterns
TIM 58: Systems Analysis and Design Winter Quarter 2017 Tuesday/Thursday 1:30 – 3:05 pm, Classroom Unit 1.
Object-Oriented Programming
Introduction to Design Patterns
The Object-Oriented Thought Process Chapter 1
Behavioral Design Patterns
Software Design and Architecture
Activities and Intents
More Interfaces, Dynamic Binding, and Polymorphism
Topic: Functions – Part 2
Critical Reading Strategy
Chapter 25: Architecture and Product Lines
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Chapter 1 Object-Oriented Analysis and Design. Disclaimer Slides come from a variety of sources: –Craig Larman-developed slides; author of this classic.
Abstract Data Types and Encapsulation Concepts
Design Patterns in Game Design
Chapter 20 Object-Oriented Analysis and Design
Looping and Random Numbers
Design and Implementation
An Introduction to Software Architecture
ITEC 3220A Using and Designing Database Systems
Chapter 1: Introduction to Systems Analysis and Design
Algorithms and Problem Solving
Chapter 5.
Informatics 122 Software Design II
Chapter 22 Object-Oriented Systems Analysis and Design and UML
Object-Oriented Programming
Chapter 1: Introduction to Systems Analysis and Design
Critical Reading Strategy
Chapter 20 Object-Oriented Concepts and Principles
Presentation transcript:

Unit 11 Generic Interfaces and Encapsulation, Continued Kirk Scott

Corbel From Wikipedia, the free encyclopedia Jump to: navigation, search For other uses, see Corbel (disambiguation). In architecture a corbel (or console) is a piece of masonry jutting out of a wall to carry any superincumbent weight. A piece of timber projecting in the same way was called a "tassel" or a "bragger".[1] The technique of corbelling, where rows of corbels deeply keyed inside a wall support a projecting wall or parapet, has been used since Neolithic times.[2] It is common in Medieval architecture and in the Scottish baronial style as well as in the Classical architectural vocabulary, such as the modillions of a Corinthian cornice and in ancient Chinese architecture.

This is an introductory unit. These are the units/chapters belonging to this section of the course: Unit 12, Flyweight, book chapter 13 Unit 13, Decorator, book chapter 27 Unit 14, State, book chapter 22

What will be given next is an extremely brief overview of these topics. Although the patterns are different from each other, they can be viewed as having this broad characteristic in common: They wrap up functionality in a desirable way In other words, they provide models for how to divide attributes and operations among classes in an overall design

Flyweight Book definition: The intent of the Flyweight pattern is to use sharing to support large numbers of fine-grained objects efficiently. Comment mode on: It might be preferable to say “large numbers of references to a smaller set of fine-grained objects”, although there may also be a large number of objects Simple large-scale sharing is supported by making the shared object(s) immutable

Decorator Book definition: The intent of Decorator is to let you compose new variations of an operation at runtime. Comment mode on: Although the term “compose” appears in the definition, the Decorator pattern is not related to the composite design pattern, which will be given later

The word compose describes nested construction where the resulting object contains a composite of functionalities In brief, nested construction refers to this idea: Subclasses contain instance variables that are of the type of one of their superclasses This came up in the proxy design pattern, where it proved less than ideal It is used in earnest in this design pattern

Command Book definition: The intent of the Command pattern is to encapsulate a request in an object. Comment mode on: Informally, this pattern allows you to “pass a method”

You “pass a method” by creating a class containing the desired method, constructing an instance of the class, and passing that object as a parameter In the receiving code it is then possible to call the desired method on the object

State Book definition: The intent of the State pattern is to distribute state-specific logic across classes that represent an object’s state Comment mode on: What this means is that a problem will be analyzed in terms of its states There will be a class for in the design for each state

The code for a particular state will occur only once, in a method for that state, rather than many times, in several different domain methods in a non-state design The practical goal and consequence of distributing or dividing logic among various state classes is to avoid needless repetition of code

In summary: Flyweight encapsulates the core, immutable characteristics of a kind of entity into a class so that references to instances of that class can be shared Decorator nests construction of objects of different classes, resulting in an object with a “concentric” set of functionalities

Command packages a method in a class so that it can be called elsewhere by passing an object that the method can be called on State subdivides functionality associated with states into different classes In one way or another, these patterns all have something to do with what belongs in a given class in a design.

These are my mnemonic devices for the patterns and their characteristics: Flyweight: Immutable core Decorator: Nested construction, concentric function Command: Packaged, wrapped, passable method State: Subdivide design to support (state) transition

The End