Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is this excessive commenting?

 
Yucca Nel
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dilema is as follows... a choice needed to be made. I was either to provide a class that had no use other then to extract the magic cookie and the num of fields and record size. But opted to not include it in my code as it does not give an function or benefits to the program.
The end result is this...

Where i leave a huge comment that I hope the assesor and future programmers will find usefull in knowing how and where I get these values.

Should I rather opt for the class to show how I got this value(even going as far as just creating a static class to open the database and make these available as constants)?
 
Yucca Nel
Ranch Hand
Posts: 147
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot to mention that my previous choices was to hardcode the values at the start of the database into my Value object by opening them in a static class and making them static.

something like this



And I would have done an assertion test to test my assumption but am under the impression that all Data value objects should have no coupling.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic