From your "business layer" you would use jdbc to communicate with the
database. From your "presentati on layer" to your "business layer" there are,
as you have discovered, there are lots of options.
You could:
* use sockets and define your own message formats.
* use RMI (Remote Method Invocation) this allows you to call a method (e.g.
x = max (1,2)) - but the method (through the magic of RMI) actually runs
elsewhere.
* create a web service which you request it to perform a task for you and it
sends you a response.
* Use a Message queue to deliver messages to a consumer (e.g. a Message
Driven Bean or a JMS listener).
All of these do essentially the same thing, communicate a request from the
client to a service asking it to do something for you.
The choice of which one (or ones to use) will depend upon what you need to
achieve.
For example, I'm currently working on a project where I need a client to be
able to send a request and get a response. If the service is down, then the
client is inoperative. We've elected to use a Web Service because it is a
request/response architecture.
On another recent project we also needed to deliver requests to a service
and get a response back. However, if the service was down we needed to
capture the client requests and deliver them when the service was back up
(i.e. the client continued to operate in an offline mode). Persistent
message queues worked well for this because the client could put the message
in the queue and forget about it. If it got a response back it did something
with the response otherwise it just skipped that step.
In yet another instance I needed to have a continuous two way dialogue
between an applet and the server from which it came - in this particular
case I had to use sockets.
So in short the choice of method depends upon understanding what you need,
what each mechanism provides and what you are willing to do.
I'd suggest doing a search for Java networking or Java client server or
similar.
Hope this helps
"Ian Semmel" <is***********@ NOJUNKrocketcom p.com.auwrote in message
news:a5******** **********@news-server.bigpond. net.au...
>I am not new to computing, but I am to Java and wonder if anyone could
point me in the right (or a) direction.
Specifically, how are multi-tiered applications put together. There
appears to be multiple paths available and it all gets a bit confusing (to
me).
If, for example, I have something like (this is not a web app):
- a front end which controls a number (variable at runtime) of
terminals/workstations.
- a database later
- a main business layer
- other things
How are all these linked? I am thinking perhaps separate processes
communicating via JMS or sockets etc.
Is this how it's done or are there better ways.
Sorry if this is way off.