Software Development Process - Object-Oriented Approach - Encapsulation
Software Development Process - Object-Oriented Approach - Encapsulation
Introduction
Outline
• Software Development Process
• Object-Oriented Approach
• Encapsulation
1
Software Development Process
Problem
Analysis
Object
Orientation
Design
Documentation
Implementation
(C++)
Product
Testing
1.3
1.4
2
Unified Process Method
in Software Development
A software development process describes an approach to
building, deploying, and maintaining a software.
1.5
Requirements Requirements
Analysis Analysis
Next time Design
Design
Implement Implement
Test Test
Product1 Product2
An iteration has a
fixed time
(Example: 3 weeks)
1.6
3
User view
A program must have the following features:
• Runs correctly.
• Runs reliably.
1.7
1.8
4
Programming Process
Program development is based on models of real world situations.
Computer programs are the implementions of models.
Implementation (Coding):
A programming language such as C++ is used for the implementation.
1.9
Advantages of C++
1.10
5
Some Application Domains of C++
1.11
An Obsolete Technique:
Procedural Programming
• In a procedural language such as C or Fortran, the emphasis is on
functions, not objects.
• A program is divided into functions.
1.12
6
Disadvantages of Procedural Programming
• To add new data items, all the functions that access the
data must be modified, so that they can access the new items.
1.13
1.14
7
Advantages of
Object-oriented programming
Readability
Understandability
Low probability of errors
Easy maintenance
Reusability
Teamwork
1.15
1.16
8
The Object-Oriented Approach
Real world objects have two parts:
1. Attributes (DATA)
2. Methods (FUNCTIONS)
1.17
Encapsulation (Classes)
To create software models of real world objects, both data and
functions are combined into a single program entity (CLASS).
1.18
9
The Model of an Object
In object-oriented programming, objects combine data and
functions.
Class diagram
for Point object Data
(attributes)
hide
x print
y
Functions
move (methods)
1.19
Objects
Main
program
message1 message4
message2 message5
message3
1.20
10
Example:
Point class in a graphics program
1.21
int main() {
Point point1, point2, point3; //Declare three objects
point1.move(50, 30); //Goto coordinate 50, 30
point1.print(); //Display the point
point1.hide(); //Disappear the point
}
1.22
11