Generic Interfaces and Encapsulation, a Class in the Middle

Slides:



Advertisements
Similar presentations
Unit 7 Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott.
Advertisements

Mars in Ancient History Due to its red color, Mars was associated with the idea of spilled blood and came to be know in Western mythology as the god of.
The Bridge Pattern.. Intent Decouple an abstraction from its implementation so that the two can vary independently Also known as: Handle/Body.
More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott.
SUPERSTITIONS Jillian Stringfellow. WHAT IS A SUPERSTITION?  Superstitions have been around since the beginning of man kind. It’s the irrational fear.
Façade Pattern Jeff Schott CS590L Spring What is a façade? 1) The principal face or front of a building 2) A false, superficial, or artificial appearance.
Mars is a terrestrial planet because it has got: -a crust -a mantle -a core The core of Mars is composed by iron and it extends for a ray of about 1480.
Chapter 11 Religion. Cargo Cults What conclusions about religion can be drawn from the development of cargo cults?
GRASP Principles. How to Design Objects The hard step: moving from analysis to design How to do it? –Design principles (Larman: “patterns”) – an attempt.
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,
Case Studies on Design Patterns Design Refinements Examples.
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.
ECE450 - Software Engineering II1 ECE450 – Software Engineering II Today: Design Patterns IX Interpreter, Mediator, Template Method recap.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see.
Composite and Related Patterns Kirk Scott. The pitohui, a poisonous bird of New Guinea.
FacadeDesign Pattern Provide a unified interface to a set of interfaces in a subsystem. Defines a high level interface that makes the subsystem easier.
Behavioral Patterns CSE301 University of Sunderland Harry R Erwin, PhD.
CS 350 – Software Design Expanding Our Horizons – Chapter 8 The traditional view of objects is that they are data with methods. Sometimes objects could.
The Mediator Pattern (Behavioral) ©SoftMoore ConsultingSlide 1.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
© 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1 Broker Design Patterns: Façade and Mediator.
Design Patterns CSCE 315 – Programming Studio Spring 2013.
Design Pattern Introduction in Data Structures Purpose  Natural integration of patterns into data structures education Plan  Cover traditional topics.
Presented by FACADE PATTERN
Summary prepared by Kirk Scott
Mediator Design Pattern
Objects First with Java A Practical Introduction using BlueJ
Façade Pattern:.
Chapter 10 Design Patterns.
TK2023 Object-Oriented Software Engineering
MPCS – Advanced java Programming
Design Patterns Lecture part 2.
Chapter Six The Facade Pattern
Introduction to Design Patterns
Unit 11 Generic Interfaces and Encapsulation, Continued
Summary prepared by Kirk Scott
More Interfaces, Dynamic Binding, and Polymorphism
Their Eyes were watching god
CIV 101 American University of Nigeria
Reading Objectives: Read and comprehend informational text.
Chapter 17 Abstract Factory
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Strategy Design Pattern
Let’s Do It Essay Style! Short 3 Paragraph Essay.
DE ACTIVITY 1.1 ILO: Students will explain what they already know about interactions in Yellowstone Park. Focus Question: What animal species live within.
Objects First with Java A Practical Introduction using BlueJ
Multiuser Protection and the Mediator Pattern
Introduction to Sociology
Heredity Chapter 5.
Mediator Design Pattern (Behavioral)
Object Oriented Design Patterns - Structural Patterns
Block Class Writing Review
Fry Word Test First 300 words in 25 word groups
Reading Unit: 1 Lesson:1 Module: A Objectives:
Unit 10 Arithmetic-logic Units
Stone of Separation.
Objects First with Java A Practical Introduction using BlueJ
The. the of and a to in is you that with.
David Johnson Marketing
COMP 208/214/215/216 – Lecture 5 Presentation Skills 恭喜發財.
Objects First with Java A Practical Introduction using BlueJ
Interactions and Ecosystems
Interactions and Ecosystems
Literary Devices.
Presentation transcript:

Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott

Mars (mythology) From Wikipedia, the free encyclopedia Mars (Latin: Mārs, adjectives Martius and Martialis) was the Roman god of war and also an agricultural guardian, a combination characteristic of early Rome.[1] He was second in importance only to Jupiter, and he was the most prominent of the military gods worshipped by the Roman legions. His festivals were held in March, the month named for him (Latin Martius), and in October, which began and ended the season for military campaigning and farming.

The two wild animals most sacred to Mars were the woodpecker and the wolf, which in the natural lore of the Romans were said always to inhabit the same foothills and woodlands.[24] Plutarch notes that the woodpecker (picus) is sacred to Mars because "it is a courageous and spirited bird and has a beak so strong that it can overturn oaks by pecking them until it has reached the inmost part of the tree."[25] As the beak of the picus Martius contained the god's power to ward off harm, it was carried as a magic charm to prevent bee stings and leech bites.[26] The bird of Mars also guarded a woodland herb (paeonia) used for treatment of the digestive or female reproductive systems; those who sought to harvest it were advised to do so by night, lest the woodpecker jab out their eyes.[27] The picus Martius seems to have been a particular species, but authorities differ on which one: perhaps Picus viridis[28] or Dryocopus martius.[29]

European Green Woodpecker

Black Woodpecker

This is an introductory unit. These are the units/chapters belonging to this section of the course: Book chapter 2, Introducing Interfaces Mediator, book chapter 10. Façade, book chapter 4. Adapter, book chapter 3.

What will be given next is an extremely brief overview of these topics. The idea is to show that according to the organizational scheme for the course, they can be treated as belonging together, even though the book’s organizational scheme put them into chapters that were separated from each other.

Book Chapter 2, Introducing Interfaces This chapter does not include a pattern It is useful because: It summarizes what you already know about Java interfaces It also provides additional information on that topic which isn’t mentioned in CSCE 202

Mediator Book definition: The intent of the Mediator pattern is to define an object that encapsulates how a set of objects interact; this promotes loose coupling, keeping the objects from referring to one another explicitly, and lets you vary their interactions independently. Comment mode on: By definition, a mediator is something that is “in the middle”, between other things. In object-oriented terms, it’s a class in the middle in terms of functional interactions between classes.

Façade Book definition: The intent of the Façade pattern is to provide an interface that makes a subsystem easy to use Comment mode on: This, of course, sounds deceptively simple. How hard it is to make things easy to use… The façade will be a class with a set of straightforward methods which make calls to methods in underlying classes.

Adapter Book definition: The intent of Adapter is to provide the interface that a client expects while using the services of a class with a different interface Comment mode on: My joke about adapter is that adapter is the one true pattern. All other patterns, by intent, if not structure, are adapters.

The idea of having one class provide an interface for another is in some sense fundamental. In essence, we’ve seen it in embryonic form in patterns we’ve looked at already. A proxy has adapter-like characteristics. Mediator and façade also have adapter-like characteristics, and that’s why these three patterns are grouped together

In summary: Mediator defines the interactions between classes Façade provides a nice interface for a class or set of classes Adapter implements the interface needed by a client in order to use a class with a different interface In one way or another, these patterns all have something to do with providing an interface or functionality that support the relationship between one class and another.

As you will see when the patterns are presented, these are concise mnemonic devices for their most important characteristics: Mediator: The class in the middle, the class that stands between, the class that defines the interactions among classes. Façade: The class that stands in front, providing a user-friendly interface. Adapter: The jack of all trades; the class that makes one class usable by another.

The End