Linked models provide a mechanism for the WebApp developer to reuse and share model functionality among other WebApps.
By linking a model, you expose to the model requesting the linking the linked-in model's public functionality, such as methods or pages.
To add a linked model, you use the Linked Model builder to specify which model to link in. The Linked Model builder adds a named slot into your model, which contains information about the model being linked in. The example below shows model A
linking in model B
as the local linked model reference name.
does not get instantiated until it is actually called.
The name of the builder is used as the prefix name that must be used to access the linked model functionality. For example, if you added a linked model where you have specified LM1
as the builder name, you refer to a page in that model by using the Linked Model builder name, a period (.
) separator, and the page name.
You also use a similar format for calling methods on the linked model.
String value = webAppAccess.callMethod("LM1.doWork");
When models are linked in, you can create a single instance of the model that is shared within a session or specify that the linked model is not shared within the session. If the linked model is not shared, multiple instances of the model are created if it is used by more than one Linked Model builder.
Parent topic: WebAppAccess: wpf7