This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Code complexity" Watch "Code complexity" New topic

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

I no good English.
Roel De Nijs

Joined: Jul 19, 2004
Posts: 7065

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
I agree. Here's the link:
subject: Code complexity
It's not a secret anymore!