Subj : Re: Simple request for verification of Rhino's abilities To : Lynn Pye From : Igor Bukanov Date : Tue May 11 2004 03:56 pm Lynn Pye wrote: .... > I'm planning to do something similar and would like to use Rhino and > Javascript to substitute for the LPC portion. I understand from what > I've read that I can limit and even cut off altogether the LiveConnect > capabilities of Rhino to call out directly to Java classes, which is > nice. And I also have the security policy settings of the JVM itself > at my disposal, so I don't want for security. > > What I need to know has to do with inheritance. From what I > understand, a scope doesn't inherit in the "IS-A" sense but rather in > the "HAS-A" sense, using prototypes. What I would like to be able to > do is to set up somewhat of an heirarchy for this inheritance, but all > in separate JS files. > > For example, I might have object.js, room.js, and kitchen.js. > kitchen.js inherits from room.js which in turn inherits from > object.js. But I'm going to have to load kitchen.js first. Would I be > able to somehow tell kitchen.js to load room.js (and room.js to load > object.js) in a recursive fashion until all dependencies are > satisfied? Rhino shell, http://www.mozilla.org/rhino/shell.html , provides "load" function that can be used to load external script. You may add a similar function to your application that would given an object name load the object from external file if it was not already loaded. You may also have a look at http://www.crockford.com/#javascript about various ways to simulate inheritance in JS. Regards, Igor .