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.

Developers11.2.6.10 Methods Supporting SQLCOMPUTECODE<strong>Caché</strong> allows classes to define SQL computed properties by declaring them with the attribute, SQLCOMPUTED, andproviding SQL code to computed the desired value. The value can be transient, calculated or storable.For computed properties a Get() method is generated that invokes Compute() as needed. SQL-COMPUTECODE allows for other values to be referenced during computation. These references are to SQL columns(preserved for backward compatibility) and are converted to property names during method generation.If the SQL column references a column projected from an embedded class, then Compute() will generate anextended reference to the embedded property.Note:Using embedded properties in SQLCOMPUTE code breaks encapsulation. One problem with breaking encapsulationis with "triggered" computed fields, that is, when SQLCOMPUTEONCHANGE is declared. Embeddedproperty references are not supported in SQLCOMPUTEONCHANGE.11.2.6.11 Changes To Inheritance ProcessingIn previous versions, the inheritance rules for classes were not always as expected. For example, if a user created a class,User.MyClass, that was a subclass of %Library.Persistent, <strong>Caché</strong> would automatically inherit the default package name ofthe superclass, %Library, as a #import into User.MyClass. A consequence of this is that if User.MyClass contained a propertydeclared such asproperty A as String;<strong>Caché</strong> would try resolve this by looking in both the User and %Library packages. If User had a class, User.String, <strong>Caché</strong>would report a classname conflict even though the user probably intended to reference User.String. The workaround wasto fully qualify the property name as inproperty A as User.String;<strong>Caché</strong> 5.1 will still inherit any explicit #import settings from the superclasses, but it will not automatically add the superclasspackage names to the #import. So in the example given the A property would resolve to 'User.String' without any nameconflict errors.<strong>Caché</strong> still uses the current class packagename in resolving names; User.MyClass will still use 'User' as a #import for itsname. But this is no longer true for subclasses.More explicitly, <strong>Caché</strong> will always resolve the name in the context where it was first defined and not the current classname.For example, suppose User.MyClass defines a method, X(). If a class MyPackage.MyClass inherts from User.MyClass, whenit is compiled <strong>Caché</strong> will compile the inherited X() method in MyPackage.MyClass but resolve any unqualified classnamesused in this method in the context of User.MyClass because this is where X() was defined.11.2.6.12 Stream Implementation Has Been ModifiedIn version 5.1, cloning a class containing a stream member works differently from earlier releases. What happens now is:• If the stream member is a serial stream, the oref of the stream is copied to the clone.• If the stream is an instance of the “older” stream implementations:– %Library.FileBinaryStream– %Library.FileCharacterStream– %Library.GlobalBinaryStream– %Library.GlobalCharacterStreamthe oref of the stream is copied to the clone.<strong>Caché</strong> <strong>Upgrade</strong> <strong>Checklists</strong> 255

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

Saved successfully!

Ooh no, something went wrong!