This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Code complexity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Code complexity" Watch "Code complexity" New topic
Author

Code complexity

Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
Hey guys,

I have some questions about codeing for the asignment.

1.) Do you think al lot of boilerplate code affects the score, since it could be interpreted as unecessary nesting depth increasement?
2.) All this Exception handling seems to be poluting methods and constructors signatures. For example, the constructor for my hotel room DTO:


Since there is a lot of parsing from strings a lot can go wrong. Are all those exceptions an overkill?

Any help will be appreciated


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5139
    
  12

1/ having a lot of boilerplate code is never a good thing

2/ Only the ParseException is a checked exception, all other exceptions should not occur in a well-developed application (and thus should not be caught anywhere). I decided not to parse dates and just handle them as string (which removes the need of handling/declaring the ParseException)


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code complexity
 
Similar Threads
Question about multithreading using JNI.
firewall and javaw.exe and jvm
Passed SCJP 1.4 93%
Clean Code: Java only?
Simple program problem