相当大的webapp:从Java到Python。经验? [英] fairly large webapp: from Java to Python. experiences?

查看:86
本文介绍了相当大的webapp:从Java到Python。经验?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个相当庞大的用Java编写的webapp(加上Tomcat,
Hibernate,Struts,JSP,MySQL),这有点像熊一样。我没有写b
$ b。其中大部分内容都非常稀少(如果全部是

)。任何地方都没有设计文档。它是一个包含许多类的大型Web应用程序

和相当深的继承层次结构。似乎有JUnit测试

的案例。


重写它的可能性已经出现了,我必须说,

虽然它可能需要大量工作,但它也可能是一个真正的b / b $ b $ pythonic冒险。 ;)重写的原因是要变得更好

灵活性,更容易维护(更容易进行更改),以及

真正减小尺寸的可能性。和

课程一起使用Python会很好 - 可能会显着提高
的效率。


这里有没有人有使用Python的大型(ish)webapps的经验吗?

我正在嗅探下面的A工具包团队:CherryPy,
Cheetah,SQLObject,都落后于Apache2。有没有人看过使用Python webapps的性能问题?


可以合理地期望有一个更容易维护的时间

和未来使用Python over Java进行修改?


任何提示,故事,推荐和/或体验都是最受欢迎的。


谢谢。

I''ve got a fairly substantial webapp written in Java (plus Tomcat,
Hibernate, Struts, JSP, MySQL) that is a bit of a bear to work with. I
didn''t write it. Much of it is only very sparsely documented (if at
all). No design docs anywhere. It''s a large webapp with many classes
and fairly deep inheritance hierarchies. There seems to be JUnit test
cases in place.

The possibility of re-writing it has come up, and I must say that,
although it would likely be a ton of work, it could also be a real
pythonic adventure. ;) Reasons for a rewrite are to get better
flexibility, easier maintenance (easier to make changes), and the
possibility of really slimming down the size of the thing. And of
course, it would be nice to work with Python -- possibly significantly
more productive.

Does anyone here have any experience with large(ish) webapps in Python?
I was sniffing around the following A-team of toolkits: CherryPy,
Cheetah, SQLObject, all behind Apache2. Has anyone seen performance
issues with Python webapps?

Could one reasonably expect to have an easier time with maintainence
and future modifications with using Python over Java?

Any tips, stories, recommendations, and/or experiences are most
welcome.

Thanks.

推荐答案

要替换大型框架,您可能需要一个框架。请看

查看 http://www.djangoproject.com http://www.turbogears.org 。他们

都使用你提到的一些工具但是在更高的层次上运行。


我发现Python相当容易维护。不幸的是,我没有找到它很容易拿出一堆Java代码并将其转移到Python。但是一旦它在那里,那么Python就是Web应用程序的不错选择。 Java速度很慢,占用空间很大。 Python相当灵活,好的设计选择得到了回报。

另外,你必须编写更多的Java代码来做你能做的事情。
Python。我不知道你没有使用的代码,但很多

大型Java应用程序写得不好。


我想你也可以看一下在 http://www.jython.org/ 看看你是否

可以某种方式进行转换,但不能同时进行。


祝你好运,

< http://brianray.chipy.org>

To replace a large framework you will probably need a framework. Take a
look at http://www.djangoproject.com or http://www.turbogears.org. They
both use some of the tools you mention but operate on a higher level.

I find Python fairly easy to maintain. Unfortunatly, I do not find it
easy to take a bunch of Java code and move it to Python. But once it is
there, Python is a good choice for web apps. Java is slow and has a big
footprint. Python is reasonably nimble and good design choices pay off.
Plus, you must write many more lines of Java to do what you can in
Python. I do not know the code you are not working with, but a lot of
large Java apps can be poorly written.

I guess you could also look at http://www.jython.org/ and see if you
can somehow make the transition but not all at once.

Good luck,
<http://brianray.chipy.org>


br ******* @ gmail .com 写道:
要替换大型框架,您可能需要一个框架。


