• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: readme.jar

 
Eric Kim
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did not quite fully understand how the hell runme.jar supposed to work, and developed the first version of the assignment. Here is what I have:
DBServer which does something like this:

Then Client which is a pure client implemented in JFC. It can open a local database or connect to server created above.
Now this runme.jar thing starts to beat me.
1) I am not sure how that runme.jar can handle server/alone/empty modes.
2) In server mode how do I shutdown RMI server? Currently after rebind is called, the code lose control to server thread.
3) To implement this runme executable, what is the right directory structure? In my approach I have
code
|---- client
|---- db
|---- server
But with a single runme, it is not clear where that start class belongs to.
Any help is highly appreciated. I am totally stuck right now.
 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
I have implemented the start class in the client package.
Regards,
Maria
 
Eric Kim
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maria,
Does that mean you have something like this?

And let this starter class starts everything? I am totally confused on how this is supposed to work.
I think SUN's design spec on this issue is very ugly. Essentially this is a client-server stuff (though it is very primitive), different part does different thing, code module can be shared, but it does not make any sense to me to have a centeralized starter class. Just think about SQL Server or MySQL or whatever, you always have a seperate application to start Server, then you have your query client, be it SQL*Plus, ISQL, Query Analyzer or any other query tools. It just sounds very stuoid to mess those things together.
Eric
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Eric,
Yes, your basic concept is right. Personally I prefer to have separate applications (client and server) then just have the Start class as a wrapper to them:

This gives you more flexibility in the future: Your client and server applications can be easily split if needed, and extra command line arguments can be processed at the correct level (only within DBServer, not within both DBServer and Start).

I think SUN's design spec on this issue is very ugly.

Not at all: it is quite neat, and is a common requirement when distributing applications. There is only one jar file being distributed throughout the company. It is therefore much easier to check versions and to ship updates. And there is never the problem of having missed a file needed for a specialised mode.
Regards, Andrew
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic