©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 - 1 Chapter 1 Introduction to Object-Oriented Programming and.

Slides:



Advertisements
Similar presentations
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.
Advertisements

BITS Pilani Avinash Gautam Department of Computer Science and Information Systems.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall A.1.
Systems Analysis and Design 8th Edition
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 4 Defining Your Own Classes.
Object-Oriented Analysis and Design
7M701 1 Software Engineering Object-oriented Design Sommerville, Ian (2001) Software Engineering, 6 th edition: Chapter 12 )
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Chapter 4 Defining Your Own Classes.
1 SWE Introduction to Software Engineering Lecture 23 – Architectural Design (Chapter 13)
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Development Software Life Cycle UML Diagrams.
What is an object? Your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior;
©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.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Polymorphism.
©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. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
Java Programming, 3e Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Object-oriented programming concepts An Introduction.
©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.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 1 Introduction to Object-Oriented Programming and Software Development.
© Copyright Eliyahu Brutman Programming Techniques Course.
Copyright 2004 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Second Edition Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Lecture 1 Introduction to Computers and Object-
6. 2Object-Oriented Analysis and Design with the Unified Process Objectives  Explain how events can be used to identify use cases that define requirements.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Abstract Superclasses and Abstract Methods When.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter N - 1 Chapter 13 Polymorphism is-a relationships Interfaces.
©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.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 4 th Ed Chapter Software Engineering Software Development Process.
CSC241: Object Oriented Programming
Unified Modeling Language
Introduction To System Analysis and design
Lecture 1 Introduction to Java MIT- AITI 2004 What is a Computer Program? For a computer to be able to do anything (multiply, play a song, run a word.
Practical Object-Oriented Design with UML 2e Slide 1/1 ©The McGraw-Hill Companies, 2004 PRACTICAL OBJECT-ORIENTED DESIGN WITH UML 2e Chapter 2: Modelling.
©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.
BCS 2143 Introduction to Object Oriented and Software Development.
Object Oriented Programming Concepts Fatih University Ceng-104-A Introduction to Object Oriented Programming Harun Reşit Zafer This is a slide version.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
CHAPTER ONE Problem Solving and the Object- Oriented Paradigm.
SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1.
Copyright 2001 Prentice-Hall, Inc. Essentials of Systems Analysis and Design Joseph S. Valacich Joey F. George Jeffrey A. Hoffer Appendix A Object-Oriented.
Lecture 1 Introduction to Java MIT-AITI Ethiopia 2004.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
Object-oriented programming concepts An Introduction.
Systems Analysis & Design 7 th Edition Chapter 5.
Systems Analysis and Design 8 th Edition Chapter 6 Object Modeling.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 14 Slide 1 Object-oriented Design.
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.
BCS 2143 Object Oriented Design Using UML. Objectives Objects Interactions Finding Classes Relationship Between Classes Attribute and Operation Class.
Object Oriented Programming Concepts. Object ► An object is a software bundle of related state and behavior. ► Software objects are often used to model.
Programs and Classes A program is made up from classes Classes may be grouped into packages A class has two parts static parts exist independently Non-static.
© 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.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Getting Started with Java: Object declaration and creation Primitive.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
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,
Next Back MAP MAP F-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All.
Copyright © 2009 Pearson Education, Inc. Publishing as Prentice Hall Appendix A Object-Oriented Analysis and Design A.1.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
CHAPTER 6 OBJECT ANALYSIS.
بسم الله الرحمن الرحيم CPCS203: Programming II. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display., Modifications by Dr.
2-1 © Prentice Hall, 2004 Chapter 2: Introduction to Object Orientation Object-Oriented Systems Analysis and Design Joey F. George, Dinesh Batra, Joseph.
Introduction to Computers and Programming Languages CS 180 Department of Computer Science Purdue University.
JAVA By Waqas.
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Basic OOP Concepts and Terms
Intro to OOP with Java, C. Thomas Wu
Presentation transcript:

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and Software Development

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Objectives After you have read and studied this chapter, you should be able to Name the basic components of object-oriented programming Differentiate classes and objects. Differentiate class and instance methods. Differentiate class and instance data values. Draw program diagrams using icons for classes and objects Describe significance of inheritance in object-oriented programs Name and explain the stages of the software lifecycle

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Classes and Objects Objects are key to understanding object-oriented technology. Real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: state and behavior. –Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). –Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes)

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Classes and Objects Observe the real-world objects, for each object that you see, ask yourself two questions: "What possible states can this object be in?" and "What possible behavior can this object perform?“ –Eg. your desktop lamp may have only two possible states (on and off) and two possible behaviors (turn on, turn off), but your desktop radio might have additional states (on, off, current volume, current station) and behavior (turn on, turn off, increase volume, decrease volume, seek, scan, and tune).

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Classes and Objects Object-oriented programs use objects. To create an object inside the computer program, we must provide a definition for objects—how they behave and what kinds of information they maintain —called a class. A class is the blueprint from which individual objects are created, and therefore contains the same components. An object is called an instance of a class.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Graphical Representation of a Class The notation we used here is based on the industry standard notation called UML, which stands for Unified Modeling Language. We use a rectangle to represent a class with its name appearing inside the rectangle. Example: Account Motorcycle

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Graphical Representation of an Object We use a rectangle to represent an object and place the underlined name of the object inside the rectangle. Example: SV198 This is an object named SV198.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter An Object with the Class Name : This notation indicates the class which the object is an instance. This tells an object SV198 is an instance of the BankAccount class. Example: SV198 : BankAccount

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Messages and Methods To instruct a class or an object to perform a task, we send a message to it. You can send a message only to the classes and objects that understand the message you sent to them. A class or an object must possess a matching method to be able to handle the received message. A method defined for a class is called a class method, and a method defined for an object is called an instance method. A value we pass to an object when sending a message is called an argument of the message.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Sending a Message deposit Message deposit with the argument is sent to a BankAccount object SV198. SV198 : BankAccount

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Sending a Message and Getting an Answer current balance getCurrentBalance() Ask for the current balance of this particular account. SV198 : BankAccount The current balance of SV198 is returned.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Calling a Class Method maximum speed MobileRobot getMaximumSpeed() Ask for the maximum possible speed for all MobileRobot objects is returned.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Class and Instance Data Values An object is comprised of data values and methods. An instance data value is used to maintain information specific to individual instances. For example, each BankAccount object maintains its balance. A class data value is used to maintain information shared by all instances or aggregate information about the instances. For example, minimum balance is the information shared by all Account objects, whereas the average balance of all BankAccount objects is an aggregate information.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter SV098 : BankAccountSV211 : BankAccountSV129 : BankAccount Sample Instance Data Value current balance All three BankAccount objects possess the same instance data value current balance. The actual dollar amounts are, of course, different.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Sample Class Data Value SV098 : BankAccountSV211 : BankAccountSV129 : BankAccount current balance BankAccount minimum balance There is one copy of minimum balance for the whole class and shared by all instances. This line is an instance-of relationship.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Object Icon with Class Data Value When the class icon is not shown, we include the class data value in the object icon itself. SV129 : BankAccount current balance minimum balance

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Inheritance Inheritance is a mechanism in OOP to design two or more entities that are different but share many common features. –Features common to all classes are defined in the superclass. –The classes that inherit common features from the superclass are called subclasses. We also call the superclass an ancestor and the subclass a descendant.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter A Sample Inheritance Here are the superclass Account and its subclasses Savings and Checking. Account Checking Savings

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Inheritance Hierarchy An example of inheritance hierarchy among different types of students. Student Graduate Undergrad Law Masters Doctoral Commuting Resident

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Software Engineering Much like building a skyscraper, we need a disciplined approach in developing complex software applications. Software engineering is the application of a systematic and disciplined approach to the development, testing, and maintenance of a program. In this class, we will learn how to apply sound software engineering principles when we develop sample programs.

©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Software Life Cycle The sequence of stages from conception to operation of a program is called software life cycle. Five stages are –Analysis –Design –Coding –Testing –Operation and Maintenance