Object-Oriented Design Justin Callanan CS 597. Object-Oriented Basics ● Data is stored and processed in “objects” ● Objects represent generalized real.

Slides:



Advertisements
Similar presentations
OOP Abstraction Classes Class Members: Properties & Methods Instance (object) Encapsulation Interfaces Inheritance Composition Polymorphism Using Inheritance.
Advertisements

Module 8 “Polymorphism and Inheritance”. Outline Understanding Inheritance Inheritance Diagrams Constructors in Derived Classes Type Compatibility Polymorphism.
Copyright © 2012 Pearson Education, Inc. Chapter 4 Inheritance and Polymorphism.
1 Chapter 6: Extending classes and Inheritance. 2 Basics of Inheritance One of the basic objectives of Inheritance is code reuse If you want to extend.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
Objectives Introduction to Inheritance and Composition (Subclasses and SuperClasses) Overriding (and extending), and inheriting methods and constructors.
Section 5 – Classes. Object-Oriented Language Features Abstraction –Abstract or identify the objects involved in the problem Encapsulation –Packaging.
CS 106 Introduction to Computer Science I 11 / 26 / 2007 Instructor: Michael Eckmann.
2-1 © Prentice Hall, 2007 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
CS 106 Introduction to Computer Science I 11 / 28 / 2007 Instructor: Michael Eckmann.
Chapter 14 (Web): Object-Oriented Data Modeling
CS 106 Introduction to Computer Science I 11 / 15 / 2006 Instructor: Michael Eckmann.
8.1 Classes & Inheritance Inheritance Objects are created to model ‘things’ Sometimes, ‘things’ may be different, but still have many attributes.
Object Oriented Concepts. Movement toward Objects Instead of data-oriented or process-oriented Analysis, many firms are now moving to object-oriented.
Object-Oriented Application Development Using VB.NET 1 Chapter 8 Understanding Inheritance and Interfaces.
Chapter 7 - Generalization/Specialization and Inheritance1 Chapter 7 Generalization/Specialization and Inheritance.
Chapter 14: Object-Oriented Data Modeling
Classes in C++ Bryce Boe 2012/08/15 CS32, Summer 2012 B.
Inheritance using Java
OBJECT ORIENTED PROGRAMMING CONCEPTS ISC 560. Object-oriented Concepts  Objects – things names with nouns  Classes – classifications (groups) of similar.
Introduction to Object Oriented Programming. Object Oriented Programming Technique used to develop programs revolving around the real world entities In.
Database Management System Prepared by Dr. Ahmed El-Ragal Reviewed & Presented By Mr. Mahmoud Rafeek Alfarra College Of Science & Technology Khan younis.
1. 2 Object-Oriented Concept Class & Object Object-Oriented Characteristics How does it work? Relationships Between Classes Development Tools Advantage.
Specialization and Inheritance Chapter 8. 8 Specialization Specialized classes inherit the properties and methods of the parent or base class. A dog is.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
© S Ramakrishnan, Monash University oops1.ppt 1 Object-Oriented Programming Systems SFT3021 Semester Lecturer: Sita Ramakrishnan
CS200 Algorithms and Data StructuresColorado State University Part 4. Advanced Java Topics Instructor: Sangmi Pallickara
Object-Oriented Software Development F Software Development Process F Analyze Relationships Among Objects F Class Development F Class Design Guidelines.
CHAPTER 13 (ONLINE): OBJECT-ORIENTED DATA MODELING © 2013 Pearson Education, Inc. Publishing as Prentice Hall 1 Modern Database Management 11 th Edition.
© 2011 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 13 (Online): Object-Oriented Data Modeling Modern Database Management 10 th Edition.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
Basic OOP Concepts and Terms. In this class, we will cover: Objects and examples of different object types Classes and how they relate to objects Object.
Object-Oriented Data Modeling
Inheritance (Part 4) Polymorphism and Abstract Classes 1.
Microsoft Visual Basic 2008 CHAPTER ELEVEN Multiple Classes and Inheritance.
Review Class Inheritance, Abstract, Interfaces, Polymorphism, GUI (MVC)
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
Object-Oriented Programming Chapter Chapter
Addison Wesley is an imprint of © 2010 Pearson Addison-Wesley. All rights reserved. Chapter 12 Object-Oriented Programming Starting Out with Games & Graphics.
Object Oriented Programming
Chapter 10: Introduction to Inheritance. Objectives Learn about the concept of inheritance Extend classes Override superclass methods Call constructors.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
ISBN Object-Oriented Programming Chapter Chapter
CS 106 Introduction to Computer Science I 04 / 18 / 2008 Instructor: Michael Eckmann.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph S. Valacich, Jeffrey A.
Object-Oriented Principals Dwight Deugo Nesa Matic
Basic Concepts of OOP.  Object-Oriented Programming (OOP) is a type of programming added to php5 that makes building complex, modular and reusable web.
Object-Oriented Programming: Inheritance and Polymorphism.
Inheritance in C++ Bryce Boe 2012/08/28 CS32, Summer 2012 B.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
POLYMORPHISM Chapter 6. Chapter Polymorphism  Polymorphism concept  Abstract classes and methods  Method overriding  Concrete sub classes and.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
Object means a real word entity such as pen, chair, table etc. Object-Oriented Programming is a methodology or paradigm to design a program using classes.
Classes CS 162 (Summer 2009). Parts of a Class Instance Fields Methods.
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Java Programming Fifth Edition Chapter 9 Introduction to Inheritance.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
OOP: Encapsulation &Abstraction
Object-Oriented Modeling
JAVA By Waqas.
Objects as a programming concept
Python First Edition STARTING OUT WITH Chapter 10 Inheritance
Encapsulation Inheritance PolyMorhpism
Workshop for Programming And Systems Management Teachers
Programming For Big Data
Chapter 11 Inheritance and Encapsulation and Polymorphism
The Object Paradigm Classes – Templates for creating objects
Presentation transcript:

