Browse DevX
Sign up for e-mail newsletters from DevX


EJB and RMI: A Practical Introduction : Page 4

Since both RMI and EJB offer technology for the development, installation, and management of distributed Java applications in the enterprise, Java developers frequently ask whether one is a better option than the other for their given architectures. This article provides practical demonstrations for using RMI and EJB technologies, both individually and in tandem.




Building the Right Environment to Support AI, Machine Learning and Deep Learning

Pure RMI or EJB?
Why use EJB when RMI enables you to easily do the same things without it? The answer depends on many factors, but perhaps a better question is 'why not use pure RMI to work with distributed objects even if your architecture partially uses EJB?' In fact, the example application in the previous section would work much faster this way, since you described practically everything independently.

The EJB framework is sufficient as a general framework that you can use in most cases where distributed components are necessary. And with such general use, its code should carry out many checks and have enough logic layers to solve practically any type of problem that comes up. All this results in significant productivity loss, however. Therefore, if the top priority of the application is productivity, the benefit of pure RMI code makes it the logical choice. Besides, you can always bypass the RMI framework altogether and work directly with the Sockets API. But again, understand that whether you choose RMI or EJB depends almost completely on your needs and the required scalability of your application.

Alexey Prokhorenko is a software and Web developer with more than six years development experience in complex, database-driven Web applications.
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date