[java] Scripting engine in Java - Do We Really Need Them?
Question to Java Guru!
Need some lightweidth script engine like lua to embed into java applet and app OR may be java have one ?
I know about using javac via System at run time and then loadin via reflection but it is imposible in applet.
Realy do I need this stuff ?
Just because recompilation less - YES!
Found this http://www.beanshell.org comments if any?
[Edited by - HellCreator on February 15, 2005 2:33:47 AM]
Well, you never really "need" a scripting engine because it's possible to do anything you can with a scripting engine, with precompiled code.
You might find it advantageous under some circumstances to use a scripting engine though.
Regarding using javac in an applet, no you can't, but you *can* run a server-side script which runs javac and returns the class file(s) (perhaps in a jar).
You should look at Rhino (javascript engine written in Java, uses reflection) to achieve what I think you're trying to.<br><br>Mark
You might find it advantageous under some circumstances to use a scripting engine though.
Regarding using javac in an applet, no you can't, but you *can* run a server-side script which runs javac and returns the class file(s) (perhaps in a jar).
You should look at Rhino (javascript engine written in Java, uses reflection) to achieve what I think you're trying to.<br><br>Mark
Having scriptable events/code makes the software development cycle easier. You can adjust a script without having to recompile the entire application. Once you have finalised the script you can either hard code it or leave it scripted. Scripting also allows for a lot of extensibility in a system as well.
The best scripting engine I have found for use in Java is Beanshell (which you already found), as it integrates seamlessly.
[edit] spelling
The best scripting engine I have found for use in Java is Beanshell (which you already found), as it integrates seamlessly.
[edit] spelling
Or you could just use XML. You can store anything you want in XML, so it would be a good replacement for a scripting engine. Plus Java provides an API for loading XML already.
Thanks for all replays
I found verry interesting Rhino and Beanshell.
The mission is - do not force the end user to dowload and ah to install libraries required to app or applet and do not doing any server side action because engine may be oriented for runing on client mashine only without installing any servers localy.
I found verry interesting Rhino and Beanshell.
The mission is - do not force the end user to dowload and ah to install libraries required to app or applet and do not doing any server side action because engine may be oriented for runing on client mashine only without installing any servers localy.
Quote:Original post by CaptainJester
Or you could just use XML. You can store anything you want in XML, so it would be a good replacement for a scripting engine. Plus Java provides an API for loading XML already.
but - do java provide proccessing stored data as class object or class function
it is what the scripting do?
Quote:Original post by HellCreator
The mission is - do not force the end user to dowload and ah to install libraries required to app or applet and do not doing any server side action because engine may be oriented for runing on client mashine only without installing any servers localy.
In case you decided against jython because of those reasons you might want to reconsider. Jython doesn't put any prerequisies on client or server, you just have to pack a 700k library together with your app/applet.
Besides, python is an awesome language =)
Quote:Original post by HellCreator
but - do java provide proccessing stored data as class object or class function
it is what the scripting do?
I believe you can do that with reflection. However, I am not sure I understand what you are saying. Can you explain a bit more?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement