• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

�Rich Client + EJB�

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.

 
Saloon Keeper
Posts: 24330
167
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic