Back to Devexpress

SerializableObjectLayer Class

xpo-devexpress-dot-xpo-a8b8deff.md

latest3.7 KB
Original Source

SerializableObjectLayer Class

An object access layer used for units of work (or sessions) in distributed applications.

Namespace : DevExpress.Xpo

Assembly : DevExpress.Xpo.v25.2.dll

NuGet Package : DevExpress.Xpo

Declaration

csharp
public class SerializableObjectLayer :
    ISerializableObjectLayer,
    ISerializableObjectLayerProvider,
    ISerializableObjectLayerEx,
    ICommandChannel,
    ICommandChannelAsync
vb
Public Class SerializableObjectLayer
    Implements ISerializableObjectLayer,
               ISerializableObjectLayerProvider,
               ISerializableObjectLayerEx,
               ICommandChannel,
               ICommandChannelAsync

Remarks

The SerializableObjectLayer is a ready-to-use ISerializableObjectLayer implementation shipped with XPO. You can provide your own implementations and use them in your distributed applications.

Normally, a SerializableObjectLayer instance is provided via a proxy derived from the SerializableObjectLayerProxyBase to initialize a SerializableObjectLayerService-based service, as shown below.

csharp
(ObjectWcfService.svc.cs)
public class ObjectService: SerializableObjectLayerService {
    // Initializing a service with a proxy providing a SerializableObjectLayer instance.
    public ObjectService(): base(new ObjectServiceProxy()) { 
    }

    static ObjectService() {
        // Initializing a data access layer (DAL).
        // ...
    }
}

public class ObjectServiceProxy: SerializableObjectLayerProxyBase {
    protected override SerializableObjectLayer GetObjectLayer() {
        return new SerializableObjectLayer(new UnitOfWork(), true);
    }
}
vb
(ObjectWcfService.svc.vb)
Public Class ObjectService
    Inherits SerializableObjectLayerService
    ' Initializing a service with a proxy providing a SerializableObjectLayer instance.
    Public Sub New()
        MyBase.New(New ObjectServiceProxy())
    End Sub

    Shared Sub New()
        ' Initializing a data access layer (DAL).
        ' ...
    End Sub
End Class

Public Class ObjectServiceProxy
    Inherits SerializableObjectLayerProxyBase
    Protected Overrides Function GetObjectLayer() As SerializableObjectLayer
        Return New SerializableObjectLayer(New UnitOfWork(), True)
    End Function
End Class

For more information on transferring data via WCF services, refer to Transferring Data via WCF Services.

Implements

ISerializableObjectLayer

ISerializableObjectLayerEx

Inheritance

Object SerializableObjectLayer

See Also

SerializableObjectLayer Members

Transfer Data via WCF Services

DevExpress.Xpo Namespace