Configuring DataSnap Data Module

From RAD Studio
Jump to: navigation, search

Go Up to Setting Up the Data Module


The DataSnap data module consists of at least three components that can be present in a descendant of the TDataModule class:

TDSServerClass is a component that can be used to specify a server-side class with published methods that can be called from a remote client, using dynamic method invocation. One important property is the life cycle. Here, one can specify for how long an instance of a server methods class is kept in memory: invocation, session, and server. Invocation value determines the object invoked to be destroyed immediately after the method execution. The next invocation will use a new object instance. All fields will lose their changes from the previous call. Session value determines the object to be reused between different invocations, but it will be destroyed when the connection closes. Session value will have the object instance destroyed when the DataSnap server closes.

The transport protocol can be either TCP-based (TDSTCPServerTransport) or HTTP (TDSHTTPService). The communication-specific parameters (such as port and filters) can be set here. Both components can be linked to the TDSServer component, but the latter can act as a tunnel and connect to a remote DataSnap server. The HTTP component also allows for method invocation from a browser-based client using the REST and JSON protocols.

If the requests need authentication, both components can be used together with an authentication manager component implemented by Datasnap.DSAuth.TDSCustomAuthenticationManager, which is set through their AuthenticationManager property. This allows for authentication, as well as authorization, of all the user's remote method invocations.


See Also