嗯,我确定不是所有的Web框架都是平等的,但是,

CherryPy确实将自己称为web框架。

请查看 http://www.djangoproject.com http://www.turbogears.org 。他们都使用你提到的一些工具但是在更高的层次上运行。


Django看起来很有趣。想试试mod_python。

看看......

我发现Python相当容易维护。不幸的是,我发现很容易将一堆Java代码转移到Python上。


好​​吧,我认为最好使用以前的webapp

作为*模型*来学习,而不是直接翻译

从Java到Python的代码。

但是一旦它在那里,Python就是Web应用程序的不错选择。 Java很慢


慢?它们都是动态语言,但Java静态地输入了
(在运行时需要做的工作量较少)。对于长时间运行的进程,

我猜Java字节码的执行速度比Python字节码快。

并且占用空间很大。


是的。

Python相当灵活,设计选择也很好。
另外,你必须编写更多的Java来做什么你可以在Python中使用。


是的。当前Java webapp的主要问题似乎是

,需要很长时间才能进行更改/添加。

我不知道你不使用的代码但是很多大型Java应用程序写得不好。
To replace a large framework you will probably need a framework.
Well, I''m sure not all web frameworks are created equal, however,
CherryPy does bill itself as a "web framework".
Take a
look at http://www.djangoproject.com or http://www.turbogears.org. They
both use some of the tools you mention but operate on a higher level.
Django looks interesting to me. Would like to try out mod_python.
Taking a look...
I find Python fairly easy to maintain. Unfortunatly, I do not find it
easy to take a bunch of Java code and move it to Python.
Well, I figured it might be better to use the previous webapp
as a *model* to learn from, rather than to directly translate
code from Java to Python.
But once it is
there, Python is a good choice for web apps. Java is slow
Slow? They''re both dynamic languages, but Java is statically
typed (with less work to do at runtime). For long-running processes,
I''d guess that Java bytecode executes faster than Python bytecode.
and has a big
footprint.
Yes.
Python is reasonably nimble and good design choices pay off.
Plus, you must write many more lines of Java to do what you can in
Python.
Yup. The main issue with the current Java webapp seems to be
that it takes a long time to make changes/additions.
I do not know the code you are not working with, but a lot of
large Java apps can be poorly written.




我发现好的文档是*最关键的。至少

如果文档很好,但代码需要工作,你有一些

指示如何修复代码。如果没有文档,那么你需要花费数小时的时间来思考为什么事情就像他们完成的那样完成。


目前看看Django文档。 :)


谢谢Brian!

--- J

-

(删除zeez如果是demunging的电子邮件地址)



I''ve found that good documentation is *most* critical. At least
if the docs are good, but the code needs work, you have some
direction as to how to fix the code. If there''s no docs, you
spend hours wondering why things are done the way they''re done.

Currently having a look at the Django docs. :)

Thanks Brian!
---J
--
(remove zeez if demunging email address)


John M. Gabriele写道:
John M. Gabriele wrote:
br ******* @ gmail.com 写道:
但是一旦它在那里,Python就是网络应用的不错选择。 Java很慢
But once it is
there, Python is a good choice for web apps. Java is slow



慢?它们都是动态语言,但Java是静态类型的(在运行时需要做的工作量较少)。对于长时间运行的进程,我猜猜Java字节码的执行速度比Python字节码快。



Slow? They''re both dynamic languages, but Java is statically
typed (with less work to do at runtime). For long-running processes,
I''d guess that Java bytecode executes faster than Python bytecode.




嗯,也许是的,但如果你不是这样的话算上重新编码

是如此简单,以至于您可以参加几个相同的实现,以查看哪些权衡取舍。 Java可以运行一种算法

你决定写的速度比Python运行速度快,但是在Python中你可以竞争五种算法并保持最快。

有效地使用程序员资源是Python的秘诀。


--Scott David Daniels
sc *********** @ acm.org


这篇关于相当大的webapp:从Java到Python。经验?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