Object-oriented programming concepts An Introduction.

Slides:



Advertisements
Similar presentations
Introduction to Object Orientation System Analysis and Design
Advertisements

Design by Contract.
Solutions to Review Questions. 4.1 Define object, class and instance. The UML Glossary gives these definitions: Object: an instance of a class. Class:
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
Object-Oriented Analysis and Design
Chapter 1 Object-Oriented System Development
1 Software Testing and Quality Assurance Lecture 12 - The Testing Perspective (Chapter 2, A Practical Guide to Testing Object-Oriented Software)
Introduction to Computers and Java Recitation - 01/11/2008 CS 180 Department of Computer Science, Purdue University.
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.
©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.
Unit 211 Requirements Phase The objective of this section is to introduce software system requirements and to explain different ways of expressing these.
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.
Aalborg Media Lab 21-Jun-15 Software Design Lecture 1 “ Introduction to Java and OOP”
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.
©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.
Introduction To System Analysis and design
Java Programming, 2E Introductory Concepts and Techniques Chapter 1 An Introduction to Java and Program Design.
Chapter 1 Introduction.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
From Problem Statement to Design
CS 106 Introduction to Computer Science I 04 / 13 / 2007 Friday the 13 th Instructor: Michael Eckmann.
©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.
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
1 CS 456 Software Engineering. 2 Contents 3 Chapter 1: Introduction.
Satzinger Chp. 2 Part Part 4 of 4 2 Object-Oriented Analysis and Design with the Unified Process Testing Testing is critical discipline Testing activities.
Chapter 1 What is Programming? Lecture Slides to Accompany An Introduction to Computer Science Using Java (2nd Edition) by S.N. Kamin, D. Mickunas, E.
SE-1010 Dr. Mark L. Hornick 1 Introduction to Object-Oriented Programming (OOP) Part 1.
Introduction to Java August 14, 2008 Mrs. C. Furman.
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
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.
© 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 Programming •Object-Oriented Programming (OOP) allows you to create your program based upon modeling objects.  Your program’s properties.
CS451 - Lecture 2 1 CS451 Lecture 2: Introduction to Object Orientation Yugi Lee STB #555 (816) * Acknowledgement:
 Objects versus Class  Three main concepts of OOP ◦ Encapsulation ◦ Inheritance ◦ Polymorphism  Method ◦ Parameterized ◦ Value-Returning.
Object-Oriented Programming © 2013 Goodrich, Tamassia, Goldwasser1Object-Oriented Programming.
1 Software Engineering Lecture 15 Object Oriented Software Design in Java.
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,
Object orientation and Packaging in Java Object Orientation and Packaging Introduction: After completing this chapter, you will be able to identify.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 1 Introduction to Object-Oriented Programming and.
OBJECT-ORIENTED TESTING. TESTING OOA AND OOD MODELS Analysis and design models cannot be tested in the conventional sense. However, formal technical reviews.
Chapter 11 Inheritance © 2008 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved. Marilyn Bohl/Maria Rynn Tools for Structured and Object-Oriented.
CHAPTER 6 OBJECT ANALYSIS.
بسم الله الرحمن الرحيم CPCS203: Programming II. ©The McGraw-Hill Companies, Inc. Permission required for reproduction or display., Modifications by Dr.
Introduction to Computers and Programming Languages CS 180 Department of Computer Science Purdue University.
JAVA By Waqas.
Lecture 1 Introduction Richard Gesick.
Sections Basic Concepts of Programming
Introduction to Object-Oriented Programming
Introduction to OOP with Java 4th Ed, C. Thomas Wu
Week 6 Object-Oriented Programming (2): Polymorphism
Workshop for Programming And Systems Management Teachers
Basic OOP Concepts and Terms
Intro to OOP with Java, C. Thomas Wu
Presentation transcript:

Object-oriented programming concepts An Introduction

Programs & Objects Program consists of a set of interacting objects Object comprised of data & its associated operations; represents some tangible or intangible concept in program’s problem domain Examples: oBank account oRobot oSong

Classes Class: defines characteristics of an object to be created oDictates what object can & cannot do oObject is instance of class oCan create many instances of a class To accomplish tasks in a program, we tap into capabilities and characteristics of objects & classes Classes and objects have two different kinds of members: methods and data

Messages and Methods Message: a single program instruction that requests a particular task to be performed; calls on a class or object to execute a method Method: the set of instructions that will be performed in response to a message; the implementation of an algorithm

Method types oClass method: a method that can be requested from a class oUsually pertains to some characteristic that is common to all instances of a class oExamples: oset minimum balance for all bank accounts oset maximum speed of a robot

Method types oInstance method: a method that can be requested from an instance of a class (object) oexamples: withdraw money from your account, deposit money in my account; tell my robot to go forward, tell your robot to turn left

Arguments oArgument: a data value we pass along with a message oSupplies the method with the raw material we need it to process oExamples: oamount of money to set for minimum balance oamount to be withdrawn or deposited odistance for robot to travel oangle of turn ovolume at which to play song

Data members Data members: information held/manipulated by an object or class Class definition lists the types of data values each of its instances can contain; can be: oConstant: a data value that is set at its definition and cannot be changed during the run of a program (example: the pitch frequency of a particular musical note) oVariable: a data value that may or may not be set at definition, but which may be changed (account balance, robot speed)

Data members oClass data value: single value shared by all instances of class (minimum balance, maximum speed) Instance data value: unique value held by particular object (my account balance, your robot’s current location, the length of a song)

Inheritance Inheritance: mechanism that allows classes that share common characteristics to be defined as extensions of another class Superclass: class that contains definitions of common characteristics; also called parent class Subclass: class that is derived from a superclass; contains specialized characteristics; also called child class

Inheritance Child classes inherit common characteristics from parent classes, but differ from each other in some specialized way; examples: oAll bank accounts have a balance, but a savings account may pay interest whereas a checking account may not oAll songs contain a set of notes, but we can differentiate purely instrumental songs from songs with lyrics An inheritance hierarchy can be created in which a subclass becomes a superclass for other subclasses

Software life cycle Software life cycle: sequence of stages from conception to working program (and beyond); stages include: –Analysis –Design –Coding –Operation/Maintenance

Software life cycle Analysis: feasibility study to see if problem is solvable; result is requirements specification that describes program features in a verifiable form Design: turn requirements specification into a set of classes that fulfill the requirements Coding: implement design by writing a program (in Java or some other programming language) – a.k.a. implementation phase

Sub-stages of implementation oTesting: run program with sample data to verify its compliance with specification (correctness) oDebugging: elimination of programming errors found through program testing oTypes of errors: oSyntax: prevent program from compiling; violation of programming language rules oSemantic: program compiles and runs, but produces incorrect results

Operation/Maintenance Phase In the real world, this is the longest phase Program is put into production; changes may be required over time An important goal of programming is to write code that not only works, but is easily maintained

Software Engineering Software Engineering: application of systematic & disciplined approach to all phases of software life cycle Goal is robust software