|Home > Object model > Instances|
JSON RPC 2.0 is a procedural interface, not an object-oriented interface. However, Iris extends it so that functions can be called on specific instances.
It achieves this by using the following extensions:
instIdargument, which identifies the instance that the function operates on. This argument is always named
instId. It is used by framework components to route requests and notifications to their destination. This is similar to the
thispointer in C++ or the
selfargument in Python. Callers must first query the list of instances using
instanceRegistry_getList()from the global instance, whose
instIdis zero, to get the id of another instance.
NumberU64, for all requests. It is used by framework components to route responses from the callee back to the caller.
All instances in a system, for example components, plug-ins, remote clients, and framework instances, can discover and communicate symmetrically with all other instances in the system.
All instances register themselves in a central instance registry, which assigns instance ids. See 5.20 Instance registry, instance discovery, and interface discovery API for details about the instance registry.
Instances can implement a subset of, or even a superset of, the
functions that are defined in the Iris APIs. Instances that do not support a
specific function must return
E_function_not_supported_by_instance for that function. See 5.20.5 Interface discovery for more information.
Few Iris functions do not have an
instId argument. These functions apply globally rather than to a single instance, for example,
instanceRegistry_registerInstance(). However, most functions are instance-specific.
Global functions are implemented by the global instance, which has
the pre-defined instance id of zero. Specifying an
instId argument of zero is equivalent to specifying no
instId argument at all. For more details, see 5.3 instId argument.