T
Chili.Opf3 Send comments on this topic.
Generic ObjectListHolder Class
See Also  Members   Example 
Chili.Opf3.Relations Namespace : Generic ObjectListHolder Class




Holds a list of objects that are connected with the parent object.

Object Model




Syntax

Visual Basic (Declaration) 
Public NotInheritable Class ObjectListHolder(Of T) 
   Inherits ObjectHolderBase
Visual Basic (Usage)Copy Code
Dim instance As ObjectListHolder(Of T)
C# 
public sealed class ObjectListHolder<T> : ObjectHolderBase 
Managed Extensions for C++ 
public __gc __sealed class ObjectListHolder<T> : public ObjectHolderBase 
C++/CLI 
generic<typename T>
public ref class ObjectListHolder sealed : public ObjectHolderBase 

Type Parameters

T

Example

The following example shows how to use the ObjectListHolder in your persistent objects. In the example each User has associated Calls.
C#Copy Code
            [Persistent("USER", PoolSize = 50)] 
public class User 

    // The class contains an ObjectListHolder and a RelationAttribute 
    // that specifies the relation between the parent object and the  
    // related objects. It demonstrates also how to use a condition to  
    // delimit the items in the list and to sort the result. 
    [Relation("Id", "UserId")] 
    private ObjectListHolder<Call> _calls =  
        new ObjectListHolder<Call>(new List<Call>(), "Duration < {0} SortBy Duration", "50"); 
 
    public List<Call> Calls 
    { 
        get { return _calls.InnerObject; } 
        set { _calls.InnerObject = value; } 
    } 
     
    // ... Other properties and code. 
}

Remarks

This class is used in a persistent class to hold a list of objects that are connected with the parent object. When accessing the first time the InnerObject property the related objects are loaded. This is called delayed loading and reduces roundtrips to the storage.

Inheritance Hierarchy

System.Object
   Chili.Opf3.Relations.ObjectHolderBase
      Chili.Opf3.Relations.ObjectListHolder

Requirements

Namespace: Chili.Opf3.Relations

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Chili.Opf3 (in Chili.Opf3.dll)

See Also