• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about DesignPattern

 
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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...
 
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am still a little confused: in non-Networked mode, do I need Server? For what?
 
Ken Krebs
Ranch Hand
Posts: 451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HaoZhe,
You need to have a clear separation of responsibilities within your code to make it maintainable and hopefully reusable as well.
 
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does the client interact with the server in non-networked mode?
 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
joe black
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does it access the methods in the Data class when in non-networked mode?
 
Kerry Friesen
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 103
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 293
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Joe -
In my implementation I plan to let the user either type in the database location or locate it with a JFileChooser.
TJ
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic