在决定 java 框架、库时需要帮助

发布于 2024-11-08 15:05:34 字数 176 浏览 0 评论 0原文

我计划开发开源java应用程序以在google app引擎以及普通的rdbms系统上工作,所以请帮助我选择

MVC框架- Struts/Spring MVC ?

ORM- JDO/JPA?

我认为性能是一个关键因素。

I am planning to develop open source java application to work on google app engine as well as normal rdbms system, so please help me in choosing

MVC Framework -
Struts / Spring MVC ?

ORM -
JDO / JPA ?

I am considering performance as a key factor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

热情消退 2024-11-15 15:05:34

对于应用程序引擎,您将需要一个轻量级框架,用于持久性和应用程序内容。 Google 正在改变他们的定价模式,因此您可能需要考虑这将如何影响您的计划。应用引擎小组对此有一个有趣的讨论: https://groups.google.com/forum/#!topic/google-appengine/ob-kMuDAAqc/discussion

除此之外,我只能对持久性框架的选择发表评论:

应用程序引擎上的 JDO 很痛苦。他们(Google)在应用程序引擎中支持的版本是 1.x,我相信这是古老的版本。我在让事情正常运转方面遇到的麻烦比我记得的还要多。 如果您以前有使用 JDO 的经验,这仍然可能是一个不错的选择。如果我重新开始,我会选择专门为应用程序引擎编写的持久性框架,例如objectify或<强>树枝。它们需要更少的开销并且更容易使用(从我的角度来看)。 objectify 的一个巨大加分项:为您提供开箱即用的内存缓存支持,无需额外工作。那有多棒?

但是,您还希望支持 RDBMS。如果您有时间,您可以在 objectify 和您选择的 RDBMS 持久层之上滚动您自己的抽象层。这将为您带来所需的性能优势。 ;)

如果这不是一个选择,我会建议 JPA(不是因为我自己使用过它,而是因为我在使用 JDO 时遇到了很多麻烦)。

希望这有帮助!

For app engine you will want a lightweight framework, both for persistance and application stuff. Google is changing their pricing model so you might want to consider how this will impact your plans as well. There is an interesting discussion on the app engine group about this: https://groups.google.com/forum/#!topic/google-appengine/ob-kMuDAAqc/discussion

Aside from that I can only comment on the choice of persistance framework:

JDO on app engine is a pain. The version they (Google) support in app engine is 1.x, which is ancient, I believe. I have had more trouble with getting things to work than I care to remember. If you have previous experience with JDO this still might be a good choice. If I were to start over again I would choose a persistence framework that was specifically written for app engine, like objectify or twig. They require less overhead and are easier to use (from my point of view). One giant plus of objectify: gives you memcache support out of the box with no extra work. How great is that?

However, you also want to support an RDBMS. If you have the time, you could roll your own abstraction layer on top of objectify and the RDBMS persistance layer of your choice. That would give you the edge in performance that you are looking for. ;)

If that is not an option I would suggest JPA (not because I have used it myself, but because I had so much trouble with JDO).

Hope this helps!

阳光的暖冬 2024-11-15 15:05:34

你所说的性能是什么意思?例如,如果您没有使用始终开启功能,您可能会认为服务器冷启动时间是对性能影响最大的一个因素。所有框架都会使其变慢,甚至还有 关于优化冷启动时间的博客文章

对于 MVC,Spring 3 相当擅长,但这更多是个人喜好和你觉得舒服的事情。如果您想要为 AppEngine 设计的东西,请尝试 Gaelyk,不过它是 Groovy。对于数据存储,JPA也许使用更广泛,但我认为App Engine上的JDO支持更好。如果您需要脱离 App Engine,这两者都提供一定程度的平台独立性。还有 Objectify-AppengineTwig 与平台的联系更加紧密,因此可能提供更好的界面来管理数据存储。

What do you mean by performance? For instance, if you're not using the always on feature, you might consider the server cold start-up time as the single thing affecting the performance the most. All the frameworks will make it slower, there's even a blog post about optimizing the cold start-up time.

For the MVC, Spring 3 is quite good at it, but it's more personal preference and what you're comfortable with. If you want something designed for AppEngine, give Gaelyk a try, it's Groovy though. For the data storage, JPA is perhaps more widely used, but I think the JDO support on App Engine is better. Both of those provide some level of platform independence, if you need to get off from App Engine. There are also Objectify-Appengine and Twig that are more tied to the platform and thus might provide better interface for managing the datastore.

溺渁∝ 2024-11-15 15:05:34

我个人会选择Java EE 6框架。所以

MVC:JSF ->非常轻量且易于开发。 JSF2.x 修复了 JSF1.2 的许多缺点
ORM:JPA2.0 ->因为它是标准的并且附带 Java EE 6 捆绑包。您可以根据自己的选择替换为 Hibernate。各有其独特的优势特点。我不会说其中一个比另一个更好。
不要忘记 Java EE 6 附带了 EJB3.1。 EJB 因其重量级而臭名昭著,但自 EJB 3.0 以来,情况就大不相同了。 EJB3.1 变得更加轻量且易于开发。 Glassfish Web Profile 提供了 EJBLite(呵呵呵呵 :D :D 更轻 :D )

就开发复杂性而言,我不得不说 Spring 比 JEE6 复杂一点,但同样,我只接触 Spring 很少,这个讨论将离开与更有经验的开发人员谈论。

I would personally go with Java EE 6 framework.So

MVC: JSF -> very lightweight and easy to develop. JSF2.x fixed many shortcoming features from JSF1.2
ORM: JPA2.0 -> since it is standard and come with Java EE 6 bundle. You can replace with Hibernate, your choice. Each has its own unique advantage features. I would not say one is better than other.
Dont forget that Java EE 6 come with EJB3.1. EJB have had its bad reputation to be heavyweight, however since EJB 3.0, it is a much different story. EJB3.1 has become much more light weight and easy to develop. Glassfish web profile provides EJBLite (Hehehehe :D :D much lighter :D)

In term of development complexity, I have to say that Spring is a bit more complex than JEE6, but again, I only touch Spring very minimal, this discussion will leave to much more experienced developers to talk about.

星星的軌跡 2024-11-15 15:05:34

我会选择 JSF + JPA,并使用 Spring Framework 进行依赖注入。

我的5美分。 :P

I would go for JSF + JPA and I'd use Spring Framework for dependency injection.

My 5¢. :P

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文