13.07.2015 Views

Caché Upgrade Checklists - InterSystems Documentation

Caché Upgrade Checklists - InterSystems Documentation

Caché Upgrade Checklists - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Developers$ZCVT("%C0", "I", "URL") = $C(192)make a round trip using the URL translation valid for all characters.3.2.4 Class Changes3.2.4.1 Larger Class LimitsBeginning with this release the system now supports a larger class descriptor. This means that classes now can support alarger number of members declared in the class. The limits on class inheritance depth, and the number of superclassesallowed have also been defined. A complete list of the applicable bounds can be found in the Using <strong>Caché</strong> Objects documentation.3.2.4.2 Error Reporting ChangesThe standard <strong>Caché</strong> mechanism for returning an error is to use the $$$ERROR macro with a standard message. In manycases, the message contained only a description of the error without any context information. Several messages, includingthe “object to load not found” message now include the classname where the error was encountered. It is possible thatsome SQL storage applications may have to be changed to recognize the new format.3.2.4.3 Update Of Class Dictionary To Level 25 – LegacyInstanceContextThis version of <strong>Caché</strong> updates the version of the class dictionary to level 25. Among opther changes, this introduces theLegacyInstanceContext class keyword wose presence indicates that the class relies on generated code that passes %this asthe first argument to instance methods. This was previously announced in 2009 in the Compatibility Blog.As an aid, the class dictionary upgrade looks for references to %this. It scans both code and comments in case there areusages of $XECUTE and $TEXT even though this may result in false positives. If it finds any such references, it marksthe class as needing LegacyInstanceContext so the compiler will continue to generate code to pass %this as the first argumentto instance methods.If no instances of %this are found, then the class is not marked LegacyInstanceContext so instance methods will no longerassume %this is passed as the first argument.This approach does not, however, uncover separate code that assumes %this exists and is properly set. Consider a classwith a method that calls an external routine such as:method Test(){Quit $$Func^Routine()}where Routine is:Func () public {Quit %this.Name}Because the use of %this will not be discovered in the scan of the class (it is external to that source), it will not be markedas LegacyInstanceContext. Subsequent execution may result in an error; in much harder-to-debug situations,%this may be pointing to the wrong context or not at an object instance at all.All new code should rely on $this for context; %this will not be set for new classes as it is deprecated.. All older classesmarked as LegacyInstanceContext=1 will continue to behave the same as in previous releases.No change is necessary to existing classes because of LegacyInstanceContext. However, if you do want to update a class,the steps are as follows:1. Replace all occurrences of %this with $this in a given application.<strong>Caché</strong> <strong>Upgrade</strong> <strong>Checklists</strong> 43

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!