Using Caché Objects - InterSystems Documentation
Using Caché Objects - InterSystems Documentation
Using Caché Objects - InterSystems Documentation
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
7<br />
Properties<br />
Properties are the class members that define the state of an object. The manner in which you<br />
can access and manipulate the values of an object's properties depends on the object's class<br />
definition. Formally, there are two kinds of properties:<br />
• Attributes, which hold values<br />
• Relationships, which hold associations between objects<br />
Within <strong>Caché</strong>, attribute properties are simply referred to as “properties” while relationship<br />
properties are referred to as “relationships.”<br />
Many object languages such as Java and C++ do not have true properties, but rather private<br />
variables manipulated by public accessor methods. In <strong>Caché</strong>, properties are different than<br />
variables. There is a rich model for properties in which:<br />
• Properties can be literal values, collections of literal values, streams, references to persistent<br />
objects or embedded objects, or collections of references to persistent objects or<br />
embedded objects.<br />
• Properties automatically have a set of property methods supporting validation and storage.<br />
• Properties can transparently invoke sophisticated translations and other advanced functionality<br />
during data retrieval and storage.<br />
• Properties automatically pull embedded and persistent objects into memory as soon as<br />
they are referenced. This is called “swizzling” (sometimes referred to as “lazy loading”<br />
).<br />
Every property has a name, a type, an optional set of modifying keywords, and an optional<br />
set of parameters for its type. A property name must be unique within its class.<br />
<strong>Using</strong> <strong>Caché</strong> <strong>Objects</strong> 45