25.01.2015 Views

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

Using Caché Objects - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Transient<br />

Property Visibility<br />

Specifies that the property is not stored in the database. By default, properties are<br />

not transient. Subclasses inherit the value of the Transient keyword and cannot<br />

override it.<br />

Type<br />

Specifies the name of the class associated with the property, which can be a data type<br />

class, a persistent class, or an embeddable class. By default, the type of a property is<br />

%String. Subclasses inherit the value of the Type keyword.<br />

7.2 Property Visibility<br />

Properties may be specified as being public or private. If they are public, they can be accessed<br />

anywhere. If they are private, they can only be accessed by instance methods of the object<br />

to which they belong.<br />

Note:<br />

Methods which are declared as classmethods do NOT have access to properties<br />

declared to be private, even if they have a reference to an object of the class they are<br />

declared in. Private properties are only accessible from within instance methods of<br />

the class..<br />

In <strong>Caché</strong>, private properties are always inherited and visible to subclasses of the class that<br />

defines the property. Other languages often call these protected properties.<br />

7.3 Property Behavior<br />

Properties have a number of methods associated with them automatically. These methods are<br />

not inherited via standard inheritance. Rather, they use a special property behavior mechanism<br />

to generate a series of methods for each property.<br />

Each property inherits a set of methods from two places:<br />

• A %Property class that provides certain built-in behavior, such as Get, Set, and validation<br />

code.<br />

• The data type class of the property's data type, if it is a data type property. Many of these<br />

methods are method generators.<br />

<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 47

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

Saved successfully!

Ooh no, something went wrong!