You use Method.Eco.ExternalLateBound on a model method when you want Turnkey or MDrivenServer to resolve that method by name from built-in system functions or from C# code supplied in a DLL.
What ExternalLateBound does
When a model method has Method.Eco.ExternalLateBound enabled, Turnkey or MDrivenServer looks for an externally provided implementation with the same name as the model method.
The external implementation can come from:
- A built-in system function.
- A C# method made available from a DLL.
This is called late binding because the model method is connected to its external implementation by the runtime environment rather than by implementation stored directly in the model.
When to use it
Use ExternalLateBound when the method represents behavior that must be provided by the running Turnkey or MDrivenServer environment.
For example, if your model contains a method named CalculateShipping and a DLL made available to the runtime provides a C# method with that same name, marking the model method as ExternalLateBound tells the runtime to bind CalculateShipping to that external method.
| Situation | Use ExternalLateBound? | Reason |
|---|---|---|
| The behavior is provided by a built-in system function. | Yes | The runtime resolves the model method to the system function with the same name. |
| The behavior is implemented in C# and supplied in a DLL. | Yes | The runtime resolves the model method to the C# method with the same name. |
| The behavior is intended to be defined and maintained within the model. | No | ExternalLateBound is for runtime binding to an externally supplied implementation. |
Configure the model method
- In your model, select the method that represents the external behavior.
- Set Method.Eco.ExternalLateBound on that method.
- Ensure that the built-in function or C# method that should implement it uses the same name as the model method.
- Make the required DLL available to the Turnkey or MDrivenServer runtime when the implementation is supplied as C# code.
- Run the application and verify that the runtime resolves the method to the expected external implementation.
Naming is the binding contract
The model method name is the binding contract. The runtime searches its built-in functions or available DLL-based C# methods for an implementation with the same name.
For example:
| Model method | External implementation expected by the runtime |
|---|---|
CalculateShipping
|
A built-in function or DLL-based C# method named CalculateShipping
|
SendNotification
|
A built-in function or DLL-based C# method named SendNotification
|
If the names do not match, the runtime cannot bind the model method to that implementation.
ExternalLateBound concerns method implementation binding in Turnkey and MDrivenServer. It is not a setting for database communication, persistence-server WCF endpoints, or object construction.
For background on the MDriven runtime and persistence architecture, see Documentation:MDriven Architecture. For ECO terminology, see Documentation:Introduction to ECO. If you are configuring WCF communication for an ECO persistence server, use Documentation:Using different WCF Bindings with Enterprise Core Objects – ECO – MDriven framework instead.
