OOPSLA ’04 Educator’s Symposium

Slides:



Advertisements
Similar presentations
AP Computer Science A – Healdsburg High School 1 Unit 3 - Classes and Objects - Example.
Advertisements

L3:CSC © Dr. Basheer M. Nasef Lecture #3 By Dr. Basheer M. Nasef.
Inheritance Lakshmish Ramaswamy. Example A Rectangle class with area method A Circle class with area method Array containing references to circles & rectangles.
C12, Polymorphism “many forms” (greek: poly = many, morphos = form)
Design Patterns for Marine Biology Simulation Dung “Zung” Nguyen Mathias Ricken Stephen Wong Rice University.
Lecture 17 Abstract classes Interfaces The Comparable interface Event listeners All in chapter 10: please read it.
R R R CSE870: Advanced Software Engineering: Frameworks (Cheng, Sp2003)1 Frameworks A Brief Introduction.
C++ Classes in Depth. Topics Designing Your Own Classes Attributes and Behaviors Writing Classes in C++ Creating and Using Objects.
Liang, Introduction to Programming with C++, Second Edition, (c) 2010 Pearson Education, Inc. All rights reserved Chapter 9 Objects and Classes.
Chapter 10: Inheritance and Polymorphism
Chapter 11: Inheritance and Polymorphism Java Programming: Program Design Including Data Structures Program Design Including Data Structures.
Advanced Java and Android Day 1 Object-Oriented Programming in Java Advanced Java and Android -- Day 11.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
OOP Languages: Java vs C++
Programming Languages and Paradigms Object-Oriented Programming.
Introduction to Programming with Java. Overview What are the tools we are using – What is Java? This is the language that you use to write your program.
Chapter 11 Inheritance and Composition. Chapter Objectives Learn about inheritance Learn about subclasses and superclasses Explore how to override the.
The Rectangle Method. Introduction Definite integral (High School material): A definite integral a ∫ b f(x) dx is the integral of a function f(x) with.
ISP666 MVC & Design Patterns. Outline Review Event Programming Model Model-View-Controller Revisit Simple Calculator Break Design Patterns Exercise.
Lab 6: Shapes & Picture Extended Ellipse & Rectangle Classes Stand-Alone GUI Applications.
Software Design 4.1 Tell, Don't Ask l Tell objects what you want them to do, do not ask questions about state, make a decision, then tell them what to.
Programming Languages and Paradigms Object-Oriented Programming.
Chapter 8. About the Midterm Exam.. Exam on March 12 Monday (Tentatively) Review on March 7 Wednesday Cover from Chapter 6 Grades will be out before spring.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 8 Objects and Classes.
SIMPLE PROBLEM SOLVING in Java: a Problem Set Framework Viera K. Proulx Richard Rasala Jason Jay Rodrigues CCSCNE 2002 Conference.
Copyright © 2012 Pearson Education, Inc. Chapter 13: Introduction to Classes.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Two Parts of Every ADT An abstract data type (ADT)  is a type for encapsulating related data  is abstract in the sense that it hides distracting implementation.
OOP in Introductory CS Stephen Wong and “Zung” Nguyen Rice University Better students though abstraction.
Outline §Review of the last class l class variables and methods l method overloading and overriding §Inheritance and polymorphism l polymorphism l abstract.
SWE 316: Software Design and Architecture Objectives Lecture # 18 Introduction to Components SWE 316: Software Design and Architecture To learn:  benefits.
Marine Biology Simulation Part II: Assignment, Milestone 1 Dung “Zung” Nguyen Mathias Ricken Stephen Wong TeachJava 2004! June 25, 2004.
Design Patterns for Marine Biology Simulation Dung “Zung” Nguyen Mathias Ricken Stephen Wong Rice University.
Nifty Assignments: Marine Biology Simulation OOPSLA ‘04 Educators’ Symposium October 25, 2004 Eric Cheng Mathias Ricken Dung “Zung” Nguyen Stephen Wong.
Programming Paradigms Lecturer Hamza Azeem. What is PP ? Revision of Programming concepts learned in CPLB Learning how to perform “Object-Oriented Programming”
IT108 Objects and Classes Part I George Mason University Revised 4/3/2012.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Objects and Classes.
Inheritance CSI 1101 Nour El Kadri. OOP  We have seen that object-oriented programming (OOP) helps organizing and maintaining large software systems.
Java Programming: From Problem Analysis to Program Design, 3e Chapter 11 Inheritance and Polymorphism.
Patterns for Decoupling Data Structures and Algorithms or How visitors can help you grow! Stephen Wong, Oberlin College Dung “Zung” Nguyen, Pepperdine.
Object-Oriented Programming (OOP) What we did was: (Procedural Programming) a logical procedure that takes input data, processes it, and produces output.
Module 9. Dealing with Generalization Course: Refactoring.
Copyright © 2012 Pearson Education, Inc. Chapter 10 Advanced Topics.
CSC 205 Programming II Lecture 4 Abstract Class. The abstract keyword indicate that a class is not instantiable Defining a type which will be specialized.
Basic Class Structure. Class vs. Object class - a template for building an object –defines the instance data that the object will hold –defines instance.
Liang, Introduction to C++ Programming, (c) 2007 Pearson Education, Inc. All rights reserved X 1 Chapter 9 Introduction of Object Oriented Programming.
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
Pointer to an Object Can define a pointer to an object:
Unit II-Chapter No. : 5- design Patterns
Inheritance ITI1121 Nour El Kadri.
Advanced Program Design with C++
Ch 10- Advanced Object-Oriented Programming Features
Introduction to Classes
Design Patterns for Self-Balancing Trees
Design Patterns for Self-Balancing Trees
CS 302 Week 10 Jim Williams.
Lab 1 Introduction to C++.
Introduction to Classes
Design Patterns for Self-Balancing Trees
Chapter 8 Objects and Classes Part 1
Nifty Assignments: Marine Biology Simulation
Marine Biology Simulation Part III: Assignment, Milestone 2
9: POLYMORPHISM Programming Technique II (SCSJ1023) Jumail Bin Taliba
Marine Biology Simulation Part II: Assignment, Milestone 1
Can you work out the next shape in the pattern?
Lecture 8 Object Oriented Programming (OOP)
CS 151: Object-Oriented Design October 8 Class Meeting
Computer Science II for Majors
Can you work out the next shape in the pattern?
Presentation transcript:

