OODI PRINCIPLES Flashcards

1
Q

Does D’Janae like you?

A

yes,yes she does!

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

Aside from code reuse, explain using an example, ONE benefit of inheritance.

A

it reduces redundances

makes code more simple

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

Discuss two ways in which information hiding can be implemented in an object-oriented programming language?

A
  1. By using access modifiers

2. Through encapsulation

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

Explain why it is problematic to utilize inheritance in cases where the inheritance litmus test has not been passed

A

If an entity fails the litmus test then it is not an appropriate type of a particular entity, there might be certain methods in the superclass that will not coincide with the entity and this may cause unpredictable behavior.

example: assigned a plant to an animal superclass, a method might exist called oral sound and a plant is not able to produce oral sounds

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

a)If you are using a language which does not permit attributes in the public
interface, how can you achieve the same effects using messages to access the
data?
b)How can you achieve the same effects even in a language that does permit attributes in interfaces?
c)Are there any disadvantages to this approach

A

a)creating getters and setters
b)
c)

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

Explain the litmus test for inheritance and aggregation

A

The litmus test finds the purest form of inheritance and aggregation by asking the “is a” and “has a” questions, respectfully.

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

Give an example of a situation where a programmer may erroneously utilize
inheritance rather than aggregation to achieve code reuse.

A

sometimes people in an effort to benefit from reuse attempt to utilize inheritance to inherit code they would like to include in a new class. An example is where a scheduler is required to create a schedule and might make the class a subclass of a calendar. A schedule is not a calendar however you could use parts of the calendar in your code through aggregation.

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

What is the purpose of an interaction diagram?

A

Visualize the order of messages being passed among runtime participants (objects, servers databases), providing context for lifelines
in a system.

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

Describe the parts of a sequence diagram

A

https://creately.com/blog/diagrams/sequence-diagram-tutorial/#:~:text=A%20sequence%20diagram%20is%20structured,them%20are%20represented%20by%20arrows.

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

How is a communication diagram different from a sequence diagram?

A

A communication diagram offers the same information as a sequence diagram, but a sequence diagram emphasizes the time and order of events, a communication diagram emphasizes the messages exchanged between objects in an application.

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

SOLID?

A
S - Single Responsibility - one class should only have one main responsibility and there should only be one reason why you should change that code
O - Open - Close Principle: Open for extension but closed for modification
L - Liskov Substitution Principle: This means that every subclass or derived class should be substitutable for their base or parent class.
I - Interface Segregation Principle: A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use.
D - Dependency Inversion Principle: It states that the high-level module must not depend on the low-level module, but should depend on abstractions. Program to an interface and never to an implementation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

YAGNI?

A

You ain’t gonna need this

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

DRY?

A

Dont Repeat Yourself

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

GRASP?

A

General Responsibility Assignment Software Patterns

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

Why is Software Architecture Important

A

An architecture will inhibit or enable a system’s driving quality attributes.
• The decisions made in an architecture allow you to reason about and
manage change as the system evolves.
• The analysis of an architecture enables early prediction of a system’s
qualities.
• A documented architecture enhances communication among stakeholders.
• The architecture is a carrier of the earliest and hence most fundamental,
hardest-to-change design decisions.
• An architecture defines a set of constraints on subsequent implementation.
• The architecture influences the structure of an organization, or vice versa.

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