aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Leaving the provided interface comments unchanged? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Leaving the provided interface comments unchanged?" Watch "Leaving the provided interface comments unchanged?" New topic
Author

Leaving the provided interface comments unchanged?

Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

What are the rules as far as the interface provided are concerned? Must the interface be left untouched and unchanged? There are some annoying line comments that I would prefer to change into javadoc comments. Can I do this? Must the comments be left there? etc etc.


SCJP 6.0, SCJD (400/400), SCBCD for JEE 5, SCWCD 1.4 I do videos for development at
http://www.youtube.com/user/thejartender?feature=mhee
I am probably the only developer ever to have had an orange sized brain tumor in my brain while learning development!!
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

Hi Yucca,

I personally don't see why the interface's comments need to be changed. If you understand those comments, you would know what to do (how to implement). If you don't understand, then you should post your worries.

Also Sun's given interface is just the "must implement" methods. Many other people feel that there are other "must" implement methods that should be included in the interface file. It is up to you where these other methods go.

Hope this helps.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2265
    
    3

No, the interface cannot be changed. About the comments, I guess you can change them, since they won't interfere in the program's execution. I prefered to leave them just as I received them, but used JavaDoc comments, instead of code comments.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

So would you say that its ok to change this...

to this...


or this ...


Option 2 looks better and still provides the commenting in my opinion
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2379
    
    7

option 1 will do the trick. Since you need to generate javadocs. That is absolutely fine as javadoc for the read method.
Yucca Nel
Ranch Hand

Joined: Nov 20, 2008
Posts: 147

Thank you for replies.
Alecsandru Cocarla
Ranch Hand

Joined: Feb 29, 2008
Posts: 158
I also added my own comments to those from SUN, especially at the lock() method where I added some more rules to follow in order to avoid deadlocks. I also javadoc'ed runtime exceptions that I chose to throw.

I don't see why the comments cannot be changed, since they are not part of the actual interface, they're not affecting how the interface looks like in terms of code.


SCJP 1.4 100%
SCJD 99.5%
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Leaving the provided interface comments unchanged?