Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11.

Slides:



Advertisements
Similar presentations
Introduction to Visual Basic.NET Uploaded By: M.Sheraz anjum.
Advertisements

Visual Basic: An Object Oriented Approach 2 – Designing Software Systems.
OBJECT ORIENTED PROGRAMMING M Taimoor Khan
Windows Programming 1 Part 1 dbg --- Getting Acquainted with Visual Studio.NET and C#
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
Object Oriented System Development with VB .NET
1 Basic Object Oriented Concepts Overview l What is Object-Orientation about? l What is an Object? l What is a Class? l Constructing Objects from Classes.
ASP.NET Programming with C# and SQL Server First Edition
Chapter 13: Object-Oriented Programming
Chapter 1 Program Design
Chapter 14: Event-Driven Programming with Graphical User Interfaces
Introduction to Object Oriented Design Lecture 11.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Object Oriented Programming
Microsoft Visual Basic 2005 CHAPTER 1 Introduction to Visual Basic 2005 Programming.
Object Oriented Software Development
Introduction to Object Oriented Design. Topics Designing Your Own Classes Attributes and Behaviors Class Diagrams.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Chapter 12 Object-Oriented.
1 A Student Guide to Object- Orientated Systems Chapter 4 Objects and Classes: the basic concepts.
OBJECT AND CLASES: THE BASIC CONCEPTS Pertemuan 8 Matakuliah: Konsep object-oriented Tahun: 2009.
An Object-Oriented Approach to Programming Logic and Design
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
Week 4 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
Introduction To System Analysis and Design
An Introduction to Java Chapter 11 Object-Oriented Application Development: Part I.
JavaScript, Fourth Edition
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Object-Oriented Programming in C++
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Chapter 7 Objects and Classes 1 Fall 2012 CS2302: Programming Principles.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Systems Analysis and Design in a Changing World, 3rd Edition
1 Object-oriented design requires that we interact with a problem in much the same way that we interact with our world – we treat it as a set of separate.
Week 4 Introduction to Computer Science and Object-Oriented Programming COMP 111 George Basham.
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.
An Object-Oriented Approach to Programming Logic and Design Chapter 3 Using Methods and Parameters.
Chapter 4 Introduction to Classes, Objects, Methods and strings
Chapter 12 Object-oriented design for more than one class.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Programming Paradigms Different paradigms Procedural paradigm, e.g. Pascal Basic Functional paradigm, e.g. Lisp Declarative paradigm, e.g. Prolog Object-Oriented.
Chapter 11 An introduction to object-oriented design.
Next Back MAP MAP F-1 Management Information Systems for the Information Age Second Canadian Edition Copyright 2004 The McGraw-Hill Companies, Inc. All.
Object Oriented Programming. OOP  The fundamental idea behind object-oriented programming is:  The real world consists of objects. Computer programs.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Basic Characteristics of Object-Oriented Systems
Chapter 11 An introduction to object-oriented design.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Programming Logic and Design Seventh Edition
The Movement To Objects
Chapter 1: An Introduction to Visual Basic 2015
Object-Oriented Analysis and Design
Chapter 4: Writing Classes
Computer Programming.
VISUAL BASIC.
Encapsulation & Visibility Modifiers
Ch 4: Writing Classes Java Software Solutions Foundations of Program Design Sixth Edition by Lewis & Loftus Coming up: Classes and Objects.
Object-oriented design for multiple classes
CIS16 Application Development Programming with Visual Basic
Advanced Programming Behnam Hatami Fall 2017.
Basic OOP Concepts and Terms
Introduction to Computer Science and Object-Oriented Programming
Presentation transcript:

Object-Oriented Design Simple Program Design Third Edition A Step-by-Step Approach 11

Objectives To introduce object-oriented design To define objects, classes, attributes, methods and information hiding To list the steps required to create an object-oriented design to a problem 11

