Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database and Assertions

 
Robert Konigsberg
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

Newbie here, just getting started with the exam.

How much consideration do I need to give to things such as: in the DB.find implementation, if the criteria has fewer fields than the database record, should I allow the traditional exception to be thrown, or should I use an assertion?

Just a thought.

Rob
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Rob,

Welcome to JavaRanch and this forum.

You do need to consider these sorts of things, and they can make a difference to your overall score. But not a huge difference, so don't stay up all night worrying about it .

If you look at the JavaRanch SCJD FAQ you will see the breakdown of what was included in the "general considerations" section of the assignment. Clarity and Maintainability used to be a little over 7% of the assignment. Now the entire "general considerations" section has fewer marks assigned to it, but they are still worth some points.

So writing your code such that it will be easier for others to maintain is worth some points. So deciding whether to use an assertion (which tells the person mainitaining your code that the particular problem can never ever occur) is a good idea.

Now you just have to decide which you are going to use in each case .

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic