SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1.

Slides:



Advertisements
Similar presentations
1 OBJECT-ORIENTED CONCEPTS. 2 What is an object?  An object is a software entity that mirrors the real world in some way.  A software object in OOP.
Advertisements

Computer Science Dept. Fall 2003 Object models Object models describe the system in terms of object classes An object class is an abstraction over a set.
Object-Oriented Analysis and Design CHAPTERS 15: UML INTERACTION DIAGRAMS 1.
CIT731: Database Development Object Oriented Modeling (OOM)
History of Object Orientation. What is Object-Orientation? Programming is one of the most complicated and difficult of human activities. It helps a great.
Object-Oriented Analysis and Design
Department of Informatics, UC Irvine SDCL Collaboration Laboratory Software Design and sdcl.ics.uci.edu 1 Informatics 43 Introduction to Software Engineering.
Introduction To System Analysis and Design
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Object Oriented System Development with VB .NET
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
Basic OOP Concepts and Terms
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
Fall 2005CSE 115/503 Introduction to Computer Science I1 Lecture #4 Agenda Announcements Review Questions? Classes and objects UML class diagrams Creating.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development.
NJIT 1 Domain Model Visualizing Concepts Chapter 9 Applying UML and Patterns Craig Larman.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Lecture 1 Introduction to Computers and Object-
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1 Introduction to Object-Oriented Programming.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Object Oriented Programming
1 INTRODUCTION TO OOP Objective: Know the difference between functional programming and OOP Know basic terminology in OOP Know the importance of OOP Know.
Introduction To System Analysis and design
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 1: Introduction to Object-Oriented Programming.
11 1 Object oriented DB (not in book) Database Systems: Design, Implementation, & Management, 6 th Edition, Rob & Coronel Learning objectives: What.
BCS 2143 Introduction to Object Oriented and Software Development.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
Unified Modeling Language, Version 2.0
1. 2 Object-Oriented Concept Class & Object Object-Oriented Characteristics How does it work? Relationships Between Classes Development Tools Advantage.
Sadegh Aliakbary. Copyright ©2014 JAVACUP.IRJAVACUP.IR All rights reserved. Redistribution of JAVACUP contents is not prohibited if JAVACUP.
Chapter 6: Structured Vs. Object Oriented Analysis and Design.
Introduction To System Analysis and Design
Object-Oriented Analysis and Design An Introduction.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
1 ISA&D7‏/8‏/ ISA&D7‏/8‏/2013 Methodologies of the SDLC Traditional Approach to SDLC Object-Oriented Approach to SDLC CASE Tools.
Introduction to UML: Unified Modeling Language Ric Holt U Waterloo, March 2009 CS246.
SNPL1 Woochang Lim What (Variable) + How (Function) = Object Objects are the physical and conceptual things we find in the universe around us. Object-Oriented.
Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
Fall 2010 CS4310 Requirements Engineering A Brief Review of UML & OO Dr. Guoqiang Hu Department of Computer Science UTEP 1.
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.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
The Unified Modeling Language Part II Omar Meqdadi SE 2730 Lecture 9 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
1/26 On-demand Learning Series Software Engineering of Web Application - Object-Oriented Development & UML Hunan University, Software School.
SE-1010 Dr. Mark L. Hornick 1 Java Programming Basics.
© 2000 McGraw-Hill Modified by C.W.Pang with author's permission Intro to OOP with Java--Wu Chapter Chapter 1 Introduction to Object-oriented Programming.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
OBJECT ORIENTED AND FUNCTION ORIENTED DESIGN 1 Chapter 6.
Salman Marvasti Sharif University of Technology Winter 2015.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
What is this? SE-2030 Dr. Mark L. Hornick 1. Same images with different levels of detail SE-2030 Dr. Mark L. Hornick 2.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
بسم الله الرحمن الرحيم CPCS203: Programming II. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display., Modifications by Dr.
Chapter 0: Introduction
The Movement To Objects
Objects as a programming concept
Chapter 5: Object Oriented Analysis and Design
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Model-View-Controller
Basic OOP Concepts and Terms
Presentation transcript:

SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1

SE-1010 Dr. Mark L. Hornick 2 Objectives Name the basic components of object-oriented programming. Differentiate classes and objects. Define class methods and attributes. Draw UML diagrams for classes and objects.

SE-1010 Dr. Mark L. Hornick 3 OOP is about classes and objects These are two very basic concepts in OOP …but what are they? Java is an OOP language

SE-1010 Dr. Mark L. Hornick 4 Alan Kay, who was instrumental in the creation of the first Apple Macintosh, was also the creator of the first OOP language called Smalltalk. He defined OOP as follows:

SE-1010 Dr. Mark L. Hornick 5 1. Everything is an object An object is a thing, both tangible… Objects often represent physical entities

SE-1010 Dr. Mark L. Hornick 6 1. Everything is an object … and intangible, like Time Date Bank Account Grocery List Or, objects can just represent ideas or concepts

SE-1010 Dr. Mark L. Hornick 7 2. Every object has a type of class Classes are more difficult to describe: A Class is an abstraction (a blueprint, or template) that defines the attributes and behavior of Objects that belong to the Class Objects assume the characteristics of a class We say an Object is an Instance of a Class, kind of how a cake is an instance of a recipe for a cake. We can also say that a Class Instance is an Object.

SE-1010 Dr. Mark L. Hornick 8 3. An object is comprised of attributes and methods defined by its class attributes are data that define an object’s properties Each object has its own variables where it can store the values of its attributes methods are behaviors Methods are executed when an object receives a message to execute it. Methods often manipulate attributes Alan Kay’s OOP definitions, continued

SE-1010 Dr. Mark L. Hornick 9 Exercise 1 List some attributes and behaviors for a BankAccount class Pretend it’s used within the software of an ATM machine (or within a personal finance app) What does it represent? What can it do? What are its properties?

SE-1010 Dr. Mark L. Hornick 10 Exercise 2 List some attributes and behaviors for a Printer class What does a printer do? What properties does it have?

SE-1010 Dr. Mark L. Hornick 11 Unified Modeling Language (UML) A notation for objects and classes. Can be applied to any OOP language (not just Java). UML class diagram

SE-1010 Dr. Mark L. Hornick 12 We’re not done with Alan Kay’s definitions yet…

SE-1010 Dr. Mark L. Hornick Object-oriented programs use objects An object-oriented program is a bunch of objects telling each other what to do by sending and receiving messages to and from one another A message instructs an object to execute one of it’s methods Alan Kay’s OOP definitions, continued

SE-1010 Dr. Mark L. Hornick 14 The Relationship between Messages and Methods To instruct an object to do something, we “send a message” to it. You can send a message only to the objects that understand the message you send to them. In Java (and other OO languages like C++, C#, or VB), messages are sent by calling a method defined within the object’s class we also say “execute a method” or “invoke a method” and sometimes we use “function” instead of “method” We don’t usually send messages to classes, although there are exceptions we’ll learn about later

SE-1010 Dr. Mark L. Hornick 15 UML again A UML Sequence Diagram illustrating messages being sent to an instance of a class. hp1:Printer purge The message purge The object’s name hp1 The object’s class Printer print(“report.txt”)

SE-1010 Dr. Mark L. Hornick 16 Passing values in messages A value we pass to an object when sending a message is called an argument of the message. hp1:Printer The message print with the argument “report.txt” The object’s name hp1 The object’s class Printer print(“report.txt”)

SE-1010 Dr. Mark L. Hornick 17 Two-way communication Many times, a method will return a message back to the sender. hp11:Plotter getPaperLevel() The method The object’s name The object’s class No argument 27 The return value

SE-1010 Dr. Mark L. Hornick 18 Many arguments can be sent in an originating message, but only one return value can be sent back hp11:Plotter setFont(“Arial”, “italic”) The method The object’s name The object’s class Two arguments “ok” The return value

SE-1010 Dr. Mark L. Hornick 19 Object-oriented programming The object-oriented (OO) approach provides tools for the programmer to represent elements in the problem, or domain space Elements in the problem space, and their representation in the solution space, are referred to as “objects” OO allows a programmer to define a class (the type of an object) to fit the problem, rather than being forced into existing data types representing units of storage in a machine Object-orientation allows you to describe the problem in terms of the problem, rather than in terms of the solution