Object‐Oriented Programming - Gr8-Tools/game-developer-roadmap-doc GitHub Wiki
Total time: 1 hour
Object-Oriented Programming (OOP) is a programming paradigm based on the concept of "objects," which can contain data and code. The key principle of OOP is to organize software design around "objects" which represent real-world entities.
Subtopics and Definitions
- Class - A blueprint for creating objects. It defines attributes and behaviors that the objects of the class will have.
- Object - Instances of classes that contain data and code to manipulate the data. Objects are the basic units of OOP.
- Encapsulation - The bundling of data with the methods that operate on that data. It is used to restrict direct access to some of the object's components.
- Inheritance - The mechanism allowing a new class to inherit properties and behavior from an existing class. It promotes code reusability and is a part of class hierarchy.
- Polymorphism - The ability of objects to take on multiple forms. In OOP, it refers to the ability of a message or data to be processed in more than one form.
- Composition - The "strong" form of association where the parts are dependent on the whole. This means that if the whole object is destroyed, all of its parts are also destroyed. The composed object does not exist independently of the whole. For example, a car and its engine can be modeled using composition. The engine is a part of the car and cannot exist on its own.
- Aggregation - A "weaker" form of association where the parts can exist independently of the whole. In this type of relationship, the part object's lifecycle is not managed by the whole. For instance, a university and its departments can be represented using aggregation. The departments can exist and function independently from the university.
By understanding and applying these key principles and subtopics of object-oriented programming, developers can create more modular, reusable, and scalable code, thus improving the overall design and maintenance of software systems.
Additional materials
Video
- OOP on simple principles - cool Russian video that can't be missed
40 minutes