Вы находитесь на странице: 1из 25

OBJECT ORIENTED SYSTEM

DEVELOPMENT
Presented by
Abitha.D
1st M.Sc.CS(SF)
9.4 COROLLARIES
AXIOM 1 & AXIOM 2
9.4.1.2 COHESION
 Coupling deals with interactions between
objects or software components.
 Cohesion deals with interactions within a
single object or software component.

 Cohesion reflects the “single-purposeness” of


an object.
 Highly cohesive components can lower
coupling, because only a minimum information
need be passed between components.
Method & Class cohesion
Cont..
Method Cohesion:
It means a method should carry only one
function.
A method that carries multiple functions is
undesirable.

Class Cohesion:
It means that all the class’s method and
attributes must be cohesive, because that is used
by internal methods or derived classes methods.
Inheritance cohesion
Cont..
Inheritance Cohesion:
Inheritance Cohesion is concerned with the
following questions:

 How interrelated are the classes?


 Does specialization really portray
specialization or is it just something arbitary?
9.4.2. Corollary 2: Single Purpose
Class: NOTE: Each class must have a
single, clearly defined
Each class must have a purpose. purpose which can be
describe in few sentences.

Every class should be clearly defined and necessary


in the context of achieving the system’s goals.

When you document a class, you should be able to


easily explain its purpose in a sentence or two sentence.

If you cannot make sentence, then rethink the class


and try to subdivide it into more independent pieces.
9.4.2. Corollary 2: Single Purpose
(Cont..)

Methods:

Each method must provide only one service.

Each method should be of moderate size,


no more than a page, half a page is better.
9.4.3. Corollary 3: Large Number of Simpler
Classes, Reusability
A great benefit results from having a large
number of simpler classes.

You cannot possibly foresee all the future


scenarios in which the classes you create will be
reused.

The less specialized classes are, the more


likely future problems can be solved by a
recombination of existing classes(reusability),
adding a minimal number of sub classes.
9.4.3. Corollary 3: Large Number of Simpler
Classes, Reusability (Cont..)

A class that easily can be understood and reused


(or inherited).

While a complex poorly designed class is just so


much dead weight and cannot be reused.

Guideline:
Keep the following guidelines:
“The smaller are your classes, the better are your
chance of reusing them in other projects. Large and
complex classes are too specialized to be reused.”
9.4.4. Corollary 4: Strong Mapping
NOTE: There must be strong association between the physical system
(analysis’s object) & logical design (design’s object)

Object-oriented analysis and object-


oriented design are based on the same
model.

As the model progresses from analysis


to implementation, more detail is added.
9.4.4. Corollary 4: Strong Mapping(Cont..)
9.4.4. Corollary 4: Strong Mapping(Cont..)
For example:
During analysis we might identify a class
Employee.

During the design phase, we need to design the


class Employee, its methods, its association with other
objects, and its view and access classes.(by inheritance).

A strong mapping links classes identified during


analysis and classes designed during design phase.
(e.g., view and access classes)
9.4.5. Corollary 5: Standardization
•To reuse classes, one should have good
understanding of classes in Object Oriented
Programming Environment.
• Most OOP such as Smalltalk, Java, C++,
or PowerBuilder come with built-in class libraries.
• O-O systems grow as you create new
applications.
• The knowledge of existing class will help in
reuse by inheriting from the existing class
libraries.
9.4.5. Corollary 5: Standardization(Cont..)

Some shortfall:
• However class libraries are not
always well documented and updated.

Solution:
• Making a repository of Design
Patterns can give some solutions to all
these problems.
9.4.5. Corollary 5:
Standardization(cont..)

Concept of design patterns:


The concept of design patterns might
provide a way to capture the design
knowledge, document it, and store it in a
repository that can be shared and reused in
different applications.
9.4.5. Corollary 5:
Standardization(Cont..)

Goodness:
Class Libraries must be easily searched,
based on some user’s criteria.

For example, users should be able to


search the class repository with commands
like “show me all Facet classes.”
QUERIES

It’s the time


for clearing
doubts.

Вам также может понравиться