File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes �Rich Client + EJB� Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "�Rich Client + EJB�" Watch "�Rich Client + EJB�" New topic

�Rich Client + EJB�

jose maria

Joined: Jan 29, 2002
Posts: 5
I'm developing a web EJB app. whose client is a web browser but in the next version a java rich client GUI will be used and will communicate with server through http with xml. In client GUI I'll use some classes encapsulated in EJB but I can't use EJB directly.
How can I mantain a single class definition usable from EJB and GUI client java class?
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Originally posted by jose maria:

How can I mantain a single class definition usable from EJB and GUI client java class?

I think you mentioned web and gui client, isn�t it?
Well you should build a class using the Service Locator pattern accessed by classes that implement the command pattern and then you�ll be able to use the same classes for web and gui clients.
There�s a good descriptions of this patterns on the book Core J2EE Patterns and I suggest you to by it if you�re building applications using J2EE.
Next I�ll post code for a Service Locator class.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

One thing to watch out for, though - EJB's aren't easy to access directly from Internet clients. They use TCP/IP ports that are often firewalled.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: �Rich Client + EJB�
It's not a secret anymore!