Summary
In object-oriented programming (OOP), the object lifetime (or life cycle) of an object is the time between an object's creation and its destruction. Rules for object lifetime vary significantly between languages, in some cases between implementations of a given language, and lifetime of a particular object may vary from one run of the program to another. In some cases, object lifetime coincides with variable lifetime of a variable with that object as value (both for static variables and automatic variables), but in general, object lifetime is not tied to the lifetime of any one variable. In many cases – and by default in many object-oriented languages, particularly those that use garbage collection (GC) – objects are allocated on the heap, and object lifetime is not determined by the lifetime of a given variable: the value of a variable holding an object actually corresponds to a reference to the object, not the object itself, and destruction of the variable just destroys the reference, not the underlying object. While the basic idea of object lifetime is simple – an object is created, used, then destroyed – details vary substantially between languages, and within implementations of a given language, and is intimately tied to how memory management is implemented. Further, many fine distinctions are drawn between the steps, and between language-level concepts and implementation-level concepts. Terminology is relatively standard, but which steps correspond to a given term varies significantly between languages. Terms generally come in antonym pairs, one for a creation concept, one for the corresponding destruction concept, like initialize/finalize or constructor/destructor. The creation/destruction pair is also known as initiation/termination, among other terms. The terms allocation and deallocation or freeing are also used, by analogy with memory management, though object creation and destruction can involve significantly more than simply memory allocation and deallocation, and allocation/deallocation are more properly considered steps in creation and destruction, respectively.
About this result
This page is automatically generated and may contain information that is not correct, complete, up-to-date, or relevant to your search query. The same applies to every other page on this website. Please make sure to verify the information with EPFL's official sources.
Related courses (32)
PHYS-101(en): General physics : mechanics (English)
Students will learn the principles of mechanics to enable a better understanding of physical phenomena, such as the kinematics and dyamics of point masses and solid bodies. Students will acquire the c
CS-411: Digital education
This course addresses the relationship between specific technological features and the learners' cognitive processes. It also covers the methods and results of empirical studies on this topic: do stud
HUM-413: Industrial design II
Le cours propose d'expérimenter les spécificités du design industriel en confrontant les étudiant.e.s à la création d'un objet. Il s'agit d'un enseignement pratique dont le résultat est un objet fonct
Show more
Related lectures (167)
Designing Learning Experiences: CS411 Class Project
Introduces the CS411 Class Project, where students design and test a lesson using learning theories.
Newton's Laws: Fundamentals
Explores Newton's laws of motion, fundamental forces in nature, and the unification of interactions.
Thermal Bridges in Building Design
Explores the impact of materials and construction techniques on heat transfer in buildings.
Show more
Related publications (153)

Match Normalization: Learning-Based Point Cloud Registration for 6D Object Pose Estimation in the Real World

Mathieu Salzmann, Zheng Dang, Yu Guo

In this work, we tackle the task of estimating the 6D pose of an object from point cloud data. While recent learning-based approaches have shown remarkable success on synthetic datasets, we have observed them to fail in the presence of real-world data. We ...
Ieee Computer Soc2024

Wave-momentum shaping for moving objects in heterogeneous and dynamic media

Romain Christophe Rémy Fleury, Matthieu Francis Malléjac, Bakhtiyar Orazbayev, Stefan Rotter

Light and sound waves can move objects through the transfer of linear or angular momentum, which has led to the development of optical and acoustic tweezers, with applications ranging from biomedical engineering to quantum optics. Although impressive manip ...
2024

Test-time adaptation for 6D pose tracking

Andrea Cavallaro

We propose a test -time adaptation for 6D object pose tracking that learns to adapt a pre -trained model to track the 6D pose of novel objects. We consider the problem of 6D object pose tracking as a 3D keypoint detection and matching task and present a mo ...
Elsevier Sci Ltd2024
Show more
Related concepts (16)
Finalizer
In computer science, a finalizer or finalize method is a special method that performs finalization, generally some form of cleanup. A finalizer is executed during object destruction, prior to the object being deallocated, and is complementary to an initializer, which is executed during object creation, following allocation. Finalizers are strongly discouraged by some, due to difficulty in proper use and the complexity they add, and alternatives are suggested instead, mainly the dispose pattern (see problems with finalizers).
Variable (computer science)
In computer programming, a variable is an abstract storage location paired with an associated symbolic name, which contains some known or unknown quantity of data or object referred to as a value; or in simpler terms, a variable is a named container for a particular set of bits or type of data (like integer, float, string etc...). A variable can eventually be associated with or identified by a memory address. The variable name is the usual way to reference the stored value, in addition to referring to the variable itself, depending on the context.
Declaration (computer programming)
In computer programming, a declaration is a language construct specifying identifier properties: it declares a word's (identifier's) meaning. Declarations are most commonly used for functions, variables, constants, and classes, but can also be used for other entities such as enumerations and type definitions. Beyond the name (the identifier itself) and the kind of entity (function, variable, etc.), declarations typically specify the data type (for variables and constants), or the type signature (for functions); types may also include dimensions, such as for arrays.
Show more
Related MOOCs (6)
Projet de programmation en java
The purpose of this MOOC is to offer a complementary capstone project to our existing MOOCs in introduction to programming. This will offer the students the possibility to both stabilize the already a
Introduction to Object-Oriented Programming in Java
Le cours suivi propose une introduction aux concepts de base de la programmation orientée objet tels que : encapsulation et abstraction, classes/objets, attributs/méthodes, héritage, polymorphisme, ..
Show more