Object-Oriented Design Justin Callanan CS 597

Object-Oriented Basics ● Data is stored and processed in “objects” ● Objects represent generalized real world things ● Objects have attributes and behaviors ● Attributes describe the object ● Behaviors change or act on attributes

Using Objects as Representations ● Objects typically correspond to real world entities ● Examples: – Dog object, with: ● An attribute for its breed ● A behavior called “bark” – Cat object, with: ● An attribute for its color ● A behavior called “meow”

Classes and Objects ● Classes serve as the blueprint for objects ● This blueprint is used to create instances ● Each instance of an object has its own data ● All data for an object is stored within it ● Example: – Instance of the Cat object, with the color “grey” – Instance of the Cat object, with the color “orange”

Generalizing and Specializing ● Objects range from abstract to specific ● Classes can be derived from one another ● Derived classes are always more specific ● Derived classes are called “subclasses” or “child classes” ● Subclasses are derived from a “superclass,” or “parent class” ● Example: – Animal superclass – Dog & Cat subclasses derived from Animal

Inheritance ● Subclasses “inherit” attributes and behaviors from superclasses ● Subclasses can have additional attributes and behaviors ● Inherited behaviors are identical unless “overridden” ● Overriding behaviors replaces their internal logic ● Example: – Animal superclass with attribute “weight” and behavior “speak” – Cat subclass with overridden “speak” behavior – Dog subclass with overridden “speak” behavior

Polymorphism ● Polymorphism is the ability to use subclasses in place of their superclass ● Example: – A piece of code uses Animal’s “speak” behavior – The code is given a Cat or Dog object – The code runs, using Cat’s or Dog’s “speak” behavior

Encapsulation ● Classes contain all data associated with an object ● Data is kept hidden from outside entities ● Object data is retrieved through “accessor” behaviors (“getters”) ● Object data is changed through “mutator” behaviors (“setters”) ● Accessors and mutators can contain unique internal logic

Abstraction ● Abstract classes can be used as superclasses ● Abstract classes cannot be used to create objects ● They serve only as a consistent reference point ● They can have incomplete implementations ● Code can be written generically with abstract classes ● Example: – Abstract Animal superclass – Non-abstract Cat and Dog subclasses (derived from Animal)

Other important points ● Objects can contain other objects ● Objects can interact with one another ● Not all object data is hidden ● Behaviors can accept input, provide output, do both, or neither