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.

Properties<br />

7.5 Attribute Properties<br />

An attribute property is a value associated with a specific object (as opposed to a relationship<br />

property which relates two or more objects). Such properties typically represent the state of<br />

a specific object instance.<br />

A property's type is determined by the class associated with the property (or by a keyword<br />

in the case of collection and multidimensional properties). By default, properties use the<br />

%String data type.<br />

There are several types of attribute properties, including:<br />

• Data Type Properties<br />

• Object-Valued Properties<br />

• Collection Properties<br />

• Stream Properties<br />

• Multidimensional properties<br />

7.5.1 Data Type Properties<br />

The simplest type of property is a data type property. This is a literal value whose behavior<br />

is controlled by the data type class associated with the property.<br />

For example, a class can define a Count property using the %Integer data type:<br />

Property Count As %Integer;<br />

Since %Integer is a data type class, Count is a data type property.<br />

You can use data type parameters to place constraints on the allowed values of data type<br />

properties. You can specify values for the data type class parameter as follows:<br />

Property Count As %Integer(MAXVAL = 100);<br />

To set a data type property value equal to the empty string, use code of the form:<br />

Set object.Property = $C(0)<br />

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

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

Saved successfully!

Ooh no, something went wrong!