Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Fast lane reader" on the Swing client

 
Hitry Mitry
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

It's easy to see that using a "fast lane reader" pattern with a Swing results in a 2-tier approach that bypasses the application server altogether, and reading the database directly from the client application.

My questions:

1)is it allowed from the point of view of "J2EE-ness" of the solution?

2) How can one ensure that secure sockets are used for the JDBC calls between the client machine and the DB server? My anticipation is that it is a matter of configuring the dabatase server?

as usually, thanks for your help,

(D)mitry
[ July 23, 2005: Message edited by: Hitry Mitry ]
 
David Follow
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mitry,

my understanding of fast lane reader is not to bypass the application server, but bypass EntityBenas and use the DAO pattern instead.
You would use the FLR Pattern if you want to read "non-Entity" data or read only data where the overhead of EntityBeans would not make much sense. For example if you want to retrieve tabular-like data (e.g. all registered customers for display only). For this you would not load all the customers as EntityBeans since you will not need the services EntityBeans provide for this use case.
Do you see where I'm going?

D.
 
Hitry Mitry
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi David,

I see what you mean: you still want to use session EJB's, like in Cade's book.

Strictly speaking, the beans' participation is not necessary here at all, I think: theres no need to demarcate transactions. The only thing you need is a JDBC-capable POJO, i.e. a DAO. That's exactly what they do in the Petstore example, with a DAO residing in the web tier.

In the case of the Swing client, however, this leads to the funny problem that I described in my previous post...
[ July 23, 2005: Message edited by: Hitry Mitry ]
 
David Follow
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hitry,

in the assignment it says that we have one application server and two web servers. Now the question is, what is mean with the two web servers?

To me, an application server (which we have exactly one of) has an EJB-Container and a Servlet-Container.
A web server (for my understanding) is something like Apache or iPlanet, so to speak, something that hosts only static content but and is able to forward dynamic requests to the Servlet-Engine through some kind of plugin.

So bottom line: application server = J2EE; web server = static content only (e.h. HTML, imanges etc.)

What is your understanding of the one application server and the two web servers?

D.
 
Hitry Mitry
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David,

I used to think that the servlet container resides on the web server (e.g. apache tomcat), although, I have to admit, I don't know for sure. I don't see though how it's relevant to the present discussion, because the Swing client (in my design) bypasses the web container anyway, no matter where it's situated. That's necessary to satisfy the requirement on different QoS...
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the assignment is very old ,for the assignment you can think application server for EJBs and web server as a servlet container.

You can think in either of the way, Sun will not have any issue, provided you will be able to justify in your architecture and essay exam.
 
Vinay Singh
Ranch Hand
Posts: 174
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Web Server contains your war file i.e servlets/jsp/images etc.
Application server contains your EJB(Sesssion+Entity+DAO) and all other dependent classes.
So there would be two deployable unit war & ear. That is one of the preferred mode of application deployment.
Swing client would always talk to application client , not to web client.
Hitry if you are using FAST lane , it means you are bypassing EJB and everything and calling DAO from you Java Beans.
This would not be feasible in this architecture, hence you cannot use Fast lane.
I would say all calls are done through session beans and they call DAO for data and the same business method would serve swing as well as web.
 
David Follow
Ranch Hand
Posts: 223
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From my understanding an application server contains an EJB container AND a servlet container. I guess that is also the understanding of most books (incl. those from Sun). However, if Sun understands for this assignment a web server as an Servlet container (e.g. Tomcat) ... so shall be it.
Further, an EAR typically has a WAR (web app) and a bunch of JARs (EJBs and classes). Unless you want to deploy it on different machines.

Regarding Fast lane, I also think the client should go through the app server and not directly talk to the DAO. This would break the architecture and bypass the benefit of the business tier (think about security and other container services).

D.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic