You may want to structure your application server so that it uses multiple remote data modules. Using multiple remote data modules lets you partition your code, organizing a large application server into multiple units, where each unit is relatively self-contained.
Although you can always create multiple remote data modules on the application server that function independently, a special connection component on the DataSnap category of the Tool palette provides support for a model where you have one main "parent" remote data module that dispatches connections from clients to other "child" remote data modules. This model requires that you use a COM-based application server (that is, not TSoapDataModule).
To create the parent remote data module, you must extend its IAppServer interface, adding properties that expose the interfaces of the child remote data modules. That is, for each child remote data module, add a property to the parent data module's interface whose value is the IAppServer interface for the child data module. The property getter should look something like the following:
function ParentRDM.Get_ChildRDM: IChildRDM; begin if not Assigned(ChildRDMFactory) then ChildRDMFactory := TComponentFactory.Create(ComServer, TChildRDM, Class_ChildRDM, ciInternal, tmApartment); Result := ChildRDMFactory.CreateCOMObject(nil) as IChildRDM; Result.MainRDM := Self; end;
For information about extending the parent remote data module's interface, see Extending the application server's interface.
Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
|
What do you think about this topic? Send feedback!
|