Java Interfaces: Using an Interface to Accomplish a Specific Goal

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

Unit 7 Generic Interfaces and Encapsulation, a Class in the Middle Kirk Scott.
More Interfaces, Dynamic Binding, and Polymorphism Kirk Scott.
Design Patterns for Object Oriented systems CSC 515 Ashwin Dandwate.
Bag implementation Add(T item) – Enlarge bag if necessary; allocate larger array Remove(T item) – Reduce bag if necessary; allocate smaller array Iterator.
Design Patterns in Java Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Spring 2010CS 2251 Design Patterns. Spring 2010CS 2252 What is a Design Pattern? "a general reusable solution to a commonly occurring problem in software.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
Design Patterns Discussion of pages: xi-11 Sections: Preface, Forward, Chapter
Design Patterns in Java Chapter 21 Template Method Summary prepared by Kirk Scott 1.
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,
Recursion Chapter 7. Chapter Objectives  To understand how to think recursively  To learn how to trace a recursive method  To learn how to write recursive.
Unit 4 Prototype Summary prepared by Kirk Scott 1.
Design Patterns in Java Chapter 1 Introduction Summary prepared by Kirk Scott 1.
Unit 18 Strategy 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.
CPSC 102: Computer Science II Dr. Roy P. Pargas 408 Edwards Hall Office Hours 10:00-11:00 am MWF 2:00-3:00 pm TTh.
Construction and Cloning Kirk Scott. Adonis From Wikipedia, the free encyclopedia Jump to: navigation, searchnavigationsearch For the Syrian poet, see.
Appendix D UML at a Glance Summary prepared by Kirk Scott 1.
Composite and Related Patterns Kirk Scott. The pitohui, a poisonous bird of New Guinea.
Template Methods Ordering What We Do. Example - Solitaire Initialization of many solitaire games follow this pattern: Shuffle the cards Layout the game.
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
N. HARIKA Lecturer(csc). 3 General Structure Of A Java Program.
Example to motivate discussion We have two lists (of menu items) one implemented using ArrayList and another using Arrays. How does one work with these.
CS 210 Proxy Pattern Nov 16 th, RMI – A quick review A simple, easy to understand tutorial is located here:
Overview of Behavioral Patterns ©SoftMoore ConsultingSlide 1.
Maitrayee Mukerji. INPUT MEMORY PROCESS OUTPUT DATA INFO.
Design Pattern Introduction in Data Structures Purpose  Natural integration of patterns into data structures education Plan  Cover traditional topics.
Summary prepared by Kirk Scott
Generic Interfaces and Encapsulation, a Class in the Middle
OOP - Object Oriented Programming
Recursion Topic 5.
Lesson # 9 HP UCMDB 8.0 Essentials
Template Method Pattern Iterator Pattern
Lecture 5 of Computer Science II
Jump to: navigation, search Jump to: navigation, search
Summary prepared by Kirk Scott
Design Patterns in Java Chapter 23 Strategy
Chapter 10 Design Patterns.
Common Design Patterns
Object-Oriented Programming
Introduction to Design Patterns
Unit 11 Generic Interfaces and Encapsulation, Continued
Arrays in PHP are quite versatile
C++ Standard Library.
More Interfaces, Dynamic Binding, and Polymorphism
Control Statements Lecture 6 from Chapter 5.
Chapter 17 Abstract Factory
Java Interfaces: Using an Interface to Accomplish a Specific Goal
Food and Beverage Service
Characteristics of documents
Object-Oriented Programming
The Object-Oriented Thought Process Chapter 12
Uses of Enzymes in Industry
Chapter 12 Collections.
Summary report – template for capturing focus group feedback Tool 13
Object Oriented Design Patterns - Behavioral Patterns
Winter 2018 CISC101 12/2/2018 CISC101 Reminders
Chapter 5 Ordered List.
CHAPTER 8: USING OBJECTS
DESIGN PATTERNS : Strategy Pattern
Groups: Part 1.
Programming Languages
Chapter 12 Collections.
CS2013 Lecture 7 John Hurley Cal State LA.
Information Hiding and Encapsulation Section 4.2
Java Generics & Iterators
Presentation transcript:

Java Interfaces: Using an Interface to Accomplish a Specific Goal Kirk Scott

Barley From Wikipedia, the free encyclopedia Jump to: navigation, search For other uses, see Barley (disambiguation).

Barley (Hordeum vulgare L Barley (Hordeum vulgare L.), a member of the grass family, is a major cereal grain. Important uses include use as animal fodder, as a source of fermentable material for beer and certain distilled beverages, and as a component of various health foods. It is used in soups and stews, and in barley bread of various cultures. Barley grains are commonly made into malt in a traditional and ancient method of preparation.

This is an introductory unit. These are the units/chapters belonging to this section of the course: Iterator, book chapter 28 Template, book chapter 21 Strategy, book chapter 23

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 make use of an interface to accomplish their goal Iterator and Template both show how to make use of characteristics of the Java API

Iterator Book definition: The intent of the Iterator pattern is to provide a way to access the elements of a collection sequentially Comment mode on: Large parts of this should already be implicitly clear if you understood for each loops You will see that this pattern is used by the Java API in dealing with collection classes

Template Book definition: The intent of the Template pattern is to implement an algorithm in a method, deferring the definition of some steps of the algorithm so that other classes can redefine them. Comment mode on: You will see that the template pattern is used in the Java API to support the ordering and sorting of objects in collection classes

Strategy Book definition: The intent of Strategy is to encapsulate alternative approaches, or strategies, in separate classes that each implement a common operation. Comment mode on: This pattern is actually quite simple You can have multiple classes implementing the same interface—and thus the same method The implementations of the methods may differ in the classes

In Summary and Mnemonic Devices: Iterator: Remember Java collections Template: Remember Java sorting Strategy: Remember multiple classes implementing the same interface

The End