Top Banner
BCS 2143 Introduction to Object Oriented and Software Development
22

BCS 2143 Introduction to Object Oriented and Software Development.

Dec 27, 2015

Download

Documents

Ezra Hampton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: BCS 2143 Introduction to Object Oriented and Software Development.

BCS 2143

Introduction to Object Oriented and Software

Development

Page 2: BCS 2143 Introduction to Object Oriented and Software Development.

Objectives

Able to define OO concepts. Understand the importance of

OOP.

Page 3: BCS 2143 Introduction to Object Oriented and Software Development.

Outline

OO Definition OO Concepts OO Benefits

Page 4: BCS 2143 Introduction to Object Oriented and Software Development.

OO Definition

Page 5: BCS 2143 Introduction to Object Oriented and Software Development.

OO Definition

A method of implementation in which programs are organized as cooperative collections of objects, each of which represents an instance of some class Object-oriented programs use objects

as components Reusable software components that

model real-world items

Page 6: BCS 2143 Introduction to Object Oriented and Software Development.

OO Concepts Objects and Classes Attributes - including the object's

characteristics (fields or properties) Behaviors (methods) - the things it

can do, or operations or features) Inheritance Encapsulation - the code for a class

should be relatively self-contained

Page 7: BCS 2143 Introduction to Object Oriented and Software Development.

Objects and Classes An object is a thing, both tangible and

intangible. Objects - Look all around you

Account, Vehicle, Employee, People, animals, plants, cars, etc

To create an object inside the computer program, we must provide a definition for objects - how they behave (methods) and what kinds of information they maintain (data values) - called a class.

Page 8: BCS 2143 Introduction to Object Oriented and Software Development.

Objects and Classes

An object is called an instance of a class.

Example: Vehicle A rectangle to

represent a class with its name appearing inside the rectangle.

A rectangle to represent a class with its name appearing inside the rectangle.

Page 9: BCS 2143 Introduction to Object Oriented and Software Development.

Message 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.

Page 10: BCS 2143 Introduction to Object Oriented and Software Development.

Message and Methods

Methods - An object's or class’s abilities (sometimes referred to as "functions")

Message - The process by which an object sends data to another object or asks the other object to invoke a method

Page 11: BCS 2143 Introduction to Object Oriented and Software Development.

Message and Methods (example)

current balance

getCurrentBalance()

Ask for the current balance of this particular account.

Ask for the current balance of this particular account.

SV198 : BankAccount

The current balance of SV198 is returned.

The current balance of SV198 is returned.

Page 12: BCS 2143 Introduction to Object Oriented and Software Development.

Inheritance Inheritance is a mechanism 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.

also call the superclass an ancestor and the subclass a descendant.

Page 13: BCS 2143 Introduction to Object Oriented and Software Development.

Inheritance Here are the superclass Account and its

subclasses Current Account and Saving Account.

Current Account

SavingAccount

Account

Page 14: BCS 2143 Introduction to Object Oriented and Software Development.

OO Programming Implements OO design into

program codes. Several examples of OO

languages : C++ Java VB.NET C# Smalltalk

Page 15: BCS 2143 Introduction to Object Oriented and Software Development.

What is Java Technology?

Java technology is An OO programming language A development environment An application environment A deployment environment

Page 16: BCS 2143 Introduction to Object Oriented and Software Development.

OO Benefits

“reuse , reuse, reuse” Reusable software components. Saves development time and

efforts. Build more reliable and effective

systems. Additional software features can be

added by combining classes.

Page 17: BCS 2143 Introduction to Object Oriented and Software Development.

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.

Page 18: BCS 2143 Introduction to Object Oriented and Software Development.

Software Development

Software life cycle Five primary phases : Analysis, Design,

Implementation, Test and Operation/maintenance.

UML serves as modeling tool for software developments.

Use UML diagrams to construct and explain software designs.

Page 19: BCS 2143 Introduction to Object Oriented and Software Development.

Software Life Cycle

The sequence of stages from conception to operation of a program is called software life cycle.

Five stages are: Analysis > requirement spec Design > a set of classes/objects Implementation > program codes Testing > unit and integration

testing Operation and Maintenance > put in

actual use

Page 20: BCS 2143 Introduction to Object Oriented and Software Development.

More for info, log on to…

http://java.sun.com/ http://www.omg.org/uml

Page 21: BCS 2143 Introduction to Object Oriented and Software Development.

Summary

Page 22: BCS 2143 Introduction to Object Oriented and Software Development.

Q & A