1.System Concepts for Object Modelling Flashcards
What is Encapsulation in OOP?
The concept of Packaging several items together into single unit known as a class.
The primary purpose of Encapsulation.
To hide the internal details of an object and to restrict access to its internal state.
Why is Encapsulation important in OOP?
- It reduces potential issues in software.
- It minimizes the changes to other objects if one malfunctions.
- Hiding operations decreases the need for modifications elsewhere.
What does Encapsulation ensure in object-oriented programming?
It ensures that attributes can only be accessed via well defined methods.
What is Inheritence in OOP?
The concept wherein methods and/or attributes defined in one class (Parent Class) can be inherited or reused by another class. (child/sub class).
What is Generalization?
(Gen)
A technique wherein the attributes and behaviors that are common to several types of classes are grouped / abstracted into their own class called a supertype.
What is Specialization?(spec)
(spec)
In addition to the attributes and methods that are shared by the super-class, a sub-class can have its own attributes an methods we call it Specialization.
Explain Polymorphism
The concept that different objects can respond to the same message in different ways.
(Allows the same service to have multiple forms.)
What are the two main categories of polymorphism?
- Overloading
- Overriding
What are the two types of Overloading?
- Method Overloading
- Operator/Function Overloading
(Number) Multiplication —> (String) Concatenation
What is Operator Overloading?
Same operator behaves differently based on the types of operand; we call it operator overloading.
Changing the way an operator behave.
What is Overriding?
It is the process where a subclass or a child class has its own implementation for a method that is defined by its parent.
What is Dynamic / Late Binding?
It is the concept where the type of the object created is determined at runtime.
What is Static Binding?
The binding which can be resolved at compile time by the compiler is known as static or early binding.
What is Abstraction?
A mechanism to reduce and filter out details so that one can focus on a few concepts at a time. Focus on Essentials,
Ignore the irrelevant.
Ignore the unimportant.
Filter out an object’s properties and operations until just
the ones you need are left
What is an Association?
A natural business relationship between two or more classes.