Mapping Object Orieted Concept using Non-Object Oriented Language
Duration: 10 min
This video lesson is available to enrolled students.
Enroll to watch — UP LT Grade Assistant Teacher 2025 Computer Science Course
AI summary & chapters
AI Summary
An AI-generated summary of this video lecture.
The lecture covers the process of mapping object-oriented concepts into non-object-oriented languages. Key topics include translating classes into data structures, passing arguments to methods, allocating storage for objects, implementing inheritance, and handling method resolution. The instructor uses slides and handwritten annotations to explain how OOP features like state, identity, and polymorphism can be adapted for procedural programming.
Chapters
0:00 – 2:00 00:00-02:00
The lecture begins with the topic 'Mapping object oriented concepts using non-object oriented language'. The first major step presented on the slide is 'Translate classes into data structures'. The instructor explains that in a non-object-oriented language, a class is implemented as a single contiguous block of attributes. She highlights that each attribute contains a variable, giving the object state and identity. She writes 'class student' and 'struct student' on the screen to demonstrate how a class definition maps to a structure definition. The slide notes that a variable identifying an object must be implemented as a sharable reference. The instructor underlines 'single contiguous block of attributes' and 'variable' to emphasize these structural requirements. She explains that this mapping allows the object to have state and identity, which are subject to side effects. This foundational step sets the stage for understanding how object-oriented principles are adapted for procedural languages. The slide also mentions that an object has state and identity and is subject to side effects, which is a key characteristic of objects in OOP.
2:00 – 5:00 02:00-05:00
The second step discussed is 'Pass arguments to methods'. The slide states that every method has at least one argument. In a non-object-oriented language, this argument must be made explicit. The instructor writes 'methods + argument' to illustrate that the object itself is passed as an argument. She explains that if a method contains additional objects as arguments, a reference must be passed if the value needs to be updated. The third step is 'Allocate storage for objects'. The slide lists options: statically, dynamically, or on a stack. The instructor writes 'memory allocation' and 'static' and 'dynamic' on the screen. She notes that temporary and intermediate objects are often stack-based, while dynamically allocated objects are used when the number is unknown at compile time. She mentions that a general object can be implemented as a data structure allocated on request from a heap. This section clarifies how memory management differs in non-OOP contexts compared to automatic garbage collection in OOP languages. The slide specifically mentions that objects can be allocated statically, dynamically, or on a stack, providing flexibility in implementation.
5:00 – 9:32 05:00-09:32
The lecture progresses to 'Implement inheritance in data structures'. The slide lists three ways to handle this: avoid it, flatten the class hierarchy, or break out separate objects. The instructor draws a diagram showing a 'Parent' and 'Student' relationship to explain hierarchy. She writes 'polymorphism' and 'overloading' on the screen. The next section is 'Implement method resolutions'. The slide lists avoiding it, resolving at compile time, or resolving at run time. The instructor writes 'static binding' and 'dynamic binding' to explain these concepts. She mentions that method resolution is a main feature lacking in non-object-oriented languages. Finally, she briefly touches on 'Implement associations' and 'Deal with concurrency'. She writes 'Java | python -> synchronization' to note that concurrency is usually needed only when more than one external event occurs. This part of the lecture provides practical strategies for adapting OOP features like inheritance and polymorphism into procedural code structures. The slide also mentions that method resolution is one main feature of an object-oriented language that is lacking in a non-object-oriented language.
The video provides a comprehensive guide on bridging the gap between object-oriented design and non-object-oriented implementation. It systematically breaks down the process into translating classes to data structures, managing method arguments, and handling memory allocation. The instructor uses handwritten annotations and diagrams to clarify abstract concepts like inheritance flattening and method resolution. By covering storage allocation strategies and concurrency handling, the lecture offers a practical approach to implementing OOP concepts in languages like C or older procedural languages. The emphasis on explicit references and memory management highlights the fundamental differences in how these paradigms handle object identity and state. The lecture concludes by addressing associations and concurrency, showing how even complex OOP features can be mapped to procedural constructs.