Assignment No: - 2 Ques:1. Describe Object Oriented Analysis (OOA) ? Ans:1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Assignment No: - 2

Ques:1. Describe Object Oriented Analysis (OOA)?


Ans:1 Object Oriented Analysis (OOA) is process of discovery where a development team understands
and models the requirements of the system. In OOA requirements are organized as objects. It integrates
all the process and data. But in others or traditional structural analysis both process and data are
considered independently/separately. They use flow chart/structure charts for process and ER diagrams
for data.
But in OOA some advance models are used. The common models used in OOA are: Use cases, Object
models. Use cases describe pictures or overview for standard domain functions that the system must
achieved. Object models describe the names, class relations, operations, and properties of the main
objects. User-interface prototypes can also be created for better understanding.
Object Oriented Analysis (OOA) begins by looking at the problem domain (the area of expertise or
application that needs to analyze in order to solve a problem). Its aim is to produce a conceptual model
of the information that exists in the area being analyzed. For the analysis there are a variety of sources.
It can be a formal document, a written requirements statement, interviews with stakeholders/other
interested parties, other methods, etc. The final result of object-oriented analysis will appear in the form
of a conceptual model that describes what the system is functionally required to do.

Functionalities of OOA
The core activities in OOA are given bellow:
o Find the objects/Identify the objects: -
▪ Using concepts, CRC cards, etc.
o Organize the objects by creating object model diagram: -
▪ Classifying the objects identified, so similar objects can later be defined in the same class.
o Explain how the objects communicates with each other/Identifying relationships b/w objects:
▪ This helps to determine input and output of an objects.
o Set the characteristic or behavior of the objects/Defining operations of the objects: -
▪ The way of processing of the objects.
o Set the internal of the objects/Defining objects internally: -
▪ Information held within the objects.

Three Ways for Object Oriented Analysis


➢ Conceptual Model (Larman)
- Produce a “light” class diagram.
➢ CRC Cards (Beck, Cunningham)
- Index cards and role playing.
➢ Analysis Model (Jacobson)
- Boundaries, entities, control

Advantages of OOA
The OOA provides better performance. Some common advantages of OOA are given bellow:
o Its focuses on data rather than the procedures as in Structured Analysis
o The objectives of encapsulation and data hiding help the developer to develop the systems that
cannot be tampered by other parts of the system
o It allows effective software complexity management by the virtue of modularity
o It can be upgraded from small to large system easily.

1
Ques:2. Describe Object Oriented Design (OOD)?
Ans:2 Object Oriented Design (OOD) serves as part of the object-oriented programming (OOP) process of
lifestyle. It is mainly the process of using an object methodology to design a computing system or application.
This technique enables the implementation of a software based on the concepts of objects. Additionally, it is
a concept that forces programmers to plan out their code in order to have a better flowing program.
The origins of Object-Oriented Design (OOD) is debated, but the first languages that supported it included
Simula and SmallTalk. The term did not become popular until Grady Booch wrote the first paper titled Object-
Oriented Design, in 1982. The chief objective of this type of software design is to define the classes and their
relationships, which are needed to build a system that meets the requirements contained in the Software
Requirement Specifications.
Moreover, it is the discipline of defining the objects and their interactions to solve a problem that was identified
and documented during the Object-Oriented Analysis (OOA). In short, Object Oriented Design (OOD) is a
method of design encompassing the process of object-oriented decomposition and a notation for depicting
both logical and physical models of the system under design.

The other characteristics of Object-Oriented Design are as follow:


• Objects are abstractions of the real-world or system entities and manage themselves.
• The objects are independent and in an encapsulated state and representation information.
• System functionality is expressed in terms of object services.
• Shared data areas are eliminated.
• Communication between objects is through message passing.
• The objects may be distributed and may execute sequentially or in parallel.

Advantages of Object-Oriented Design:


The discussion above has elaborated on several advantages of Object-Oriented Design (OOD). From enabling
the implementation of a software based on the concepts of objects and deleting the shared data areas to
distributing and executing the object sequentially or in parallel, the benefits of this approach of software design
are numerous. Hence, provided here some of the other advantages of using Object Oriented Design (OOD).
• Easier to maintain objects.
• Objects may be understood as stand-alone entities.
• Objects are appropriate reusable components.
• For some systems, there may be an obvious mapping from real entities to system objects.

Concepts of Object-Oriented Design:


These concepts are defined in detail below:
• Encapsulation: This is a tight coupling or association of data structure with the methods or functions
that act on the data. This is basically known as a class, or object (object is often the implementation
of a class).
• Data Protection: The ability to protect some components of the object from external entities. This is
realized by language keywords to enable a variable to be declared as private or protected to the
owning class.
• Inheritance: This is the ability of a class to extend or override the functionality of another class. This
so-called child class has a whole section that is the parent class and then it has its own set of functions
and data.
• Interface: A definition of functions or methods, and their signature that are available for use as well
as to manipulate a given instance of an object.
• Polymorphism: This is the ability to define different functions or classes as having the same name,
but taking different data type.

