• 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

NX: Assignment - lawyer approach

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
I have to apologize in advance if this issue already have being discussed before.
I have got my assignment and take rather lawyer approach to instructions.
My problem is:
- All code must be provided with javadoc comments. I must include interface made by Sun folks. This interface has non-javadoc comments. Its coding style is far from Sun recommended. Should I change it? There is statement that project will be checked automatically first so changing staff like this can be suicidal.
- The program must provide search ability by "exact match". Given interface require "Starts with�" search implementation. Should I include two options?
What will be your suggestions?
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Slava,
Welcome to this forum.

Originally posted by Slava Zipunov:
I have got my assignment and take rather lawyer approach to instructions.
My problem is:
- All code must be provided with javadoc comments. I must include interface made by Sun folks. This interface has non-javadoc comments. Its coding style is far from Sun recommended. Should I change it? There is statement that project will be checked automatically first so changing staff like this can be suicidal.
- The program must provide search ability by "exact match". Given interface require "Starts with�" search implementation. Should I include two options?


What can you change in the Sun interface?
I think you can safely modify the format of the comments so that they are in proper javadoc format. I would not modify the content of the comments, only the format. Other than that I would make no changes to the code in the Sun interface. Specifically I would make no changes to any of the method signatures. If the examiner wants to test your Data class implementation using the Sun interface they should be able to do so. If you make any changes to the method signatures in the Sun interface this sort of testing may not work correctly.
Is the find method described in the Sun interface an "exact match"?
Most people do not think that the way the comment for the find method is written satisfies the requirement to support exact matches. I believe most people implement the find method exactly as described in the Sun interface, that is they implement a (case sensitive) starts-with match. They then take other steps to support exact matches. The other steps are described in more detail elsewhere on the forum (you might search for the term "exact match" for those topics). There are two main approaches.
The first approach uses the find method to get all the records that match the criteria on the basis of a starts-with match, then this result set is filtered to remove those records that are not an exact match. The final result set then contains only those records that are an exact match.
The second approach uses a scheme that involves right-padding the fields with blanks so that all the fields are their maximum length. If fields are their maximum length, then even though find does a starts-with match it effectively will produce the same results as an exact match.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic