Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Identifying Object Relationships, Attributes, and Methods in Object-Oriented Programming, Schemes and Mind Maps of Computer Science

Guidelines for identifying relationships, attributes, and methods in Object-Oriented Programming (OOP). It covers three types of relationships: association, super-sub structure (generalization hierarchy), and aggregation. The document also discusses association patterns, identifying attributes and methods, and eliminating unnecessary associations. Dr. Santosh Kumar Swain, an Associate Professor at KIIT University, presents these guidelines.

What you will learn

  • How can you identify associations between classes?
  • What are super-sub relationships in Object-Oriented Programming?
  • What are the three types of relationships among objects in Object-Oriented Programming?
  • How do you eliminate unnecessary associations?
  • What are common association patterns in Object-Oriented Programming?

Typology: Schemes and Mind Maps

2022/2023

Uploaded on 12/24/2022

Packialatha
Packialatha 🇮🇳

4 documents

1 / 52

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
12/24/22 11
Identifying Object
Relationships, Attributes
and Methods
Dr. Santosh Kumar Swain
Associate Professor
School Of Computer Engineering
KIIT , Bhubaneswar.
12/24/22 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34

Partial preview of the text

Download Identifying Object Relationships, Attributes, and Methods in Object-Oriented Programming and more Schemes and Mind Maps Computer Science in PDF only on Docsity!

12/24/22 11

Identifying Object

Relationships, Attributes

and Methods

Dr. Santosh Kumar Swain

Associate Professor School Of Computer Engineering KIIT , Bhubaneswar. 12/24/22 1

Goals

  • (^) Analyzing relationships among classes.
  • (^) Identifying association.
  • (^) Association patterns.
  • (^) Identifying super- and subclass hierarchies.

Objects contribute to the behavior of the system by collaborating with one another. —Grady Booch

In OO environment, an application is the interactions and relationships among its domain objects. All objects stand in relationship to others, on whom they rely for services and controls.

Associations

  • (^) A reference from one class to another is an association.
  • (^) Basically a dependency between two or more classes is an association.
  • (^) For example, Jackie works for John.

Associations (Con’t)

  • (^) Some associations are implicit or taken from general knowledge.

Guidelines For Identifying Associations (Con’t)

  • (^) Association often corresponds to verb or prepositional phrases such as part of , next to , works for , contained in , etc.

Common Association Patterns

  • (^) Common association patterns include:
  • (^) Location Association: next To, part of, contained in, ingredient of etc. :
  • (^) For example cheddar cheese is an ingredient of the French soup.

Eliminate Unnecessary Associations

  • (^) Implementation association. Defer implementation-specific associations to the design phase.
  • (^) Ternary associations. Ternary or n-ary association is an association among more than two classes

Eliminate Unnecessary Associations (Con’t)

  • (^) Directed actions (derived) associations can be defined in terms of other associations.
  • (^) Since they are redundant you should avoid these types of association.

Superclass-Subclass Relationships

  • (^) Recall that at the top of the class hierarchy is the most general class, and from it descend all other, more specialized classes.
  • (^) Sub-classes are more specialized versions of their super-classes.

Guidelines For Identifying Super-sub Relationships: Top- down

  • (^) Look for noun phrases composed of various adjectives on class name.
  • (^) Example, Military Aircraft and Civilian Aircraft.
  • (^) Only specialize when the sub classes have significant behavior.

Guidelines For Identifying Super-sub Relationships: Reusability

  • (^) Move attributes and methods as high as possible in the hierarchy.
  • (^) At the same time do not create very specialized classes at the top of hierarchy.
  • (^) This balancing act can be achieved through several iterations.

Guidelines For Identifying Super-sub Relationships: Multiple inheritance

  • (^) Avoid excessive use of multiple inheritance.
  • (^) It is also more difficult to understand programs written in multiple inheritance system.