Re: Applet Consideration
From: Yamin (absdfsd_at_sdfdasfsd.com)
Date: 03/17/04
- Next message: Yamin: "Re: Applet Consideration"
- Previous message: Mark Matthews: "Re: Applet Consideration"
- In reply to: Mark Matthews: "Re: Applet Consideration"
- Next in thread: Yamin: "Re: Applet Consideration"
- Reply: Yamin: "Re: Applet Consideration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 16 Mar 2004 18:27:33 -0500
Okie guys,
Having just went through the learning experience of sorts...this is what I
did.
I have essentially 2 application
1. Applet
2. Server
Applet (Client)
Has all the GUI code and what not. As I said, it was suprisingly easy to
convert my standard application to an applet. I then created clientstubs
for any database access application
i.e. boolean login(String domain, String user, String pass)
I used a really cheap protocol, as the data being sent is just Strings and
some ints.
Basically, everything is sent as String. One String per line so functions
like readline() can work nicely.
*************************************
Client request consists of:
Command String (i.e. "LOGIN" )
param1 String
...
paramn String
Server replies consist of
result string( i.e "PASS" or "FAIL" )
return1 String
....
return paramn String
*************************************
I made it so the client has absolutely no knowledge that the db exists.
Otherwise, I'd have to grant access to the client to hold locks and what
not, which I did not want to give for security reasons. To the client,
everything looks like a function call (w/th some remote method type stuff)
Server (runs on the same machine as the webserver/database...)
The server listens on a port and starts server threads for each new
connection. Each thread must be initialized by a login. This login open a
connection to the database. I did it this way, so in case a thread goes
broke or someting, any locks on tables, transaction will behave nicely and
the user can't preform any operations without login in correctly first.
*************************************
Things I might have done differently:
1. I really wanted to use SSL to encrpypt the connection. This way, login
passwords and other data could be transferred nicely. I read through the
docs samples and what not, but just decided against it as I didn't want to
add any more things that I really didn't understand.
And it seems to work quite well. I tested it both locally and remotely. It
all seems nice ;) Sure, it might have been nice to learn PHP and what not
(it got really tempting last night), but I already did a lot of work on this
in Java, so such is such.
Yamin
- Next message: Yamin: "Re: Applet Consideration"
- Previous message: Mark Matthews: "Re: Applet Consideration"
- In reply to: Mark Matthews: "Re: Applet Consideration"
- Next in thread: Yamin: "Re: Applet Consideration"
- Reply: Yamin: "Re: Applet Consideration"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|