1/20
22 flashcards covering programming paradigms, the entity-attribute-value model, storage and states of objects, class vs. object, and key characteristics and advantages of object-oriented programming.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is a programming paradigm?
A style or approach to computer programming that dictates how solutions to problems should be formulated in a programming language.
Name five major programming paradigms and one language that exemplifies each.
Procedural (C), Functional (Haskell), Logical (Prolog), Object-Oriented (Java), Descriptive (HTML).
Which two paradigms are explicitly supported by C++?
Procedural programming and object-oriented programming.
Give an example of a language designed mainly for functional programming.
Haskell.
What trio do computer scientists use to describe real-world data?
In OOP, what does the ‘entity’ in the trio
The object.
How are objects represented in computer memory?
As sets of attribute/value pairs, occupying their own memory space allocated at creation.
Why are primitive types important when storing objects in memory?
Because their sizes are known in advance, allowing precise allocation for attribute values such as integers, reals, or characters.
What is meant by the ‘active version’ of an object?
The state in which an object changes, moves, or interacts with other objects (e.g., a car stopping when a traffic light turns red).
How do objects change state during a program’s execution?
Through inherent mechanisms (internal changes) or interactions with other objects (external events).
What ultimately limits an object’s lifecycle in an OOP program?
A succession of state changes culminating in its removal from main memory.
Define a class in object-oriented programming.
An abstract representation that describes the structure (attributes) and behavior (methods) common to similar objects.
Define an object (instance) with respect to its class.
A concrete realization of a class, such as ‘War and Peace’ for the class ‘Book’.
What shared characteristics allow multiple objects to be described by the same class?
Having the same structure (attributes) and the same behavior (methods).
According to the lecture, what does object-oriented programming (OOP) primarily consist of?
Defining and assembling software components called objects that interact with one another.
List the three intrinsic elements every object possesses.
Identity, internal structure (attributes), and behavior (methods).
Why does OOP facilitate team development of large projects?
Because it separates the ‘what’ (interface) from the ‘how’ (implementation), enabling clearer modularization.
What is an object’s interface?
The part of the object visible to other objects, describing how they can request its services.
What is an object’s implementation?
The internal details that fulfill the operations declared in its interface.
Name at least four fundamental concepts of the object-oriented paradigm highlighted in the lecture.
Object, messages, encapsulation, polymorphism, inheritance, and redefinition.
Why is OOP considered to align more naturally with real-world problems than procedural programming?
Because it models problems directly as interacting objects that reflect real-world entities, concepts, and their relationships.