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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question about DesignPattern" Watch "Question about DesignPattern" New topic
Author

Question about DesignPattern

HaoZhe Xu
Ranch Hand

Joined: Nov 03, 2003
Posts: 222
I am doing a SCJD project, my project is URLyBird, a room booking system
In the instruction, it said there're three main part:
Server database management system
Client GUI
Network connection between those two
and the program must be able to work in a non-network mode, but I'm not sure what does it mean because the instruction also told me that the data access class must be called "Data.java", must implement a interface, so I got confused:
Client ----------- | Network Connection | ---------------Server
| |
| |
| |
Data Data
(for non-networking)(for networking)
So the Data class only deal with file accessing(open and read file from harddisk), it does not involve anything about networking, am I right?
but the database management system is on the Server side, if it runs in non-networking mode, does it have a DBMS? Does the DBMS mean the Data class?
I am in trouble...


[url]Olnex.net[/url]
[SCJP 1.2, SCJD, SCWCD]
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
HaoZhe,

So the Data class only deal with file accessing(open and read file from harddisk), it does not involve anything about networking, am I right?

Correct.
but the database management system is on the Server side, if it runs in non-networking mode, does it have a DBMS? Does the DBMS mean the Data class?

The DBMS is the Data code, the interface it implements, and all its helpers.
You can also put an adapter in front of Data's interface so the client does not work with it directly. This helps to keep server code independent of client code.


kktec<br />SCJP, SCWCD, SCJD<br />"What we observe is not nature itself, but nature exposed to our method of questioning." - Werner Heisenberg
HaoZhe Xu
Ranch Hand

Joined: Nov 03, 2003
Posts: 222
I am still a little confused: in non-Networked mode, do I need Server? For what?
Ken Krebs
Ranch Hand

Joined: Nov 27, 2002
Posts: 451
HaoZhe,
You need to have a clear separation of responsibilities within your code to make it maintainable and hopefully reusable as well.
joe black
Ranch Hand

Joined: Dec 03, 2003
Posts: 103
How does the client interact with the server in non-networked mode?
Kerry Friesen
Greenhorn

Joined: Oct 10, 2003
Posts: 23
Originally posted by Joe Black:
How does the client interact with the server in non-networked mode?

It doesn't. Your client doesn't need to communicate with a server in non-networked mode. The server should only be there to facilitate the network connection for network mode.
Regards,
Kerry


Kerry Friesen<br />SCJP 1.2<br />SCJD
joe black
Ranch Hand

Joined: Dec 03, 2003
Posts: 103
How does it access the methods in the Data class when in non-networked mode?
Kerry Friesen
Greenhorn

Joined: Oct 10, 2003
Posts: 23
Originally posted by Joe Black:
How does it access the methods in the Data class when in non-networked mode?

Many people, including myself, created a data adapter that provides access to your data class. You could make two adapters, one for each connection type, that implement an interface that defines the actions performed by the client, such as findRooms and bookRoom. Of course, that's just a suggestion
Cheers,
Kerry
joe black
Ranch Hand

Joined: Dec 03, 2003
Posts: 103
And when in the non-networked mode, should the user have to specify where the database file is, or is it safe to assume it's in the same directory?
Terry Martinson
Ranch Hand

Joined: Oct 18, 2003
Posts: 293
Joe -
In my implementation I plan to let the user either type in the database location or locate it with a JFileChooser.
TJ


SCJP, SCJD, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about DesignPattern