Custom Objects and Classes for Scripting 2005-03-26 - By Brad Friedman
Back Hi,
I just read the blog entry, "Why Create Custom Objects and Classes for Scripting in XSI?" over at CGSoup.
And it solved about 5-10 design issues I was having with my toolkit :) THANK YOU!
But I have a few questions if anyone can answer.
in the example code given, the object is retrieved with the command:
[code] set gt = GUITools(0) [/code]
which makes sense. But I was wondering about the instantiation of the object itself. First of all, what are some of the best standards and practices of creating objects in jscript? My understanding is that there are a couple of ways to do it and I was wondering if anyone has any reason why one way in particular is better for XSI.
I intend to roll an object as a utility library of functions (as suggested as one possible use in the blog entry). If I'm understanding the example, I think thats what GUITools is doing as well. Am I to understand that the object is instantiated every time the "GUITools" command is called? Or is it cache'ing it somewhere in global memory the first time and just passing the same instance on subsequent calls? Or is the instantiation so cheap, it doesn't matter that you instantiate it in every function you use it in? Is there a good place to toss an object where it will persist for the remainder of the given XSI session? Or is that foolhearty?
thanks, -brad --- Unsubscribe? Mail Majordomo@(protected) with the following text in body: unsubscribe xsi
|
|