简体   繁体   English

JCA有什么好处?

[英]What are the benefits of JCA?

Our application often connects to a different kind of back-ends over web services, MQ, JDBC, proprietary (direct over socket) and other kinds of transport. 我们的应用程序通常通过Web服务,MQ,JDBC,专有(直接通过套接字)和其他类型的传输连接到不同类型的后端。 We already have a number of implementations that let us connect from our application to these back-ends and while all of these implementations implement the common java interface, they do not share anything else. 我们已经有许多实现允许我们从应用程序连接到这些后端,虽然所有这些实现都实现了公共java接口,但它们不共享任何其他内容。

We have realized that there are signification portions of code that are common for all of these particular connector implementations and we have decided to streamline the development of future connectors through one universal connector. 我们已经意识到所有这些特定连接器实现都有共同的代码部分代码,我们决定通过一个通用连接器简化未来连接器的开发。 This connector will be capable of formatting messages to a format expected by back-end and sending them using the available transport mechanism. 此连接器将能够将消息格式化为后端预期的格式,并使用可用的传输机制发送它们。 For example, fixed-length message format over MQ or over a socket. 例如,MQ上或通过套接字的固定长度消息格式。

One of the dilemmas we are facing is the most appropriate technology for this kind of connector. 我们面临的困境之一是这种连接器最合适的技术。 So far, our connectors were basic java classes that implement the common java interface. 到目前为止,我们的连接器是实现常见Java接口的基本java类。 Since we generally host our applications in some Java EE application server, it seems that Java Connector Architecture would be the most appropriate technology for this piece of software. 由于我们通常在某些Java EE应用程序服务器中托管我们的应用程序,因此Java Connector Architecture似乎是最适合此软件的技术。 However, implementing JCA compliant connector seems to be relatively complex. 但是,实现符合JCA标准的连接器似乎相对复杂。 What are the palpable benefits of going with the standard – JCA and do benefits justify the additional effort? 采用标准有什么明显的好处 - JCA并且有益于额外的努力吗?

Indeed JCA seems the most appropriate technology for you. 事实上,JCA 似乎是最合适的技术。 Already excellent arguments have been made, namely the portability, standardised interface, the connection pooling and transaction support. 已经有了很好的论据,即可移植性,标准化接口,连接池和事务支持。 And don't forget security. 不要忘记安全。

With WebSphere Process server the adapters could be exposed as a SCA service which can have a lot of benefits if that's important for you. 使用WebSphere Process Server,适配器可以作为SCA服务公开,如果这对您很重要,它可以带来很多好处。

Also some development tools have extensive support for developing and testing JCA connectors. 此外,一些开发工具对开发和测试JCA连接器有广泛的支持。

Another benefit is (experienced) Java EE Administrators and Java EE developers (should) know the standard so administration and development should be easy to streamline. 另一个好处是(经验丰富的)Java EE管理员和Java EE开发人员(应该)知道标准,因此管理和开发应该易于简化。

But in the end you should have to find reasons to implement JCA based on the scope of your project, the future plans you have for your project or maybe within the policy of your company. 但最终,您必须根据项目范围,您对项目的未来计划或公司政策内的政策,找到实施JCA的理由。

Short answer: I see no benefit on selecting JCA over other technologies, I see it as a drawback since you need Java EE container. 简短回答:我认为选择JCA优于其他技术没有任何好处,我认为这是一个缺点,因为你需要Java EE容器。

Long answer: 答案很长:

I've been skeptic about these Java EE standards for some time now. 一段时间以来,我一直对这些Java EE标准持怀疑态度。 I don't see a compelling technical reason to use a full featured Java EE server anymore, since there are better open source implementations for every feature offered. 我没有看到使用全功能Java EE服务器的令人信服的技术理由,因为对于所提供的每个功能都有更好的开源实现。 I've been bitten several times by implementation incompatibilities when moving to/from "enterprisey solutions". 从“企业解决方案”转移到/从“企业解决方案”移动时,我已经被实施不兼容性多次咬了一口。