2
Ques:3 What is Object-Oriented Metrics and describe all the C & K metrics.
Ans:3 Object-oriented metrics describe aspects of object-oriented programming. Object oriented Metrics
support the main concepts of the object-oriented paradigm and the consequent emphasis on reuse, that are
believed to be responsible for the increasing in software quality and development productivity.

Types of OO Metrics:

1. CK Metrics
• Proposed by Chidamber and Kemerer.
• class-based metrics.
2. LK Metrics
• Proposed by Lorenz and Kidd.
• class-based and operation-based.
3. MOOD Metrics
• Proposed by Harrison, Counsell, and Nithi.
• class-based.

CK Metrics
CK metrics in 1991, Chidamber and Kemerer proposed a first version of these metrics and later the
definition of some of them were improved and presented in 1994.

1. Coupling Between Object (CBO):

It is related to the number of non-inherited classes with which a particular class is coupled. Such number
reflects the degree of interdependence between the object-oriented system components. However, class X is
coupled to class Y if and only if X sends a message to Y; that is, a method of one class use methods or
instances variables of another class.
CBO = number of classes to which a class is coupled

2. Response for a Class (RFC and RFC’):

It represents the number of methods of a class and the number of invoked methods by those class methods.
It measures the degree of communication between the classes of the system.
RFC = M + R (First-step measure)
RFC’ = M + R’ (Full measure)
M = number of methods in the class
R = number of remote methods directly called by methods of the class
R’ = number of remote methods called, recursively through the entire call tree

The use of RFC’ should be preferred over RFC. RFC was originally defined as a first-level metric because it
was not practical to consider the full call tree in manual calculation. With an automated code analysis tool,
getting RFC’ values are no longer problematic. As RFC’ considers the entire call tree and not just one first
level of it, it provides a more thorough measurement of the code executed.

3. Lack of Cohesion in Methods (LCOM):

It is the number of pairs of methods which do not share instance variable, minus the number of pairs of
methods that share instance variables of the class.
LCOM=The number of methods in a given class that access one or more of the same instance
variables.

3
4. Weighted Methods per Class (WMC):

It represents the sum of the complexities of all methods of a class. If all the complexities of all methods are
ones, then WMC is the number of class methods.
WMC = number of methods defined in class

5. Depth of Inheritance Tree (DIT):

It measures the level number for a class in the inheritance tree. DIT of the root class in the inheritance tree is
equal to zero.
DIT = maximum inheritance path from the class to the root class

6. Number of Children (NOC):

It measures the number of direct subclasses of a class (the children). Moreover, if the subclasses are
dependent of their superclass (methods or instance variables), any changes to the superclass may affect the
subclasses, and therefore, the harder is the superclass maintainability.
NOC = number of immediate sub-classes of a class

The six metrics can be summarized in Table1: -

Objective of CK metrics: - were defined to measure design complexity in relation to their impact on
external quality attributes such as maintainability, reusability, etc.

4
Ques:4 Describe Object-Oriented paradigms (abstraction and encapsulation only) by writing source
code in any object-oriented programming language.
Ans:4 BRIEF HISTORY: -
Object-Oriented paradigm was developed in 1960 by researchers. At the Norwegian Computing center as a
result of SIMULA (SIMULATION OF REAL SYSTEMS). The first pure OOPL: SMALLTALK was developed
in 1970 by Alan Kay and his researchers at Xerox park. In accordance with the Kay’s development of the first
OOPL Bjarne Stroustrup extended the C Program, C++ that used the object-oriented concept.

OBJECT ORIENTED PARADIGM: -


Object-Oriented paradigm changes the main focus from code to data. It models real-world objects. The unit of
Abstraction is the object which contains both i.e. Information (Values) and Behavior (Methods and
Procedures). Most of the object-oriented programs are similar. The change is in how we think about problem
solving instead of the style of programming.

Elements of OOP: -
• Objects
• Classes
• Encapsulation
• Data Abstraction
• Inheritance
• Polymorphism
• Dynamic Binding
• Message Passing

Definition for Abstraction: - Data abstraction is one of the most essential and important features of
object-oriented programming in C++. Abstraction means displaying only essential information and hiding
the details. Data abstraction refers to providing only essential information about the data to the outside
world, hiding the background details or implementation.

Code for Abstraction:


