04-07-2016 03:12 AM
Hi,
I was wondering how to best call APIs from anywhere in a program? Looking at the example below, from the TestLauncher it is clear, you wire the relevant smo class object to the API and it works, but do i have to maintain a SMO class wire for all objects which i want to use an API for? Or is there a better way to tell the API which smo object to use?
Regards
Mas
04-08-2016 04:20 PM
Hi Mas,
Thanks for the question. Each SMO will have its own API (collection of public methods that users of the class can call), so yes you will need to have the SMO class wire in order to be able to call API methods for that specific SMO.
I hope this helps,
Javier
04-08-2016 05:40 PM
If i am using more then one instance of the same Smo and want to register events
In the same event structure it gets a little confusing as the event structure list exactly the same events multiple times. Is there any more "elegant" way to deal with it?
Also is it possible (or usefull) to somehow pass reference to smo as a part of event data?
Thanks
Vlad
Sent from Samsung tablet
04-09-2016 05:31 AM
I see,
Lets say I want to use APIs from one smo in two other smo's what would be the best way to pass the smo referance to both of those smo's?
Is it the same if those two smo's are lunched at seperat times?
Thanks
Mas
04-11-2016 12:27 PM
Hi losikv
About the event structure, you could change the name of the events wire using the Variant to Data primitive, so that they don't have the same name:
Passing the reference of the SMO in the event data is possible. I would recommend that you carefully think of your specific application so that you don't create a "leaky abstraction".
04-11-2016 12:30 PM
Mas,
You can do this by creating a method for each of your "other" SMOs that takes another SMO.YourSMO as input and call that method before Starting the other SMOs. It does not matter if the other SMOs are started at different times as long as the wire that you pass from your SMO.YourSMO is taken after the CREATE method.
I hope this helps.