简体   繁体   English

基于JBoss AS的应用程序体系结构有什么好处?

[英]What are benefits of JBoss AS-based application architecture?

I am trying to understand what does JBoss AS can bring into the project, comparing to standalone architecture? 与独立体系结构相比,我试图了解JBoss AS可以为项目带来什么?

My model application is a solid thing, starting, running and stopping as a whole and solely at the host. 我的模型应用程序是一件可靠的事情,它可以整体上,仅在主机上启动,运行和停止。 It has a database storage, and communicates to user and other servers, clustering required. 它具有数据库存储,并与用户和其他服务器通信(需要群集)。 It has web-part. 它具有网络部分。 It's just a standard big application. 这只是一个标准的大型应用程序。

JBoss for me is a shell for (in general) multiple applications, providing my application with some standard services. 对我来说,JBoss是(通常)多个应用程序的外壳,为我的应用程序提供了一些标准服务。 This shell is also a solid thing - "get all or nothing", something can be turned on/off (influencing your app unpredictably, or influencing other part of the JBoss) or replaced (very hard and is already kind a hack) with different version or other module. 这个shell也是很可靠的东西-“一无所有”,可以打开/关闭某些东西(对您的应用程序产生不可预测的影响,或者影响JBoss的其他部分),也可以用不同的东西替换(非常辛苦,已经有点黑了)版本或其他模块。

Standalone application for me is something combined of pieces with glue among them (Spring if you like) with IoC wiring. 对我来说,独立的应用程序是通过IoC布线将一些胶水(如果需要的话,用胶水)拼合在一起的。 We can get everything we could have with JBoss, but separately. 我们可以单独获得JBoss拥有的一切。 Spring or other glue serves here like an application server, but it's thinner and we still can replace parts or even Spring itself (IoC wiring is straightforward from coding point of view). Spring或其他胶水在这里就像应用程序服务器一样工作,但是它更薄,我们仍然可以替换零件甚至是Spring本身(从编码的角度来看,IoC接线很简单)。

For me, standalone, AS-free approach gives more control and flexibility. 对我而言,独立的,无AS的方法可提供更多的控制和灵活性。 And further more, last versions of JBoss AS are purely documented, some features (most interested) are not documented at all. 而且,JBoss AS的最新版本已被完全记录下来,某些功能(最受关注的功能)根本没有记录在案。

So, why somebody still choose JBoss - what are benefits? 那么,为什么仍然有人选择JBoss-有什么好处呢?

I favors more standalone application approach, but need more facts to understand better and convince others. 我赞成使用更多的独立应用程序方法,但是需要更多的事实来更好地理解并说服他人。

It seems to me that what you are describing is the classic choice between best-of-breed (collecting all the parts and glueing them together your self) versus integrated stack (JBoss wrote all the parts and integrated them for you). 在我看来,您所描述的是在同类最佳(收集所有零件并将其自身粘合在一起)与集成堆栈(JBoss编写所有零件并为您集成)之间进行的经典选择。 This is a debate that will rage on for eternity. 这是一场永恒的辩论。 If best-of-breed is working for you then stick with it. 如果同类最佳,那么请坚持使用。

JBoss is a J2EE container. JBoss是一个J2EE容器。 Take a look at the J2EE spec if you are unfamiliar with it. 如果您不熟悉J2EE规范,请看一下。 Basically Sun's community process came up with an development framework that contains components that you may be interested in when creating large scale apps. 基本上,Sun的社区流程提出了一个开发框架,其中包含您在创建大型应用程序时可能会感兴趣的组件。 J2EE contains multiple sub specs such as Servlets, EJB, JTA, JMS, and a whole host of other alphabet soup technologies. J2EE包含多个子规范,例如Servlet,EJB,JTA,JMS,以及其他许多字母技术。 If you aren't using any of these technologies then you do not need a J2EE container. 如果您没有使用任何这些技术,则不需要J2EE容器。 If you are just interested in using Servlets and JSPs then you are better off using a servlet container such as Tomcat, Jetty, Resin, etc. 如果您只是对使用Servlet和JSP感兴趣,那么最好使用Tomcat,Jetty,Resin等Servlet容器。

Providing enterprise features such as scalability, transactional support, federated user management, etc. are difficult. 提供诸如可伸缩性,事务支持,联合用户管理等企业功能很困难。 A J2EE container provides a standard level of these features. J2EE容器提供了这些功能的标准级别。 If you can find them elsewhere to a level that meets your satisfaction then more power to you. 如果您可以在其他地方找到满足您要求的产品,那么您将获得更大的动力。

You can also pick and choose if you are running inside JBoss. 您还可以选择是否在JBoss内部运行。 If you are happy with the JBoss services you can use them or deploy some others if you don't like the one JBoss provides for you. 如果您对JBoss服务感到满意,则可以使用它们,如果您不喜欢JBoss为您提供的服务,则可以部署其他服务。

Starting from the JBoss minimal configuration and building up your own configuration should give you a setup where you don't have services running that you don't need. 从JBoss的最低配置开始,然后建立自己的配置,应该为您提供了一个不需要运行不需要服务的设置。 Personally, I like to know what my AS is running, so I prefer to start from minimal configuration adding only the necessary parts. 就个人而言,我想知道我的AS正在运行,所以我更喜欢从最少的配置开始,仅添加必要的部分。

I would say the only reason to use JBoss is if you need to access the Java EE services (like Messaging, container-managed transactions and similar). 我想说使用JBoss的唯一原因是您是否需要访问Java EE服务(例如消息传递,容器管理的事务等)。

Keep in mind JBoss is (roughly described) Tomcat plus Java EE services (yes, yes, I know, this is a very simplified approach, just bear with me). 请记住,JBoss是(粗略描述的)Tomcat和Java EE服务(是的,是的,我知道,这是一种非常简化的方法,请耐心等待)。 I mention this as I would say your decision is: 我提到这一点是因为我会说您的决定是:

  • If you only need IoC and some other capabilites you can get with Spring and Tomcat, go with that 如果您只需要IoC和Spring和Tomcat可以获得的其他一些功能,那就去吧
  • If you application requires Java EE services, use JBoss 如果您的应用程序需要Java EE服务,请使用JBoss

Keep in mind you can always start with the basic system (Spring + Tomcat) and move to JBoss if required later on. 请记住,您始终可以从基本系统(Spring + Tomcat)开始,并在以后需要时转向JBoss。 Nothing forbids that.And probably starting with that approach will show you if you really need the Java EE services or you were over-engineering the solution. 没有什么可以禁止的,并且从这种方法开始可能会向您显示您是否真的需要Java EE服务或您对该解决方案进行了过度设计。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM