• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Multiple clients support

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have decided to support both a browser client for customers and a Java Swing application for travel agent and to put the business logic in the EJB tier.
Can anyone tell me how it is possible to support the 2 kind of clients. The browser client will obviously connect to the web tier but should the Java client be a web client too or should it connect to the EJB tier directly.

I have heard of designing one FrontController per client type. But in which layer is the FrontController supposed to be (web tier or EJB tier).
What is the relationship betwenn FrontController and BusinessDelegate?

Regards,
Annick
Annick
 
Ranch Hand
Posts: 341
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Can anyone tell me how it is possible to support the 2 kind of clients.


It's certainly possible. If you look at the J2EE specifications, it allows multiple client types within an EAR file. An EAR file can contain
ejb-jar file - contains business logic
war file - contains web client application (servlet etc.)
application client jar file - contains stand alone client (swing batch etc.)
rar files - contains resource adapters to connect to for example EAI systems
and more...

Look at Chapter 9 of the J2EE 1.4 specifications (or whatever chapter number in version 1.3), which explains how you could write a swing client and make it a part of the ear file. To specifically answer your question, no, the java client will not be a web client (it can't be called java client then), it will be a standalone application (e.g. swing) that will be packaged in a jar file. How this application accesses the business logic (ejb etc.) is defined in the application.xml file. I haven't looked at the assignment yet but I would design delegates, EJBs and DTO (or VOs) in the business tier, populate DTOs in the web tier or application client tier and pass them on to the delegates, which shield EJBs from both the types of clients.

I have heard of designing one FrontController per client type. But in which layer is the FrontController supposed to be (web tier or EJB tier).


Front controller is always in the web tier. Look at This design pattern to understand how it works. In a nut shell, front controller is THE FIRST component (typically a servlet) to intercept ALL incoming requests from the browser. It then delegates requests to other servlets (or commands or actions) based on the URL for further processing. These actions/commands will invoke delegates. While theoretically you can use front controller for swing client as well, common practice is to use event listeners, which will be invoked when (say) you click a button. These event listeners could invoke delegates for business processing.

What is the relationship between FrontController and BusinessDelegate?


Front controller: The FIRST component to intercept ALL the incoming requests (single point of entry in a web application)
Business delegates: Doorway for the client tier into the business tier. Delegates shield the complexity of the business tier components (EJB look ups etc.) from the client.

Let me know if you have more questions

Edit: typo etc.
[ August 24, 2005: Message edited by: Chintan Rajyaguru ]
 
Annick BOEL
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Chintan,
Thank you very much for your answer.

When I spoke of java client as a web client, I was thinking of a java client connecting the web tier and not the EJB tier. Does it make sense?

I try to understand all the information you gave me and will come later.
Regards,
Annick
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic