concepts Flashcards
DevOps
Definition: a set of practices intended to reduce the time between committing a change to a system and the change being placed into normal production, while ensuring high quality
Daemon
Computer program that runs as a background process.
Hashing
Practice of using an algorithm to to transform a string of characters into a usually shorter fixed-length value or key that represents the original string. Hashing is used to index and retrieve items in a database because it is faster to find the item using the sorter hashed key than to find it using the original value
Zero-sum game
Mathematical representation of a situation in which an advantage that is won by one of two sides is lost by the other. If the total gains of the participants are added up, and the total losses are subtracted, they will sum to zero.
Encapsulation
Encapsulation is used to hide the values or state of structured data, preventing access in a way that could expose hidden implementation details
Abstraction
Data abstraction is the property by virtue of which only the essential details are displayed to the user. The trivial or the non-essentials units are not displayed to the user.
Example: Consider a real-life example of a man driving a car. The man only knows that pressing the accelerators will increase the speed of a car or applying brakes will stop the car, but he does not know about how on pressing the accelerator the speed is actually increasing, he does not know about the inner mechanism of the car or the implementation of the accelerator, brakes, etc in the car. This is what abstraction is.
Abstract classes
An abstract class allows you to create functionality that subclasses can implement or override. It cannot be instantiated, the purpose is to provide a common definition of a base class that multiple derive classes can share.
An abstract class is a class that has at least one abstract method. Abstract methods can only have names and aruguments. An abstract method is a method that is declared, but not implemented in the code.
To create object we need to create child classes that add the code into the bodies of the methods and use these child classes to create objects. All the abstract method must be defined by the child class.
Abstract method
An abstract method is a method that is declared, but not implemented in the code.
When inheriting from an abstract class, the child class method must be defined with the same name, and the same or a less restricted access modifier. So, if the abstract method is defined as protected, the child class method must be defined as either protected or public, but not private. Also, the type and number of required arguments must be the same. However, the child classes may have optional arguments in addition.
Expression
An expression is any valid unit of code that resolves to a value.
Conceptually, there are two types of expressions: those that assign a value to a variable and those that simply have a value.
The expression x = 7 is an example of the first type.
This expression uses the = operator to assign the value seven to the variable x. The expression itself evaluates to seven.
The code 3 + 4 is an example of the second expression type.
This expression uses the + operator to add three and four together without assigning the result, seven, to a variable.
Primitive data types
A primitive data type is pre-defined by the programming language. Non primitive data-types are not actualy defined by the programming language but are created by the programmer.
What is the difference between Method Overloading and Method Overriding?
Method overriding always needs inheritance. In method overloading, methods must have the same name and different signatures
What is the difference between an abstract class and an interface?
- Abstract classes can have access modifiers but interface methods are implicitly public and abstract.
- Interfaces are used to define contract for the subclasses whereas abstract classes also define a contract but it can provide other methods implementations for subclasses to use.
I see it like abstract class is and
interface can do
Interface
A person at the same time can have different charactericts. Like a man at the same time is a father, a husband, an employee. So the same person posesses different behavior in different situtations.
Polymorphism
Having multiple forms.
In OOP, describes situations in which something occurs in several different forms.
It can be implemented through method overloading/overriding (through interfaces or abstract classes)
What types of inheritance exist?
Single inheritance.
Multi-level inheritance.
Multiple inheritance.
others:
Multipath inheritance.
Hierarchical Inheritance.
Hybrid Inheritance.
What does it mean when developers say “Composition over inheritance”?
Instead of object is a… the object will have a …..
Object composition is a different method of reusing functionality. Objects are composed to achieve more complex functionality. This approach requires that the objects have well-defined interfaces since the internal objects are unknown.
Composition allows decoupling, making it easy to swap components.
We use composition through dependency injection