Object Oriented Design Flashcards

(15 cards)

1
Q

What are the main three categories of objects

A

Entity, Boundry and Control

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

What is an entity object

A

An object that cooresponds with a real world object. Example: Chair, Person, Bike

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

Give an example of a Boundry object

A

A Submit button on a page or a Service that makes a call to an api

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

What is CRC and what does it stand for?

A

Is a technique (Class, Responsibility, Collaborator) thats used to represent information about Components, their connections and responsibilities.

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

Can you give an example for a CRC card using a Bank User?

A

Bank User is the class, responsibilities would insert card and choose a task, the collaborator is the Bank Machine, Bank Card

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

Name the four design principles

A

Abstraction, Encapsulation, Decomposition, Generalization

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

Describe Abstraction

A

Idea of simplifying a concept to its essentials within some context

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

Describe encapsulation

A

Involves 3 ideas:

  1. Making some sort of capsule that has details on the inside which some of them you can access from the outside.
  2. You expose certain data and functions of that object
  3. You can restrict access to certain data and methods

Forms a self-contained object by bundling data and function it requires to work. Exposes an interface whereby other objects can access and use it and restricts access to certain details.

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

Describe decomposition

A

Taking something as a whole and dividing it up into different parts.

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

What are the three relationships in decomposition

A

Association, Aggregation, Composition

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

What does a decomposition association mean?

A

It is some relationship. There is a loose relationship between two objects. Objects interact with each other for some time.

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

What is decomposition Aggregation?

A

It is a has-a relationship where a whole has parts that belong to it. This is a weak relationship. Parts can belong to wholes but can also exist independently.

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

What is Composition?

A

An exclusive containment of parts. A strong “has-a” relationship. The whole cannot exist without the part.

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

How can a protected attribute be accessed?

A
  1. By the encapuslating class
  2. All Subclasses
  3. All classes within the same package
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In what way can you implement Polymorphism in OOP?

A

By using interfaces

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