Chili.Opf3 Send comments on this topic.
ISelfContainingObject Interface
See Also  Members   Example
Chili.Opf3 Namespace : ISelfContainingObject Interface




A class implementing this interface is self containing (manages the state by itself) and can be remoted or persisted to any kind of device without problems.

Syntax

Visual Basic (Declaration) 
Public Interface ISelfContainingObject 
Visual Basic (Usage)Copy Code
Dim instance As ISelfContainingObject
C# 
public interface ISelfContainingObject 
Managed Extensions for C++ 
public __gc __interface ISelfContainingObject 
C++/CLI 
public interface class ISelfContainingObject 

Example

The following example shows a class that implements the interface.
C#Copy Code
            [Persistent("USER")] 
public class User : ISelfContainingObject 

    private ObjectInfo _objectInfo = null; 
  
    public ObjectInfo ObjectInfo 
    { 
        get { return _objectInfo; } 
        set { _objectInfo = value; } 
    } 
  
    // ... Other properties and fields. 

    

Remarks

This interface is implemented by classes that are (or should be) independent of any ObjectContext instance.

Usually a class "lives" within one ObjectContext, as that context internally holds the state (loaded, saved, deleted, marked for deletion, ..) of the object. By implementing this interface the ObjectContext saves that information directly in the object and does not hold it internally. Each time the object is saved (or any other thing is done on the object that requires the ObjectContext) the context gets the data directly from the object itself. This makes it independent from the ObjectContext.

Usually this interface is implemented by classes that are remoted, serialized or persisted to any kind of device (other then the storage). It could be optionally implemented by any persistent object to have it independent from its ObjectContext.

Requirements

Namespace: Chili.Opf3

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