The idea for JCA is surfacing here right now and I am pushing to try apache camel or spring integration instead. JCA的想法现在就出现在这里,我正在努力尝试apache camelspring integration I am all for open source implementations that you can use everywhere. 我全都是开源实现,你可以在任何地方使用。 And there is a lot going on. 还有很多事情要发生。 Check this list of components . 检查此组件列表 Granted, maybe is smaller than whats already developed with JCA, but every bit is open sourced and it's all on one location. 当然,也许比JCA已经开发的更小,但每一点都是开源的,而且都在一个地方。 Also, I believe the documentation is simpler and more complete. 此外,我相信文档更简单,更完整。 The urge for integration calls for a powerful SPI with plenty of open source, real live examples, developed in the same fashion, and that can be found on the same place. 对集成的渴望需要一个功能强大的SPI,它具有大量开源,真实的实例,以相同的方式开发,并且可以在同一个地方找到。

I am hating the negativity, but I don't like full featured application servers. 我讨厌消极情绪,但我不喜欢功能齐全的应用服务器。 For instance, I would go for tomcat and terracota any day over other "enterprisey" products, just as I would go with camel before JCA, until the need for JCA gets proven. 举例来说,我会去Tomcat和陶土比其他“enterprisey”产品的任何一天 ,就像我会去骆驼JCA之前,直到JCA需要得到证实。 I don't like the idea of the Java Committee to tell how I should develop my own applications because I don't trust them. 我不喜欢Java委员会的想法,告诉我应该如何开发自己的应用程序,因为我不相信它们。 I believe it is in my best interest when the piece of software can work just as easily on Java SE/RCP as in a Java EE environments or in a pure Servlet container. 我相信,当Java SE / RCP上的软件可以像在Java EE环境或纯Servlet容器中一样轻松工作时,这符合我的最佳利益。

I've just developed an inbound resource adapter for a gps device communicating over an proprietary protocol. 我刚刚开发了一个入站资源适配器,用于通过专有协议进行通信的gps设备。 It wasn't that much hassle, though I've got the impression that developing an outbound one might require more work. 这并不是那么麻烦,虽然我的印象是开发一个出站可能需要更多的工作。 The worst thing with the JCA is the lack of documentation. JCA最糟糕的事情是缺乏文档。 All books and articles seems to have the same dumb example. 所有的书籍和文章似乎都有同样的愚蠢的例子。

The thing I'm most pleased with is the portability. 我最满意的是便携性。 Once you've written the adapter you can plug the rar (resource adapter archive) into any application server to provide deployed applications the ability to communicate with eis supported by your ra. 编写适配器后,您可以将rar(资源适配器存档)插入任何应用程序服务器,以便为已部署的应用程序提供与ra支持的eis通信的能力。 Or you can bundle the rar into the war/ear. 或者你可以将rar捆绑到战争/耳中。

The benefits are primarily for vendors who wish to sell connectors to proprietary back end systems for use with any app server, for customers who want to be able to drop in a connector without worrying about whether it only works on WebLogic not Websphere, etc. Indeed this is the goal of Java EE in general. 这些优势主要适用于那些希望将连接器销售到专有后端系统以供任何应用服务器使用的供应商,以及希望能够插入连接器而不必担心它是否仅适用于WebLogic而非Websphere等的客户。这是Java EE的总体目标。

Note that JBoss has decided to put several things into JCA, for example JDBC connections go via JCA. 请注意,JBoss决定在JCA中添加几个内容,例如JDBC连接通过JCA进行。

Your future client code will have a standardised interface, some pooling and transaction support etc. but it's important to keep sight of the bigger picture; 您未来的客户端代码将具有标准化的界面,一些池化和事务支持等,但重要的是要看到更大的图景; namely that the benefits are not targeted at you and your one project specifically, but at a software eco-system consisting of many app servers, many back end systems, many connectors and so on. 即好处不是针对您和您的一个项目,而是针对由许多应用服务器,许多后端系统,许多连接器等组成的软件生态系统。

Sounds like a good use for a JBI container with binding components. 对于带有绑定组件的JBI容器来说,这听起来很好用。 Discussion of JCA vs JBI. 讨论 JCA与JBI。

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

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