What is the use of Java Connector Architecture (JCA)?

3.2k views Asked by At

I am trying to extract a ZIP file using SDK zip API. I wrote the extraction code directly in my service class and my architect said the code has to be shifted to another module and should be implemented using JCA. I don't understand the use of JCA. He said it is a Java EE principle. All external systems, like the file system, should be accessed using JCA.

If this is the procedure then what about the database? It is also an external resource to my Java application. Why should not I use JCA to access a database?

I don't understand the importance and advantage at all. I tried to read online also. But I did not find any page which explains the advantages. Besides, there aren't any good tutorials which explains the development step by step. Most of the links are broken.

What is the explanation?

2

There are 2 answers

1
Kayaman On

JCA is a "generic architecture for connection to legacy systems", mainly larger more mainframe-like systems (such as SAP).

It's definitely not something you would use when unzipping, nor would you access the file system with it.

It sounds like your teacher is confused.

6
nomoa On

JCA is the connector architecture that resource implementers should use to integrate their resource adapter (RA) into a Java EE application server.

What your architect is asking is to make an RA for your resource management. It's clean, but it can be overkill.

The main benefit of using a resource adapter is to be cleanly integrated in the application server transaction workflow.

Look Understanding Resource Adapters for more information.

But if you just read a ZIP file without any modification, it's not worth the effort.

Note that some have already written a generic filesystem RA that you could use File Resource Adapter. Maybe it can help as is or at least it's a good start at understanding how to make an RA.