aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes network client/server design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "network client/server design" Watch "network client/server design" New topic
Author

network client/server design

ed gormley
Greenhorn

Joined: Aug 21, 2002
Posts: 3
Hi all,
I'm using RMI to tackle networking for the assignment and have some questions about the project specs.
What exactly is *required* to be handled on the client side, and what on the server side?
The spec says(under Writing Data Client):
"This implementation should include a class that implements the same public methods as the suncertify.db.Data class..."
Am I mistaken in interpreting that as having a stub class that provides(for the client) all the interfaces of the real thing, but with the actual work to be delegated to the server's Data object, that does the real work.
I'm also wondering whether it is okay(not violating the specs) to simply do everything on the server side, like searching, sorting, record locking, caching, and whatever else you can think of.
Also is it against the specs to have a "shopping cart" wherein when a record is put it is locked, but can be popped later and unlocked? I know that the specs say "...locking required is effectively a 'write' lock only" and wanted to be sure I can add a read lock without getting my turn-in voided.
I've been looking, thinking, and scratching my head over the assignment for over a week now and generally I am having doubts in places like above where the specs aren't very clear.
Appreciate any thoughts and comments/criticisms.
thank you -- ed
ed gormley
Greenhorn

Joined: Aug 21, 2002
Posts: 3
quick add-on:
I really don't like the name "Data". Can I rename this to "Database" assuming I document the change and rename other supplied classes as well?
thank you -- ed
[ August 21, 2002: Message edited by: ed gormley ]
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Ed,

Am I mistaken in interpreting that as having a stub class that provides(for the client) all the interfaces of the real thing, but with the actual work to be delegated to the server's Data object, that does the real work.

Not necessarily a stub class since you also have to be able to connect to a local Data object without creating any Sockets, but basically yes. I did it exactly that way, creating composites that implemented the public interface of Data, both local and remote. Others have actually used Data or a subclass for local access, but I (just opinion) don't like that approach since it couples Data to the client.

I'm also wondering whether it is okay(not violating the specs) to simply do everything on the server side, like searching, sorting, record locking, caching, and whatever else you can think of.

Once again, that was my approach, although caching is probably beyond the scope of this assignment. Actually, I implemented sorting on the client inside my table model. The rest of the database work was done on the server or db package.

Also is it against the specs to have a "shopping cart" wherein when a record is put it is locked, but can be popped later and unlocked? I know that the specs say "...locking required is effectively a 'write' lock only" and wanted to be sure I can add a read lock without getting my turn-in voided.

I don't think you would fail the certification for implementing a read lock, but I doubt that it would help you either. Also, think of the other clients. Remember that this is for booking flights, not buying sundries. How fair would it be for one client to lock all the flights from LAX to SFA waiting for the purchaser to make up his mind which flight he wants to take? Fly By Night would start losing customers fast if this sort of thing happened often.

I've been looking, thinking, and scratching my head over the assignment for over a week now and generally I am having doubts in places like above where the specs aren't very clear.

That's what this is all about!! The instructions are deliberately vague to see how you deal with all the well known problems of this assignment. You will be assessed by your thought process and consistency of that process. For example, I am very anal about disarming users with an IQ below 90. I tend to create redundant backup plans so that idiots can't screw everything up. That's based on nearly thirty years of professional programming. Your thought processes will be different. Just be thorough and consistent and don't worry about all the ambiguities in the assignment.

I really don't like the name "Data". Can I rename this to "Database" assuming I document the change and rename other supplied classes as well?

I would not recommend changing anything about Data or its support classes that was not absolutely required by your design.
Hope this helps,
Michael Morris


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
ed gormley
Greenhorn

Joined: Aug 21, 2002
Posts: 3
hi michael,
thank you for your ideas and suggestions! my uncertainty came from the lack of specific instructions inside the specs, but I'm now less worried about things(I guess I'll just do everything server side, minus the sorting) and document the heck out of my design.
Thanks -- ed
[ August 21, 2002: Message edited by: ed gormley ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: network client/server design
 
Similar Threads
NX: createRecord(String [ ]) in URLyBird
Doubts reagarding database operations for Bodgitt and Scarper
Locking and File IO
lock and unlock
NX: Locking and Unlocking and Sun's Must Conditions