Version 7.00.177.00 of Jiwa included some changes that will likely cause plugins or applications using our assemblies to no longer compile, or produce unexpected errors at runtime.
We deprecated the Instance singleton property
"Instance" property has been deprecated (marked as obsolete) in the JiwaFinancials.Jiwa.JiwaApplication.Manager class.
The Manager class has a property named Instance, which could be used like this:
The above example - whilst it still compiles - is no longer supported.
To address this, you should no longer refer to the singleton instance property, but instead use an instance of the Manager class instead:
As many classes require access to the Manager class instance, removing the singleton instance property meant we now needed to add a Manager property to all our Forms, Dialogs and Business Logic.
Our interfaces which are implemented by all our Forms, Dialogs and Business Logic have had a Manager property added:
So all classes implementing the above interfaces now have a Manager property also. We also included in the above interfaces a Setup method. The factories should always be used to create a new instance of any class implementing the above, as the factory will set the Manager property and then invoke the Setup method of the newly instantiated object.
The factories are accessible via properties of the Manager class - these are BusinessLogicFactory, CollectionFactory, CollectionItemFactory, DialogFactory, EntityFactory, FormFactory.
An example of using the Entity Factory of the Manager:
An example of using the CollectionItem Factory of the Manager:
Why the changes were made
We found that in the development of our REST API, the singleton pattern was inhibiting the ability to have multiple users using the REST API concurrently. In order for us to provide the REST API we had to move away from the singleton pattern.
Always use a factory to create an instance of a class implementing any of the following interfaces:
Move constructor code to Setup method
Any classes implementing the above interfaces should not have any reference in their constructor to their Manager property - move that to the Setup method and ensure the first line of code in the overridden Setup method is calling the base Setup method.