Modeling Services > Relations > One-to-one Relations > Defining Use Relations
 
Defining Use Relations
Let us suppose that we want to define a relation between an object of type Link and an object of type Node, such that a link uses a node. To do so, we would declare the data members from and to of type IlsUses inside the class defining the user object, that is,
the class Link—a Link uses two Nodes: a source node (from) and a destination node (to):
class Link:
public IlsObject
{
 public:
   IlsUses<Link,Node> from,to;
   Link();
};
A class that declares a Server relation must directly or transitively derive from the class IlsObject or IlsEntity. In addition, derivation must be public. The classes Link and Node must both derive from IlsObject or IlsEntity directly or transitively. Derivation must be public. For more information on basic objects versus entities, see Basic Features.

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.