aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Instructions Question : TableSorter 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 "Instructions Question : TableSorter" Watch "Instructions Question : TableSorter" New topic
Author

Instructions Question : TableSorter

Alan Morgan
Ranch Hand

Joined: Apr 18, 2005
Posts: 113
Hey all,

I used the TableSorter class that can be found here

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html#sorting

to allow sorting of my JTable by clicking on the column header.
I did not change the code in any way.
I noted that I did this in my choices.txt.
I believed that as it was code provided by Sun themselves then this would be ok.

But I'm starting to get worried over the following line in my instructions:

"You are permitted to use any IDE tool you choose, but you must not submit any code that is not your own work"

I'm worried about automatic failure because of this.
Anyone got an opinion on this ?
Or even better again, anyone used something like this and pass ?

Thanks,
Alan.
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11481
    
  94

Hi Alan,

The general recommendation whenever anyone finds a helper class that they want to use is: make it your own! That is, don't just blindly copy the code from Sun's site into your project. Read the code, make sure you understand it, then reimplement it yourself. Your reimplementation might end up looking very similar to the original, but it will be code that you are comfortable with, and code that you can describe and modify and maintain.

Regards, Andrew


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

Joined: Apr 18, 2005
Posts: 113
Originally posted by Andrew Monkhouse:
Hi Alan,

The general recommendation whenever anyone finds a helper class that they want to use is: make it your own! That is, don't just blindly copy the code from Sun's site into your project. Read the code, make sure you understand it, then reimplement it yourself. Your reimplementation might end up looking very similar to the original, but it will be code that you are comfortable with, and code that you can describe and modify and maintain.

Regards, Andrew


Hi Andrew,

I get what you are saying but how far do you take this ?
There are some comments missing from public methods and they would have to be added to satisfy the javadoc requirement.

Howver if I read the code now I understand it and would be happy that I could maintain it if necessary.

So I can go through it and make superficial changes for the sake of it e.g. changing variable names etc.

I guess what I am asking is how far I have to go to make it my own ?

Another example is the class comment. It describes perfectly what the class does so how can I really change this without either making it incorrect or making superficial changes just for the sake of it ?

Thanks,
Alan.
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
I wonder if you would want to include the table sorter.
I am following the policy of Keep It Simple, as far as the GUI is concerned. Dont want to include something that is not required/essential.

But would it be nice to include the table sorter.

Also make sure you map correctly to the row_number somehow. I think the Sun example, do a sort on the JTable content level.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Instructions Question : TableSorter