• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URLyBird Question - DB Design

 
Tim Fernandez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All! I have been browsing through the old posts trying to get some ideas on how to go about my db design and saw this:


DB Side:
1> DataInterface it defines all the public methods of Data class.
2> RemoteDataInterface it extends DataInterface and Remote

3> LocalDataImpl it extends Data and implements DataInterface
4> RemoteDataImpl it extends Data and implements RemoteDataInterface

5> DataFactory it will return either LocalDataImpl or RemoteDataImpl depending upon the input given to its constructor. the returned object will be of type Data class.


I plan to use this design as my guide but i need some clarifications about somethings:
1) Since this is an old post (and probably an old version of the assignment), i dont need the DataInterface anymore. In the assignment DBMain is already the interface and Data.java implements it. So i should have something like:

1> DataMain (given) defines all the public methods.
2> RemoteDataInterface it extends DataMain and Remote.
3> LocalDataImpl extends Data and implements DataMain
4> RemoteDataImpl extends Data and implements RemoteDataInterface

Is this correct?

2) the interface DBMain provided in the assignment is written like this:

package ...
public interface DBMain {
//Reads a record from the file. Retirns an array where each
//element is a reord value.
public String[] read (int recNo) throws RecordNotFoundException

After reading the Java Coding convention and the 'How to write Doc Comments for the Javadoc Tool', i can see that its hasnt complied at all to some of the conventions. Should i still copy this as is since this is provided by SUn? For the implementing classes (Data and LocalDataImpl) can i just copy the documentation used in initerface DBMain?

Thanks in advance,
Tim
 
Tim Fernandez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any comments guys?
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11853
185
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tim,

Welcome to JavaRanch and this forum.

You might like to take a look at How to ask questions on JavaRanch, particularly the Patience is a virtue page.

Originally posted by Tim Fernandez
i should have something like:

1> DataMain (given) defines all the public methods.
2> RemoteDataInterface it extends DataMain and Remote.
3> LocalDataImpl extends Data and implements DataMain
4> RemoteDataImpl extends Data and implements RemoteDataInterface

Is this correct?
It sounds like you have a good basic concept, however it will need some tweaking. For example, the methods of DataMain do not throw RemoteException, so RemoteDataInterface will not be able to extend both DataMain and Remote.

Originally posted by Tim Fernandez
After reading the Java Coding convention and the 'How to write Doc Comments for the Javadoc Tool', i can see that its hasnt complied at all to some of the conventions. Should i still copy this as is since this is provided by SUn? For the implementing classes (Data and LocalDataImpl) can i just copy the documentation used in initerface DBMain?
My personal preference would be to fix the JavaDoc since:
From the instructions:
javadoc style comments must be used for each element of the public interface of each class
Plus fixing the comments in the interface means that your Data class can just inherit the documentation .

Regards, Andrew
 
Tim Fernandez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,

Thanks for the reply and sorry about the my being impatient.

I have a follow up question:

Originally posted by Andrew Monkhouse:
For example, the methods of DataMain do not throw RemoteException, so RemoteDataInterface will not be able to extend both DataMain and Remote.


Will this be a problem when methods of DataMain do not throw RemoteException?How can this be a problem for RemoteDataInterface?Im confused.
 
Tim Fernandez
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think i get it already. The answer is in this thread,
http://www.coderanch.com/t/184814/java-developer-SCJD/certification/NX-RMI-Max-Book
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic