From: Brian Z. <bri...@us...> - 2002-03-25 01:45:12
|
First of all, Jython/Python is so much easier to write and __read__. When you use Java's collection, that part of the Java code pretty much degenerate to dynamic typing. JythonServlet runs under the jython interpreter. PyServlet takes care of caching and reloading. So as soon as you change your jython servlet code, it's reflected on the page. This at least saves a compilation and java .class reloading step. Jython can use both java API and most python libraries. I once ported a wiki implementation from CPython CGI to Jython, very straightforward. It determines one method to invoke during runtime, and dynamically evaluate it. I don't think using Java servlet would be as easy. You can argue JSP also provides automatic compilation and reloading. True. But, 1. JythonServlet only needs JRE to run 2. It can achieve the same result of model one JSP without the need of a specialized embedded language (JSP) 3. With the combination of XMLC, it can achieve even better code/markup separation than model two JSP (taglib)! Think about it, do you prefer logic/iteration tags in the markup, or python for loop and list comprehension? The performance may not be as good as Java Servlet, but you can always optimize the performance critical part in Java. I often wonder why Jython Servlet hasn't caught on - IMO it's mainly because the developer need to understand 1) Java 2)Java servlet 3) Python, and realize the advantage of this combination. -Brian Zhou ----- Original Message ----- From: <Ale...@di...> To: <jyt...@li...> Sent: Sunday, March 24, 2002 10:31 AM Subject: [Jython-users] JythonServlet over Java Servlet > I was just looking at the examples of JythonServlet, and I was wondering: > why would you want to use jython to create the servlet, instead of using > java ? I mean that it doesn't save you any of the steps that you have to go > through when creating a java servlet, but rather you just have to use > python syntax to accomplish the stuff that you otherwise would do in java > (which sometimes feels a little awkward: to type java code, with the java > libraries etc. with python syntax) . > > I love the integration of Jython and Java, and I like that I can do stuff > (e.g. using all the java libs in jython, extending ) that I otherwise > wouldn't be able to do in CPython (since I am not much into C++ -> I could > read it but I doubt I could produce anything beyond basic stuff ) , but I > didn't see the value that jython adds to a servlet. > > Would anybody give me a perspective on this ? > > > Thanks, > > Alex Kotchnev > Diversified Information Technologies > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |