Unit-6: Object-Oriented Software Development Process/software Development Life Cycle (SDLC)
Unit-6: Object-Oriented Software Development Process/software Development Life Cycle (SDLC)
Analysis,
Design, and
Implementation.
In object-oriented software engineering, the software developer identifies and organizes the
application in terms of object-oriented concepts, prior to their final representation in any specific
programming language or software tools.
SDLC Cycle
SDLC Cycle represents the process of developing software. SDLC framework includes the
following steps:
In this stage, the problem is formulated, user requirements are identified, and then a model is
built based upon real–world objects. The analysis produces models on how the desired system
should function and how it must be developed. The models do not include any implementation
details so that it can be understood and examined by any non–technical application expert.In the
system analysis or object-oriented analysis phase of software development, the system
requirements are determined, the classes are identified and the relationships among classes are
identified.
The three analysis techniques that are used in conjunction with each other for object-oriented
analysis are object modelling, dynamic modelling, and functional modelling.
a. Object Modelling
Object modelling develops the static structure of the software system in terms of objects. It
identifies the objects, the classes into which the objects can be grouped into and the relationships
between the objects. It also identifies the main attributes and operations that characterize each
class.
b. Dynamic Modelling
After the static behavior of the system is analyzed, its behavior with respect to time and external
changes needs to be examined. This is the purpose of dynamic modelling.
Dynamic Modelling can be defined as “a way of describing how an individual object responds to
events, either internal events triggered by other objects, or external events triggered by the
outside world”.
The process of dynamic modelling can be visualized in the following steps −
c. Functional Modelling
Functional Modelling is the final component of object-oriented analysis. The functional model
shows the processes that are performed within an object and how the data changes as it moves
between methods. It specifies the meaning of the operations of object modelling and the actions
of dynamic modelling. The functional model corresponds to the data flow diagram of traditional
structured analysis.
Once the requirement analysis is done, the next stage is to certainly represent and document the
software requirements and get them accepted from the project stakeholders.
SRS is a document created by system analyst after the requirements are collected from various
stakeholders. SRS defines how the intended software will interact with hardware, external
interfaces, speed of operation, response time of system, portability of software across various
platforms, maintainability, speed of recovery after crashing, Security, Quality, Limitations etc.
The requirements received from client are written in natural language. It is the responsibility of
system analyst to document the requirements in technical language so that they can be
comprehended and useful by the software development team.
3. Object–Oriented Design
Object-oriented design includes two main stages, namely, system design and object design.
a. System Design
In this stage, the complete architecture of the desired system is designed. The system is
conceived as a set of interacting subsystems that in turn is composed of a hierarchy of interacting
objects, grouped into classes. System design is done according to both the system analysis model
and the proposed system architecture. Here, the emphasis is on the objects comprising the system
rather than the processes in the system.
b. Object Design
In this phase, a design model is developed based on both the models developed in the system
analysis phase and the architecture designed in the system design phase. All the classes required
are identified. The designer decides whether −
The associations between the identified classes are established and the hierarchies of classes are
identified. Besides, the developer designs the internal details of the classes and their associations,
i.e., the data structure for each attribute and the algorithms for the operations.
4. Object–Oriented Implementation
In this stage, the design model developed in the object design is translated into code in an
appropriate programming language like C++, Java, Smalltalk, C# and Python, includes provision for
representing classes or software tool. The databases are created and the specific hardware
requirements are ascertained. Once the code is in shape, it is tested using specialized techniques
to identify and remove the errors in the code.
Implementing Associations
Most programming languages do not provide constructs to implement associations directly. So
the task of implementing associations needs considerable thought.
I. Unidirectional Associations
Optional Associations − Here, a link may or may not exist between the participating
objects. For example, in the association between Customer and Current Account in the
figure below, a customer may or may not have a current account.
If an association has some attributes associated, it should be implemented using a separate class.
For example, consider the one–to–one association between Employee and Project as shown in
the figure below.
5. Testing
Once a program code is written, it must be tested to detect and subsequently handle all errors in
it. A number of schemes are used for testing purposes.
Another important aspect is the fitness of purpose of a program that ascertains whether the
program serves the purpose which it aims for. The fitness defines the software quality.
b. Unit Testing
In unit testing, the individual classes are tested. It is seen whether the class attributes are
implemented as per design and whether the methods and the interfaces are error-free. Unit
testing is the responsibility of the application engineer who implements the structure.
c. Subsystem Testing
This involves testing a particular module or a subsystem and is the responsibility of the
subsystem lead. It involves testing the associations within the subsystem as well as the
interaction of the subsystem with the outside. Subsystem tests can be used as regression tests for
each newly released version of the subsystem.
d. System Testing
System testing involves testing the system as a whole and is the responsibility of the quality-
assurance team. The team often uses system tests as regression tests when assembling new
releases.
The different types of test cases that can be designed for testing object-oriented programs are
called grey box test cases. Some of the important types of grey box testing are −
State model based testing − This encompasses state coverage, state transition coverage,
and state transition path coverage.
Use case based testing − Each scenario in each use case is tested.
Class diagram based testing − Each class, derived class, associations, and aggregations
are tested.
Sequence diagram based testing − The methods in the messages in the sequence
diagrams are tested.
ii. Techniques for Subsystem Testing
Thread based testing − All classes that are needed to realize a single use case in a
subsystem are integrated and tested.
Use based testing − The interfaces and services of the modules at each level of hierarchy
are tested. Testing starts from the individual classes to the small modules comprising of
classes, gradually to larger modules, and finally all the major subsystems.
Alpha testing − This is carried out by the testing team within the organization that
develops software.
Acceptance testing − This is carried out by the customer before accepting the deliverables.
6. Deployment
Once the software is certified, and no bugs or errors are stated, then it is deployed. Then
based on the assessment, the software may be released as it is or with suggested
enhancement in the object segment. After the software is deployed, then its maintenance
begins.
7. Maintenance
Once when the client starts using the developed systems, then the real issues come up and
requirements to be solved from time to time.This procedure where the care is taken for the
developed product is known as maintenance.
Basic Object Oriented Data Model
Need of Object Oriented Data Model :
To represent the complex real world problems there was a need for a data model that is
closely related to real world. Object Oriented Data Model represents the real world
problems easily.
Object Oriented Data Model :
In Object Oriented Data Model, data and their relationships are contained in a single
structure which is referred as object in this data model. In this, real world problems are
represented as objects with different attributes. All objects have multiple relationships
between them. Basically, it is combination of Object Oriented programming and
Relational Database Model as it is clear from the following figure :
Object Oriented Data Model
= Combination of Object Oriented Programming + Relational database
model
Components of Object Oriented Data Model :
Objects –
An object is an abstraction of a real world entity or we can say it is an instance of
class. Objects encapsulates data and code into a single unit which provide data
abstraction by hiding the implementation details from the user. For example:
Instances of student, doctor, engineer in above figure.
Attribute –
An attribute describes the properties of object. For example: Object is STUDENT and
its attribute are Roll no, Branch, Setmarks() in the Student class.
Methods –
Method represents the behavior of an object. Basically, it represents the real-world
action. For example: Finding a STUDENT marks in above figure as Setmarks().
Class –
A class is a collection of similar objects with shared structure i.e. attributes and
behavior i.e. methods. An object is an instance of class. For example: Person, Student,
Doctor, Engineer in above figure.
class student
{
char Name[20];
int roll_no;
--
--
public:
void search();
void update();
}
In this example, students refers to class and S1, S2 are the objects of class which can be
created in main function.
Inheritance –
By using inheritance, new class can inherit the attributes and methods of the old class
i.e. base class. For example: as classes Student, Doctor and Engineer are inherited
from the base class Person.
Advantages of Object Oriented Data Model :
Codes can be reused due to inheritance.
Easily understandable.
Cost of maintenance can reduced due to reusability of attributes and functions
because of inheritance.
Disadvantages of Object Oriented Data Model :
It is not properly developed so not accepted by users easily.
Class DataModel
java.lang.Object
javax.faces.model.DataModel
Constructor Summary
DataModel()
Method Summary
void addDataModelListener(DataModelListener listener)
Add a new DataModelListener to the set interested in notifications
from this DataModel.
DataMode getDataModelListeners()
lListener Return the set of DataModelListeners interested in notifications from
[] this DataModel.
abstract getRowCount()
int Return the number of rows of data objects represented by
this DataModel.
abstract getRowData()
Object Return an object representing the data for the currenty selected row index.
abstract getRowIndex()
int Return the zero-relative index of the currently selected row.
abstract getWrappedData()
Object Return the object representing the data wrapped by this DataModel, if
any.
abstract isRowAvailable()
boolean Return a flag indicating whether there is rowData available at the
current rowIndex.
void removeDataModelListener(DataModelListener listener)
Remove an existing DataModelListener from the set interested in
notifications from this DataModel.
abstract setRowIndex(int rowIndex)
void Set the zero-relative index of the currently selected row, or -1 to indicate
that we are not positioned on a row.
abstract setWrappedData(Object data)
void Set the object representing the data collection wrapped by
this DataModel.
Constructor Detail
DataModel
public DataModel()
Method Detail
1) isRowAvailable
public abstract boolean isRowAvailable()
Return a flag indicating whether there is rowData available at the current rowIndex. If no
wrappedData is available, return false.
Throws:
FacesException - if an error occurs getting the row availability
2) getRowCount
public abstract int getRowCount()
Return the number of rows of data objects represented by this DataModel. If the number of
rows is unknown, or no wrappedData is available, return -1.
Throws:
FacesException - if an error occurs getting the row count
3) getRowData
public abstract Object getRowData()
Return an object representing the data for the currenty selected row index. If no wrappedData
is available, return null.
Throws:
FacesException - if an error occurs getting the row data
IllegalArgumentException - if now row data is available at the currently specified row index
4) getRowIndex
public abstract int getRowIndex()
Return the zero-relative index of the currently selected row. If we are not currently positioned
on a row, or no wrappedData is available, return -1.
Throws:
FacesException - if an error occurs getting the row index
5) setRowIndex
public abstract void setRowIndex(int rowIndex)
Set the zero-relative index of the currently selected row, or -1 to indicate that we are not
positioned on a row. It is possible to set the row index at a value for which the underlying data
collection does not contain any row data. Therefore, callers may use the isRowAvailable()
method to detect whether row data will be available for use by the getRowData() method.
If there is no wrappedData available when this method is called, the specified rowIndex is stored
(and may be retrieved by a subsequent call to getRowData()), but no event is sent. Otherwise, if
the currently selected row index is changed by this call, a DataModelEvent will be sent to the
rowSelected() method of all registered DataModelListeners.
Parameters:
rowIndex - The new zero-relative index (must be non-negative)
Throws:
FacesException - if an error occurs setting the row index
IllegalArgumentException - if rowIndex is less than -1
6) getWrappedData
public abstract Object getWrappedData()
Return the object representing the data wrapped by this DataModel, if any.
7) setWrappedData
public abstract void setWrappedData(Object data)
Set the object representing the data collection wrapped by this DataModel. If the specified data
is null, detach this DataModel from any previously wrapped data collection instead.
If data is non-null, the currently selected row index must be set to zero, and a DataModelEvent
must be sent to the rowSelected() method of all registered DataModelListeners indicating that
this row is now selected.
Parameters:
data - Data collection to be wrapped, or null to detach from any previous data collection
Throws:
ClassCastException - if data is not of the appropriate type for this DataModel implementation
8) addDataModelListener
public void addDataModelListener(DataModelListener listener)
Add a new DataModelListener to the set interested in notifications from this DataModel.
Parameters:
listener - The new DataModelListener to be registered
Throws:
NullPointerException - if listener is null
getDataModelListeners
public DataModelListener[] getDataModelListeners()
Return the set of DataModelListeners interested in notifications from this DataModel. If there
are no such listeners, an empty array is returned.
9) removeDataModelListener
public void removeDataModelListener(DataModelListener listener)
Remove an existing DataModelListener from the set interested in notifications from this
DataModel.
Parameters:
listener - The old DataModelListener to be deregistered
Throws:
NullPointerException - if listener is null