Lecture I
Lecture I
Prabhu Sunderaraman
[email protected]
Structured Programming
Look at the problem
Design a collection of functions
Break down the functions into smaller pieces;
Functional Decomposition
Identify the characteristics or data
Define them globally
Map the functions with the required data
A simple case study
Transportation department wants a software to
inspect Cars and issue an Inspection sticker to
the Car owners.
The car should be inspected for
Lights, Brakes
Honks, Wiper
Emission Control (CO < 0.5%)
Insurance Papers
Owner Information (License, Registration etc)
Functions
getOwnerDetails() {…..}
checkForInsurancePapers() {…..}
checkForLights() {…..}
checkForHonk() {…..}
checkForWiper() {…..}
checkForEmissionControl()
{
if (CO < 0.5%) {…..}
}
checkForBrakes() {…..}
printCarInspectionSticker() {…..}
Data
Data model required to support the functions
Hold information about Car, Owner, Car
Inspection Sticker, Insurance Papers
Data can be in a structure or module or DB
tables struct Car
{ … }
struct Owner
{ … }
struct InsurancePapers
{ … }
Functions, data & the dependencies
getOwnerDetails() {…..}
checkForInsurancePapers() {…..} Car
checkForLights() {…..}
checkForHonk() {…..}
checkForWiper() {…..} Owner
checkForEmissionControl()
{
if (CO < 0.5%) {…..} Insurance
Sticker
} Papers
checkForBrakes() {…..}
printCarInspectionSticker() {…..}
What’s the point?
case TRUCK:
getTruckDetails, checkEmissionControl < 0.2%
break;
case BUS:
getBusDetails, checkEmissionControl < 0.1%
break;
}
checkForHonk
checkForEmission
InsurancePapers
checkForLights
printSticker
InspectionSticker
Car Truck
….. …..
checkForEmission checkForEmission
checkForLights checkForLights
Benefits of OO Paradigm
Models System using Objects
Understanding the system is easier
No change to your existing code (almost)
If designed properly, of course!
Extensibility
OO Paradigm
Collection of discrete objects
Characteristics & Behavior
Data & Functions
Attributes & Methods
OO principles
Abstraction
Encapsulation
Hierarchy
Polymorphism
Abstraction
Inheritance :
expresses “is-a” or “Kind-of” relationship
Extensibility & Reusability
Part-of:
expresses that object is an aggregate of another
Polymorphism
Design
Conceptual solution that fulfills the requirements,
rather than its implementation
OOAD
OO Analysis
Identifying the objects in the problem domain
OO Design
Implementing the relationships between objects,
identifying the attributes, functionalities
Analysis
Design
Implementation
Testing System
Development Methods
Waterfall method
Analysis
Design
Implementation &Testing
Integration
Maintenance
Problems with Waterfall
Difficult to complete one phase of a software product's
lifecycle
Analysis
Design Requirements
Specification
Implementation
& Unit Testing
Integration
Booch’s Approach:
Micro Development Process (Spiral)
Versions of a Project
Full requirements are not given at start
Full requirements are not known
Full development may take several years
System
Testing
Incremental Development
Reasons:
Requirements are not very clear
Requirement changes in the mean time
Feedback will help “steer” the project
Feedback helps new requirements
Each stage adds new functionality
Software system
Unified Process
unified, cohesive and comprehensive methodology
Inception to Deployment
A Framework from Rational Corporation
Unified Process
Use-case driven
Architecture-centric
Iterative-incremental
Use-case Model
All use-cases make up complete functional model
What does the system do for each user?
Requirement Analysis
Use cases
Calculate the risks
Requirements, Technological, Skills, Political
Building prototypes, Training etc
Optimization
Performance Tuning