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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "URLyBird Question - DB Design" Watch "URLyBird Question - DB Design" New topic
Author

URLyBird Question - DB Design

Tim Fernandez
Ranch Hand

Joined: Aug 31, 2005
Posts: 65
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

Joined: Aug 31, 2005
Posts: 65
Any comments guys?
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11481
    
  94

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


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Tim Fernandez
Ranch Hand

Joined: Aug 31, 2005
Posts: 65
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

Joined: Aug 31, 2005
Posts: 65
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: URLyBird Question - DB Design