1. OOSD Flashcards

1
Q

OOAD

A

Object oriented analysis and development

A technical approach for analysing, designing an application, system, or a business by applying the object oriented paradigm and visual modelling throughout the development lifecycle for better communication product quality

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Orthogonal view of software

A

Two approaches:
traditional approach
object oriented approach

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

traditional approach

A

Algorithms + data structures = programs
Software system is a set of mechanisms for performing certain actions on certain data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

oosd methodology

A
  • everything is an obj And each object is responsible for itself
  • Object orientation systems are easier to adapt to changing requirements. Easier to maintain more robust and promote greater design and code reuse
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

diff b/w Traditional and oo approach

A

– in mam’s doc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

object basics

A

obj:
Combination of data and logic that represents some real world entity
- Each object is instance of class

clses:
Specification of
-structures (instance variables)
-behaviour (methods)
-inheritance for objects
Classes are important mechanisms for classifying objects. A method or behaviour of an obj Defined by its class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Dynamic and static binding

A

dynamic binding-
Process of determining whic function to invoke and runtime
static binding
process of determining which function to invoke earlier itself

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

persistence

A

obj have lifetime.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Features of OOD:

A
  1. Higher level of abstraction
    Top down approach supports abstraction at functional level, whereas oo approach supports abstraction and object level so it encapsulates both data (attributes) And functions (methods)
  2. Seamless transition among different phases of software development
    In trad app, s/w dev Requires different styles and methodologies for each step of the process
  3. Encouragement of good programming techniques
    OO Systems carefully indicates The position between its interfaces(What class can do) and implementation of that interface(how class can do that)
  4. Promotion of reusability
    Because their model directly out of real world problem domain
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Object properties

Object Methods

A

Object Properties
State of an object represent property
eg: Object car has properties like cost colour model

Object methods
In object model object behaviour is described in methods or procedures
- Implements behaviour of object
- Capabilities of objects are determined by the methods defined for it
- Methods conceptually are equivalent to function definitions used in procedural languages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Messages

A
  • Objects perform operations in response to messages
  • Non specific function calls can respond to Message in different ways (different from subroutine call.)
  • Methods are similar to functions procedures or subroutine in more traditional programming languages, such as Cobal, Basic, or C
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Encapsulation or information hiding

A
  • Principle of concealing internal data and procedures of an object and providing an interface to each object in such a way to reveal as little as possible about its inner working to the user.
  • This means users can use the object by calling the objects methods, but cannot see inside of the object capsule
  • Is the design goal of OO system
  • Rather than Allowing an object access another objects data directly A message is sent to the target object requesting information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Inheritence

A
  • Property of oo sys, that allows obj to be built from other obj
  • Inheritance relationship between classes where one Class is the parent(base class or super class) of the another class(derived or child class)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

dynamic inheritence

A
  • Technique where inheritance relationships between classes can change at runtime, rather than being fixed at the compile time
  • The change can be the relationship between parent and child classes, or flexibility to Add delete or change objects In parent or child at the runtime or even change the parent itself

Techniques to implement:
1. Delegation
Rather than class inheriting methods directly, it delegates the responsibility to another object that can change at the runtime
2. prototypes
Some languages like javascript use prototype based inheritance where objects can change their prototypes(parents) at runtime
3. composition
Rather than delegation, you can mimic dynamic inheritance behaviour
4. dynamic class modification
In some advanced scenarios languages like python allow modifying the base class of an object during runtime, thus changing the inheritance structure can be easy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

multiple inh

A

Some OO systems permit a class to inherit its states (attributes) and behaviours from more than one super class or parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

polymorphism

A
  • Poly means many and morph means form
  • Object that can take on many different forms
  • polymorphism means that same operation may behave differently on different classes
  • According to Booch, Polymorphism is a relationship of objects of many different classes by some common super class
17
Q

obj relationship

A
  1. generalization (parent-child relationship)
    - Used for abstracting details in several layers
  2. Association (rel^nship b/w objs/clses)
    - Can be bidirectional(Can be traversed in both directions perhaps with different connotations)
    i. aggregation(whole/ part of relationship)
    Each object has an identity One object can refer to other objects
    ii. composition(strong form of aggregation)
18
Q

generalization

A

parent class
▲(open)

child cls

  • parent/ child rel^nshp among related clses
  • used for abstracting details on several lyrs
19
Q

association

A
  • Represents relationship between objects and classes, Instance of one class is related with the instance of another class
  • Associations are bidirectional They can be traversed in both directions perhaps with different cannotations(<—->).
  • Forward direction
  • inverse direction
  • Important issue in association is cardinality, Which specifies how many instances of one class may relate to single instance of an associated class.
    There are two types of Associations:
    1. Aggregation
    2. Composition
20
Q

Aggregation

A

-Whole - part relationship Wear one glasses made up of multiple objects from another class
- It indicates that one class (whole) is composed of one or more instances of another class (part) but parts can exist independently of whole.
—-<>

21
Q

Composition

A

Strong former association that represents whole part relationship where part cannot exist independently of whole
- Parts are tightly bound to the lifecycle of the whole. And if hole is destroyed, the parts are also destroyed
—-◆

22
Q

diff b/w aggr and composition

A

Aggregation (empty diamond): The parts can exist without the whole. For example, Players can exist without being part of a Team.
Composition (filled diamond): The parts cannot exist without the whole. For example, Rooms cannot exist without a House.

23
Q

object Identity

A

Special feature of oo system is That every object has its own unique and immutable identity
- This comes into being when an object is created and continues to represent that object from then on
- This identity never is confused with another object, even if the original object has been deleted
- In object system object identity often is implemented through some kind of object identifier (OID) or unique identifier (UID)

24
Q

static and dynamic binding

A

static binding(early binding)
process of determining which functions to invoke at the compile time
characteristics:
1. Faster than dynamic binding
2. Once method is bound, cannot be changed at runtime
3. Applicable to private static and final methods
4. Polymorphism is not supported

dynamic binding(late binding)
Process of determining which functions to invoke at runtime
characteristics:
1. Flexibility (supports polymorphism)
2. Time taking
3. Applicable to overridden methods in subclasses.

25
Q

persistence

A
  • Objects have a lifetime
  • They are explicitly created and can exist for a period of time that has been given during the creation
  • An object can persist beyond application session boundaries, during which the object is stored in file or database. In some files or database form.
  • The object can be retrieved in any other application session, and will have same state and relationship to the other objects as of the time it was saved
  • Lifetime of an Object can be explicitly terminated
26
Q

metacls

A
  • Classes that define the behaviour of other classes
    1. Dynamic class creation
    2. class behaviour modification