OOPSLA ’04 Educator’s Symposium Nifty Assignment: The Shape Calculator Fix the link; fix code to close the window w/o AFrame Demo (3) Make the font bigger Big buttons Triangle factory w/ 3 points – write code, compile at runtime, load Get students’ solutions (for each part) from last semester Explain the assignment Must have demo in binary with some shapes for student to work with Makes clear of the functionality requirements Break into 4 parts and 4 directories; grade one piece at a time Why is it so nifty? Eric Cheng, Dung Zung Nguyen, Mathias Ricken, Stephen Wong Rice University

Niftiness Swing GUI application with the MVC pattern. Closures via anonymous inner class Callback architecture Extensibility and security via factories Dynamic nature of OO programs Abstraction! Rice University

What is a shape? Rice University

What is a shape? Knows how to compute its area Knows how to present itself visually Rice University

How do we make a shape? Constructor for a rectangle: public Rect(double width, double height) Constructor for a circle: public Circle(double radius) … How to call a constructor if its parameters are unknown? Rice University

Factory design pattern Factories know how. Can specify a clear definition of a factory: we know how to make factories. Rice University

Behavioral definitions IShapeFactory JPanel getPropertyPanel() IShape makeShape() IShape double getArea() void paint(Graphics g, int x, int y) Move IShape next to “what’s a shape?” Pop up UML or code of the IShape interfrace Move IShapeFactory as well. Rice University

Behavioral definitions Interfaces define behaviors. A factory is a factory if it satisfies the protocols; a shape is a shape if it complies to our definition. No need to have explicit class definitions. Closures Can have not only area, but also colors! Dynamically load code at runtime Delete this. Rice University

Philosophical / Design Question Should the shape know about, or even have the factory? Rice University

GUI builders for IDEs Rely on zero-ary public constructors for components. Breaks encapsulation. Violates definition of the component (is a shape a factory?) Can possibly break the system by creating an “immature”, but perfectly legal shape. Rice University

Our goal The clear distinction and separation of responsibilities Each piece of component does what it is meant to do, and expose the appropriate amount of information Rice University

Questions? Rice University