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?
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.