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.

<strong>Caché</strong> 2012.1 <strong>Upgrade</strong> Checklist2.2.5.2 Improvements To Class Dependency RecognitionThe class compiler sorts the list of classes to compile into two main types: hard dependencies where one class needs anotherclass to be fully compiled and runnable in order for it to compile (indicated by the keyword DependsOn); and soft dependencieswhere the other class needs to be compiled as part of the same set, but it does not need to be runnable (such assuperclasses).The dependency resolution code first sorts out the hard dependencies. Then it resolves the soft dependencies in each group.The resolution of these hard dependencies requires that we bring over any soft dependencies into the same group. Forexample if class A DependsOn class B, then class B must be compiled earlier than class A. However, if class B has superclassC, then C must also go into this earlier group too, otherwise <strong>Caché</strong> cannot compile B.The code that resolves the hard dependencies now also recursively checks each item's soft dependencies to ensure that noneof these soft dependencies have a hard dependency before it inserts the item into the proper order. Under some rare circumstances,it is possible this change could result in some classes which appeared to compile cleanly in prior releases reportinga compile dependency error. If this occurs, it is because there is a real dependency cycle, but the previous version of thecode was not detecting this correctly.2.2.5.3 Resolution Of Ambiguous ReferencesIn the case where a multidimensional property and a method share the same name, for example,Class Objects.Test Extends %Persistent{Property Uncertain As %String [ MultiDimensional ];Method Uncertain(a As %String, b As %String) As %String{Quit "Uncertain Method Return"}}the ambiguity of the expression “Uncertain(foo, bar)” will depend on context. When the expression is the receiver of avalue (left of the equal sign), it will be treated as a multidimensional value, that is, the statementsSet obj = ##class(Objects.Test).%New()Set obj.Uncertain("A", "B") = "Some string"Write obj.Uncertain("A", "B")will store the value “Some string” in the multidimensional array Uncertain of the instance referenced by obj.But when it is the supplier of a value (right of the equals), the same reference will be resolved to the method. Thus, in theexample given, the value, “Uncertain Method Return”, will be written to the output device.Note:Though a questionable programming practice because of the ambiguity in usage, the class compiler will not reportthis as an error.2.2.5.4 Re-Enable Checking For Instance References In ClassMethodsIf an application makes a reference to a local method, such as,Write ..Method()the class compiler checks that this method exists, and that it is invoked from an instance method, not a classmethod. Similarchecks are done for properties. Due to an error in version 2011.1, this checking was disabled. It is now operational again,with the effect that some classes that (incorrectly) compiled successfully in 2011.1 will now fail to compile in this version.24 <strong>Caché</strong> <strong>Upgrade</strong> <strong>Checklists</strong>

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

Saved successfully!

Ooh no, something went wrong!