#include <iostream>
using namespace std;
class AbstractionExample{
private:
int num;
char ch;
public:
void setMyValues(int n, char c) {
num = n; ch = c;
}
void getMyValues() {
cout<<"Numbers is: "<<num<< endl;
cout<<"Char is: "<<ch<<endl;
}
};
int main(){
AbstractionExample obj;
obj.setMyValues(100, 'X');
obj.getMyValues();
return 0;
}

5
By making these data members private, they have become hidden them from outside world. These data
members are not accessible outside the class. The only way to set and get them values is through the public
functions.

Definition for Encapsulation: Encapsulation is defined as wrapping up of data and information under a
single unit. In Object Oriented Programming, Encapsulation is defined as binding together the data and
the functions that manipulates them.

Code for Encapsulation:


#include<iostream>
using namespace std;
class Encapsulation
{ private:
// data hidden from outside world
int x;
public:
void set(int a)
{
x =a;
}
int get()
{
return x;
}
};
int main()
{ Encapsulation obj;
obj.set(5);
cout<<obj.get();
return 0;
}

The variable can be accessed and manipulated only using the functions get() and set() which are present
inside the class. Thus we can say that here, the variable x and the functions get() and set() are binded
together which is nothing but encapsulation.

6
Ques:5 Explain the Object-Oriented Case Tools.
Ans:5 CASE Tools (Computer Aided Software Engineering Tools)
It refers to the collection of software programs that are designed to automate the development cycle. The
implementation of new systems requires many different complex tasks to be organized and completed
correctly and efficiently. Information generated has to be kept in synchronization. The use of CASE tools
eases the task of coordinating these activates from analysis to implementation

Computer-Aided Software Engineering (CASE), in the field of


Software Engineering is the scientific application of a set of tools and methods to a software system which
is meant to result in high-quality, defect-free, and maintainable software products. It also refers to
methods for the development of information systems together with automated tools that can be used in
the software development process.

Types of CASE Tools Basic categories of CASE tools are available: -


1. Diagramming tools that represent data models according to system specifications.
2. Screen and Report Generators for creating system specifications.
3. Data Dictionaries that contain a history of changes made to a system.
4. Code Generators to be able to generate code from data Diagrams themselves.
5. Documentation generators that make the code more readable.

Development of CASES in the early days of writing software there has been a need for automated tools
to help the software developer as computer became more powerful and the software that ran on them
grew larger and more complex, power tools with increasing functionality were required.

Categories of CASE Tools


CASE tools can be divided into two main groups. Those that deal with the first three parts of the system
development life cycle (preliminary investigation, analysis, and design) and are referred to as Front-End
CASE Tools or Upper-Case Tools. Those that deal mainly with the implementation, testing and
installation are referred to as Back-End CASE Tools or Lower-Case Tools.

Upper CASE Tools: -

These are basically general-purpose analysis and design specification tools. During the initial stages of
system development, analysts have to determine system requirements and analyze this information to
design the most effective system. Computerized CASE tools allow for changes to be made automatically,
very quickly and accurately. Data Dictionaries are data processing systems products that are specifically

7
designed to hold, maintain and organize information. They have facilities for producing a variety of
reports. They allow developers to be more productive. The goal of a CASE tool is to refine the analysis
and design stages to allow automated production of code, around 75%.

Data Dictionaries: - A data dictionary is an automated tool for collecting and organizing detailed
information about system components. A data dictionaries main facility is to document data elements,
records, programs, files, users etc. They also have the facility to cross-reference all system components
and contain details of: Systems environment. Audit trails Reports Forms Functions Processes.

Lower CASE Tools: -

These focus on the architecture of the system and its implementation and maintenance. These tools are
effective in helping with the generation of the program code and are referred to as Code Generators. A
code generator is a tool that enables automatic generation of code from the analysis and design
specifications. Generating code this way ensures that all code is produced with identical naming
conventions.

Code Generators: -Code generators produce a high quality of code that is easy to maintain and is
portable. They are able to interact with Upper CASE tools to aid in the development of code.

Document Generators: -A further enhancement to CASE tools is document generators. A document


generator is a CASE tool that generates technical documentation from source code comments. The
comments that are produced conform to a standard format.

Object-Oriented CASE

CASE tools are well supported in object-oriented programming systems (OOPS)Earlier problems with
OOPS focused on models created for software development systems and their different notations. This
was overcome by the use of UML, Unified Modelling Language, which is a new standard for producing
diagrams and charts. All current CASE tools have now adopted UML for specifying, visualizing and
constructing software systems.

UML CASE tools offer automatic code generation from the UML diagram

This tool produces a framework for the code which contains objects and classes. An Executable
Prototype is produced. This is an executable source code program obtained directly from UML. One of
the main features in UML is Reverse Engineering where existing source code is reversed engineered
into a set of UML diagrams.

You might also like