API lifetime#
Primary ItalaApiNET functionalities are accessible via an abstraction called system, which is the root of the API. To initialize ItalaApiNET, the client code must initialize the system instance.
Warning
The client code is responsible for the system instance lifetime. The client code must create the system before using it and destroy it when it’s no longer required. As long as the system instance is alive, ItalaApiNET can be used.
The SystemFactory.Create
function initializes ItalaApiNET and returns the system interface ISystem
. The ISystem.Dispose
function destroys the system instance.
using Itala;
private static void main()
{
ISystem system = SystemFactory.Create();
//Use the ISystem interface
system.Dispose();
return 0;
}
Since the system is the root of the API, it is unique and only one instance can be created at a time.