在确定在Java EE应用程序中放置业务逻辑的位置时,有哪些设计考虑因素? [英] What are the design consideration questions in determining where to place the business logic in a Java EE application?

查看:61
本文介绍了在确定在Java EE应用程序中放置业务逻辑的位置时,有哪些设计考虑因素?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

特别是,EIS(数据库)层与使用带有POJO的Web层和一个轻型框架或使用EJB的标准业务逻辑层的对比.另外,除了这些我可能不知道的选项,可能还有其他选项.基本上,这是带有和不带有EJB的业务逻辑的设计注意事项.使用另一种替代方法的指南.

Specifically, the EIS (database) Tier versus using the Web tier with POJO's and a light framework or the standard business logic tier using EJB's. Also, there may be other options besides these that I'm not aware of. Basically, it's design considerations for business logic with and without EJBs. Guidelines for using one alternative over the other.

这将是在应用程序服务器上部署的Java EE应用程序的上下文中.

This would be in the context of a Java EE application deployed on an app server.

我的印象是,应该有一些关于如何在应用程序中进行结构化的基本准则,并且由于我出于工作的原因,它不能总是一个一个地使用,例如出于性能原因而使用数据库或始终使用EJB.使用了所有这三种结构的应用程序.我只是从未想过在确定时应该使用什么设计准则?

My impression is that there should be some basic guidelines as to how this should be structured in an application and it couldn't be always one over the other, like use the database for performance reasons or always use EJB's, since I worked with applications that have used all three of these structures. I just had never thought about what design guidelines should I use in making the determination?

我在考虑以下方面:

  • 如果您的数据库表中包含数百万行,请查看将业务逻辑放入存储过程和触发器中.
  • 如果您对应用程序有简单的业务逻辑,请考虑使用POJO作为业务逻辑.

推荐答案

我会尝试执行以下问题:

I would try to do the following questions:

  • 是否需要高性能?
  • 什么是基础架构?一台服务器?簇?云?
  • 我的记忆有限吗?
  • 该应用程序将使用/管理成千上万条记录,数百万甚至数十亿条记录?
  • 要活多久? 5年,20年?
  • 应用程序有多大,将有多少开发人员在使用它?
  • 开发人员是否熟悉该技术(即框架)?

我认为对于有多个开发人员同时工作且计划长期运行的大型应用程序来说,使用WEB/EJB/JPA体系结构是一个很大的优势,它可以生成高度可维护且非常易于维护的代码读.但是,如果应用程序要处理几百万条记录,那么最好考虑使用性能更好的技术/框架.

I think for large applications with several developers working at sametime and that is planned to be live a long period of time, is a big advantage to use the architecture WEB/EJB/JPA , it generates code highly maintainable and very easy to read. But if the application is going to work with several millions of records , probably is better to think in a technology/framework with better performance.

这篇关于在确定在Java EE应用程序中放置业务逻辑的位置时,有哪些设计考虑因素?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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