Skip to main content

Glossary

Terms and definitions

📄️ Abstraction

Abstraction is the process of removing unnecessary details or complexities from a system or concept in order to focus on the essential characteristics or functionality. This allows for a more general or high-level view of the system or concept, which makes it easier to understand and manipulate. Abstraction is often used in computer science, where it is applied to various levels of a system, from the design and implementation of algorithms and data structures, to the design and use of software interfaces.

📄️ Composition

Composition is a concept in object-oriented programming where a class is made up of other classes. This allows for code reuse and flexibility, as a class can be composed of multiple classes that each have their own specific functionality. For example, a Car class can be composed of a Wheel class, an Engine class, and a Door class, each with their own methods and attributes. This allows the Car class to have all of the functionality of its composed classes without having to duplicate code.

📄️ Inheritance

Inheritance is the ability of a class to inherit characteristics and behavior from another class. This allows for code to be organized into a hierarchy of classes, where common behavior and attributes can be defined in a base class and then inherited by subclasses. This allows for code to be more reusable and maintainable, as subclasses can easily inherit and extend the behavior of their parent class. For example, a Vehicle class might define common attributes and behavior for all vehicles, such as a speed attribute and a move method. Then, specific types of vehicles, such as Car and Bike, could inherit from Vehicle and define their own unique behavior.

📄️ Inversion of Control

Inversion of control is a design principle in object-oriented programming where the flow of control is inverted compared to traditional procedural programming. In traditional programming, the code tells the program what to do, but in inversion of control, the program tells the code what to do. This is often achieved through the use of design patterns such as the factory pattern and the dependency injection pattern. Inversion of control allows for more modular and flexible code, as it decouples the different components of a program and allows them to be easily replaced or extended.

📄️ Object Orientated Programming

Object-oriented programming (OOP) is a programming paradigm that is based on the concept of "objects", which are data structures that contain both data and behavior. In Ruby, OOP is implemented through the use of classes, which define the structure and behavior of objects. These classes can be organized into hierarchies through inheritance, where a subclass can inherit characteristics and behavior from a parent class. OOP allows for code to be more modular, reusable, and maintainable, as objects can be easily created and manipulated, and common behavior can be defined and inherited across classes.

📄️ Polymorphism

Polymorphism is the ability of different objects to respond to the same method or message in different ways. This allows for objects to be treated uniformly, regardless of their specific type or class. For example, a collection of shapes (circles, squares, triangles, etc.) can all respond to the same area method, but each will calculate the area differently based on its specific type. This allows for code to be more reusable and maintainable, as new types of objects can be easily added without having to change existing code.