• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How many classes should server part have?

 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I choose RMI approach to develop my networking server.
I found it's very easy to implement a RMI server.
I only use 3 classes to complete the server.
However, my concern is that
is this too simple? Will I lose some point because of a simple server?

My RMI server class has only something like below:

LocateRegistry.createRegistry(1099);

Naming.rebind("HomeContractorService", new HomeContractorDBImpl("M:/SCJD/DB/db-2x3.db"));

and two more class, remote interface and its implmentation.

How huge does everyone develop for a RMI server?

Thanks

Lee
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chih-Wei Lee:
I choose RMI approach to develop my networking server.
I found it's very easy to implement a RMI server.
I only use 3 classes to complete the server.
However, my concern is that
is this too simple? Will I lose some point because of a simple server?

My RMI server class has only something like below:

LocateRegistry.createRegistry(1099);

Naming.rebind("HomeContractorService", new HomeContractorDBImpl("M:/SCJD/DB/db-2x3.db"));

and two more class, remote interface and its implmentation.

How huge does everyone develop for a RMI server?

Thanks

Lee


Hi,

my server was a little bigger than yours, most of the effort put on the SWING Interface and fault tolerance.. Minimally, you still have to let the "server user" choose the database file.

You should also handle closing the server, which I guess could be done by pressing Ctrl-C or closing the console. In such case, you might want to look at "shutdown hook" to be notified before closing (if you want to perform some cleaning tasks).

But I'd agree that the server should be quite simple..

bye,
Alex
 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alex, thanks for your response.
I have taken a look Andrew's book about ShutdownHook.
but I don't understand why he create a new database and lock the database
when server shutdown.
So what do you do when the server shutdown?
do you also lock the database?

Thanks

Lee
 
Alex Belisle Turcot
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chih-Wei Lee:
Alex, thanks for your response.
I have taken a look Andrew's book about ShutdownHook.
but I don't understand why he create a new database and lock the database
when server shutdown.
So what do you do when the server shutdown?
do you also lock the database?

Thanks

Lee


Hi,

unfortunalty, I don't have Andrew's book with me, I don't know what you are refering to. It might be specific to the example.

The Shutdown hook should be used to stop/close anything cleanly.. Since the assignment is quite simple, it could mean making sure
- the remote object is unbound;
- the file is closed;
- ...

I wouldn't do anything about "locking database"..

Nothing too fancy, just think what must be performed when your application is closing..

Regards,
Alex
 
Chih-Wei Lee
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot!
Your answer clarify my question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic