• 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

URLyBird Question - DB Design

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any comments guys?
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think i get it already. The answer is in this thread,
https://coderanch.com/t/184814/java-developer-SCJD/certification/NX-RMI-Max-Book
 
reply
    Bookmark Topic Watch Topic
  • New Topic