4. Object Model Flashcards

(36 cards)

1
Q

What is Object-Oriented Programming (OOP)?

A

OOP is a programming paradigm based on “objects” which contain both data (attributes/properties) and code (methods/functions). Objects are instances of classes.

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

What is Object-Oriented Design (OOD)?

A

OOD is the process of using objects and object-oriented programming principles when designing a software solution.

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

What is an “object” in OOP?

A

An object is an instance of a class. It contains data (attributes) and code (methods) that operate on that data.

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

What is a “class” in OOP?

A

A class is a blueprint or template that defines the type and structure of objects. Objects are created as instances of classes.

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

How do objects interact in OOD?

A

Objects interact by one object (the “client”) calling a method of another object (the “server”). The method call is the message.

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

What is a “method signature”?

A

A method signature defines a method, including its name, the parameters it accepts (inputs), and their data types.

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

What is an object’s “interface”?

A

An object’s interface is the set of all its method signatures. It defines the “services” the object offers.

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

What is “Information Hiding”?

A

Information Hiding is the principle where an object hides its internal state (attributes) and restricts access to them only through its public interface (methods).

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

What is “Modularity” in software design?

A

Modular programming is a design technique that emphasizes separating a program’s functionality into independent, interchangeable modules (packages).

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

What is the main difference between modules and objects regarding data access?

A

Modules can have “promiscuous” access to data, often leading to misuse. Objects encapsulate data, providing controlled access through methods.

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

What is UML?

A

UML (Unified Modeling Language) is a standardized visual language used in software engineering to represent different aspects of a system’s structure and behavior.

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

Name three types of UML diagrams.

A
  1. Class Diagrams
  2. Use Case Diagrams
  3. Sequence Diagrams
  4. Activity Diagrams
  5. State Machine Diagrams
  6. Component Diagrams
  7. Deployment Diagrams
  8. Package Diagrams
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the purpose of a Class Diagram in UML?

A

To represent the structure of a system by showing classes, their attributes, methods, and the relationships between those classes.

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

What is the purpose of a Use Case Diagram in UML?

A

To illustrate interactions between actors (users or external systems) and the system to achieve specific goals.

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

What is the purpose of a Sequence Diagram in UML?

A

To depict interactions between objects in a scenario or use case over time, showing the order of messages.

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

What is the purpose of an Activity Diagram in UML?

A

To model the flow of activities or actions within a system or use case.

17
Q

What is the purpose of a State Machine Diagram (or State Diagram) in UML?

A

To describe the different states of an object or system and the transitions between those states that are triggered by events.

18
Q

What is the purpose of a Component Diagram in UML?

A

To show the components (modular parts) of a system and their relationships, dependencies, and interfaces.

19
Q

What is the purpose of a Deployment Diagram in UML?

A

To visualize the physical deployment of software components across hardware nodes (e.g., servers, devices).

20
Q

What is the purpose of a Package Diagram in UML?

A

To organize and structure the elements (like classes or use cases) of a system into logical groupings called packages.

21
Q

What are the three compartments in a UML class notation?

A
  1. Class Name
  2. Attributes
  3. Operations (Methods)
22
Q

What is “Association” in UML object relationships?

A

Association means one object accesses another in some way (e.g., calling a method, accessing an attribute).

23
Q

What is “Inheritance” (or Generalization) in UML?

A

Inheritance is when an object (derived class) inherits the properties of another object (base class). It represents an “is a” relationship.

24
Q

What is “Composition” in UML?

A

Composition is when an object references another object as an instance variable, implying the child class cannot exist without the parent. It represents a “has a” relationship.

25
What is "Aggregation" in UML?
Aggregation is similar to composition, but implies the child class can exist independently of the parent class.
26
What is "Polymorphism" in OOP?
Polymorphism ("many forms") is the ability of objects of different classes to be treated as objects of a common superclass, allowing a single interface to be used for entities of different types.
27
What is "Duck Typing"?
Duck Typing is a concept where an object's type/class is less important than the methods it defines. "If it walks like a duck and quacks like a duck, then it must be a duck."
28
What are the two main types of polymorphism?
1. Compile-time Polymorphism (Static Binding/Early Binding) e.g., method overloading. 2. Runtime Polymorphism (Dynamic Binding/Late Binding) e.g., method overriding.
29
What is "Method Overriding"?
Method overriding involves redefining a method in a subclass that is already defined in its superclass. This is a form of runtime polymorphism.
30
What is "Method Overloading"?
Method overloading (or ad-hoc polymorphism) refers to having multiple implementations of a method with the same name but different parameters (arguments). This is a form of compile-time polymorphism.
31
What are two advantages of using OOD?
1. Modularity and reusability make development easier, faster, and more productive. 2. Modularity makes systems easier to maintain.
32
How does Object-Oriented design differ from Process-Oriented design in its focus?
Process-Oriented is more intuitive and person-centric (x happens then y). Object-Oriented is organization-centric, designed to scale by dividing labor among objects, which can be more complex to initially design.  
33
What is "Traceability" in software design?
Traceability is the ability to trace the evolution of a software system step-by-step, from requirements to code, always being able to answer "why is this here?"
34
What is Test-Driven Development (TDD)?
TDD is an approach where software requirements are converted to test cases before the software is fully developed. Developers should know how an artifact will be tested before creating it.
35
What does "Measurability" refer to in the context of good OO system design?
It refers to measuring the quality of the software (e.g., usage, bugs, performance) and the productivity of development (e.g., Scrum points).
36
Why is security an important consideration in OOD?
Security issues can arise from poorly designed code or interconnectivity. Security needs may also conflict with other requirements like ease of use.