If you want a generic message
format to use between applet
and servlet, I'd look at sending
XML, it has the following advantages:
1) buzzword compliance :-)
2) flexible
3) freeware parsers and generators available
4) debuggable - IE5 will show
you a nice tree view if it gets an XML
response.
Tim.
Maxime Poulin <[EMAIL PROTECTED]> wrote:
__________
>Hi all and welcome to the second edition of this fabulous chronicle "Your
>Opinion On ..."
>
>As you might remember, the first subject of this outstanding serie was
>entitled "Your opinion on a servlet architecture", to which a lot of great
>people participated... Well, this conversation thread, which took place on
>this mailing list, was started up with a mail I sent containing the
>description of a basic applet-servlet architecture I had. The thread went
>on, and I've gathered a lot of absolutely excellent ideas and propositions
>from you people. This resulted in the fact that the basic model I had, after
>reading all the mails and propositions, becaome at least trice as good as it
>was. I implemented it - again, based on my first draft and greatly improved
>by your ideas - and I received the congratulations of the team here. So
>first, I return to you all these congratulations !
>
>hehe :)
>
>Now, for the second edition of this chronicle, I have another problem to
>submit. It is somewhat smaller than the previous one, but yet, still
>represents a problem...
>
>So here it is :
>
>I am building a soft which will contain servlets (the Control), an applet
>(the View) and a database (the Model). Nothing new here, I will use the same
>architecture we built up together in the first chronicle. The client will
>use the applet to "query" the database through the servlets, using different
>pre-defined screens. For example, a screen which displays the inventory will
>use the InventoryServlet. The applet will just send the criterias for the
>search, such as the year, the plant etc. It is important to note that the
>applet will not sent a SQL query to the servlet, since the applet is not
>aware on how the servlet gets the data.
>
>SO, the idea is that when the applet will send its requests to the servlets,
>it will send it as a Serialized object. And this is what interests me here,
>how to build a good architecture of Requests-responses for this project.
>
>Basically, we could imagine 2 "top-of-hierarchy" classes, GenericRequest and
>GenericResponse (hmm, here, I do not intend to make any link with
>HTTPServletRequest or HTTPServletResponse, the names are just appropriate).
>
>The types of request could be like :
>Get the "resultset" (although I do not want to serialize the resultset
>'cause I will have to import the jdbc package in my Applet) using these
>criterias, through that servlet.
>
>Get this information concerning the software configuration.
>
>Validate this information (such as a password).
>
>Get a specific value from the database.
>
>Get an image or any other media.
>
>The types of responses could be like :
>Return the "resultset" for this specific query (as a 2d array most probably)
>
>Return the information requested.
>
>Return the validation.
>
>Return the URL for the desired media.
>
>Return a return code.
>
>I would like all the types of "request" be a subclass of GenericRequest,
>which is serializable, and all the types of "Answers" be a subclass of
>GenericResponse, also serializable.
>
>The applet will be able to send multiple requests without waiting for an
>answer, with a threaded communication manager I built. So I must be able to
>identify the requests and answers in some way...
>
>I tried to figure out how to do this... I don't know, I kind of get stucked
>right at the beginning... I built much more complicated things and yet I
>fail with this simple problem, building a nice clean message hierarchy. I
>can imagine some more or less nice architecture but I do not feel them
>right...
>
>So could anyone give me a startup for this ? Or point me to a web site where
>this issue is discussed (like how to model messages or something like that)
>? As easy as it may seem, I am really stucked with this thing...
>
>Thank you very much all !
>
>Max.
>
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
><HTML>
><HEAD>
><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
><META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2650.12">
><TITLE>Your opinion on communication architecture</TITLE>
></HEAD>
><BODY>
>
><P><FONT SIZE=2>Hi all and welcome to the second edition of this fabulous chronicle
>"Your Opinion On ..."</FONT>
></P>
>
><P><FONT SIZE=2>As you might remember, the first subject of this outstanding serie
>was entitled "Your opinion on a servlet architecture", to which a lot of
>great people participated... Well, this conversation thread, which took place on this
>mailing list, was started up with a mail I sent containing the description of a basic
>applet-servlet architecture I had. The thread went on, and I've gathered a lot of
>absolutely excellent ideas and propositions from you people. This resulted in the
>fact that the basic model I had, after reading all the mails and propositions,
>becaome at least trice as good as it was. I implemented it - again, based on my first
>draft and greatly improved by your ideas - and I received the congratulations of the
>team here. So first, I return to you all these congratulations !</FONT></P>
>
><P><FONT SIZE=2>hehe :)</FONT>
></P>
>
><P><FONT SIZE=2>Now, for the second edition of this chronicle, I have another problem
>to submit. It is somewhat smaller than the previous one, but yet, still represents a
>problem...</FONT></P>
>
><P><FONT SIZE=2>So here it is : </FONT>
></P>
>
><P><FONT SIZE=2>I am building a soft which will contain servlets (the Control), an
>applet (the View) and a database (the Model). Nothing new here, I will use the same
>architecture we built up together in the first chronicle. The client will use the
>applet to "query" the database through the servlets, using different
>pre-defined screens. For example, a screen which displays the inventory will use the
>InventoryServlet. The applet will just send the criterias for the search, such as the
>year, the plant etc. It is important to note that the applet will not sent a SQL
>query to the servlet, since the applet is not aware on how the servlet gets the data.
></FONT></P>
>
><P><FONT SIZE=2>SO, the idea is that when the applet will send its requests to the
>servlets, it will send it as a Serialized object. And this is what interests me here,
>how to build a good architecture of Requests-responses for this project.</FONT></P>
>
><P><FONT SIZE=2>Basically, we could imagine 2 "top-of-hierarchy" classes,
>GenericRequest and GenericResponse (hmm, here, I do not intend to make any link with
>HTTPServletRequest or HTTPServletResponse, the names are just appropriate).</FONT></P>
>
><P><FONT SIZE=2>The types of request could be like :</FONT>
><BR><FONT SIZE=2>Get the "resultset" (although I do not want to serialize
>the resultset 'cause I will have to import the jdbc package in my Applet) using these
>criterias, through that servlet.</FONT></P>
>
><P><FONT SIZE=2>Get this information concerning the software configuration.</FONT>
></P>
>
><P><FONT SIZE=2>Validate this information (such as a password).</FONT>
></P>
>
><P><FONT SIZE=2>Get a specific value from the database.</FONT>
></P>
>
><P><FONT SIZE=2>Get an image or any other media.</FONT>
></P>
>
><P><FONT SIZE=2>The types of responses could be like :</FONT>
><BR><FONT SIZE=2>Return the "resultset" for this specific query (as a 2d
>array most probably)</FONT>
></P>
>
><P><FONT SIZE=2>Return the information requested.</FONT>
></P>
>
><P><FONT SIZE=2>Return the validation.</FONT>
></P>
>
><P><FONT SIZE=2>Return the URL for the desired media.</FONT>
></P>
>
><P><FONT SIZE=2>Return a return code.</FONT>
></P>
>
><P><FONT SIZE=2>I would like all the types of "request" be a subclass of
>GenericRequest, which is serializable, and all the types of "Answers" be a
>subclass of GenericResponse, also serializable.</FONT></P>
>
><P><FONT SIZE=2>The applet will be able to send multiple requests without waiting for
>an answer, with a threaded communication manager I built. So I must be able to
>identify the requests and answers in some way...</FONT></P>
>
><P><FONT SIZE=2>I tried to figure out how to do this... I don't know, I kind of get
>stucked right at the beginning... I built much more complicated things and yet I fail
>with this simple problem, building a nice clean message hierarchy. I can imagine some
>more or less nice architecture but I do not feel them right...</FONT></P>
>
><P><FONT SIZE=2>So could anyone give me a startup for this ? Or point me to a web
>site where this issue is discussed (like how to model messages or something like
>that) ? As easy as it may seem, I am really stucked with this thing... </FONT></P>
>
><P><FONT SIZE=2>Thank you very much all !</FONT>
></P>
>
><P><FONT SIZE=2>Max.</FONT>
></P>
>
></BODY>
></HTML>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
---
URL http://www.westhawk.co.uk/
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html