Introduction to Object-Oriented Design Object-oriented design asks that we interact with the problem in much the same way that we interact with our world — we treat it as a set of separate objects that perform actions and relate to each other An object-oriented program is a set of interacting objects rather than a set of functions In object-oriented design you need to identify the data in the objects as well as the processes or actions that can be performed on that data Objects are said to encapsulate their data, and the processes that act on those data 11

Objects An object can be considered as a container for a set of data, and the operations that need to be performed on it An object has the following properties: –It has a name that is unique for the lifetime of the object –It has data in the form of a set of characteristics or attributes, each of which has a value at any given point in time –There is a set of operations or methods that can be performed on the data –It is an instance (example) of a class In a computer program an object’s attributes are the properties or characteristics that describe it 11

Methods Objects receive messages from other objects, asking them to perform services or operations Each object has a number of methods or set of operations, sometimes called procedures or functions Methods can manipulate the values stored in an object’s attributes, but can only act on the data inside the object or on values passed to the object 11

Classes and Objects An object is created from a template or pattern, called a class, which defines the basic attributes and the methods available to objects of that class The process of creating objects from classes is called instantiation, and an object is described as an instance, or example of its class 11

Constructors The process of instantiating an object from the class template is performed by a special method known as a constructor Every class should have a default constructor that initializes the class attributes The constructor may: –have no parameters –have parameters that initialize the attributes with those particular values Classes can be progressively created from other classes by copying attributes and methods from the base classes 11

Constructors In a banking program, an Account class is created to manage customer accounts The class Account includes attributes such as accountName and balance, as well as methods such as deposit and withdraw money (refer to the diagram on page 177 of the textbook) Every ChequeAccount object that is created by the program, contains all the properties and methods of the Account class as well as the extra features of the ChequeAccount class 11

Information Hiding In object-oriented design, each object can be regarded as a ‘black box’ whose internal workings are hidden from all other objects This principle of information hiding simplifies the use of objects, because the rest of the system does not need to know how they are structured or how they perform their operations The goal of information hiding is to make the object as robust and independent as possible 11

Public and Private Methods An object’s methods, or set of operations, can be public or private The public methods of an object are those producing services requested by other objects Objects must be able to communicate and interact with the rest of the program, and this communication is achieved by the passing of messages 11

Steps in Creating an Object- Oriented Solution The steps in creating an OO solution are: –Identify the objects and the methods to be performed –Determine the relationship between the objects –Design the algorithms for the methods, using structured design –Develop the mainline algorithm 11

Programming Example Using Object-Oriented Design Example 11.2 Print student results Design a class to manage student results in a subject. Each student is identified by a unique student number. During the course of the subject, each student completes three assignments representing 40% of the final mark but each scored out of 100, and an examination, also scored out of 100 marks Use the four steps referred to in the textbook on pages 184 to the top of 187 to do this 11

Interface and GUI Objects An interface is a device in a program that connects the user’s responses to the computer’s actions Many popular programming languages provide a graphical user interface (GUI), which enables the programmer to select the elements of the program’s user interface from a pre-existing range of options These languages are call ‘visual’ languages, and include Visual Basic, Visual C, and Visual J Java also shares these features The user interface options may include windows, buttons, menus, boxes to hold text, drop-down lists and many more 11

Example 11.3 Library locater interface Use this example as a guide, on pages 187 to the middle of page 189 of the textbook Also refer to the diagrams on pages 188 and 189 of the textbook 11

Summary Object-oriented design is a fundamentally different process to procedural design Instead of decomposing the problem into functions, the problem is broken up into the objects in the system, and the attributes and methods for each object are identified Objects encapsulate their data and methods, and can be regarded as ‘black boxes’ for the purposes of large system design 11

Summary Objects are instantiated from classes that are templates defining the attributes and methods for objects of the type, but individual objects of the same type may store different data values in their attributes Interface design for visual programming languages uses object-oriented design principles Interface objects have methods and attributes 11