• Publicity: Public Only All

10-recreation-procs.tcl

XOTcl functionality for handling recreation of objects Support for the recreation of classes objects without destroying foreign references. Normally, when a class definition is reloaded, the class is destroyed and created again with the same name. During the destruction of a class several references to this class are removed (e.g. in a class hierarchy, the relation from instances to this class, etc.). XOTcl provides support for altering this behavior through the recreate method.

This file defines the following Objects and Classes: ::xotcl::RecreationClass[i]

Location:
packages/xotcl-core/tcl/10-recreation-procs.tcl
Created:
2005-05-13
Author:
Gustaf Neumann <neumann@wu-wien.ac.at>
CVS Identification:
$Id: 10-recreation-procs.tcl,v 1.13.2.4 2020/08/26 18:50:43 gustafn Exp $

Procedures in this file

Detailed information

Class ::xotcl::RecreationClass (public)

 ::xotcl::Class ::xotcl::RecreationClass[i]

This meta-class controls the behavior of classes (and optionally their instances), when the classes (or their instances) are overwritten by same named new objects; we call this situation a recreate of an object.

Normally, when files with e.g. class definitions are sourced, the classes and objects are newly defined. When e.g. class definitions exists already in this file, these classes are deleted first before they are newly created. When a class is deleted, the instances of this class are changed into instances of class ::xotcl::Object.

This can be a problem when the class instances are not reloaded and when they should survife the redefinition with the same class relationships. Therefore, we define a meta class RecreationClass, which can be used to parameterize the behavior on redefinitions. Alternatively, Classes or objects could provide their own recreate methods.

Per default, this meta-class handles only the class redefinition case and does only a reconfigure on the class object (in order to get e.g. ad_doc updated).

The following parameters are defined:
  • reconfigure: reconfigure class (default 1)
  • reinit: run init after configure for this class (default unset)
  • instrecreate: handle recreate of class instances (default unset) When this flag is set to 0, instreconfigure and instreinit are ignored.
  • instreconfigure: reconfigure instances of this class (default 1)
  • instreinit: re-init instances of this class (default unset)

Partial Call Graph (max 5 caller/called nodes):
%3 nsf::object::alloc nsf::object::alloc nsf::relation::set nsf::relation::set nx::slotObj nx::slotObj Class ::xotcl::RecreationClass Class ::xotcl::RecreationClass Class ::xotcl::RecreationClass->nsf::object::alloc Class ::xotcl::RecreationClass->nsf::relation::set Class ::xotcl::RecreationClass->nx::slotObj

Testcases:
No testcase defined.
[ show source ]