jQuery in Action, 2nd edition*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes B&S: Unimplemented exceptions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "B&S: Unimplemented exceptions" Watch "B&S: Unimplemented exceptions" New topic
Author

B&S: Unimplemented exceptions

Aaron John
Ranch Hand

Joined: May 30, 2005
Posts: 74
Hi, sorry if this has been brought up before, but I wasn't able to find anything regarding the following.

The assignment specification says.

Any unimplemented exceptions in this interface must all be created as member classes of the suncertify.db package.

So my interface contains RecordNotFoundException and DuplicateKeyException. To my understanding member classes do not have any visibility outside of the package it belongs to. So RecordNotFoundException is only visible in the db package. Does that mean I must define my exceptions as the following?



If that's the case, how can I handle a RecordNotFoundException in my business layer?

Also in my business layer I defined new interfaces, is it necessary to put this interface in the suncertiy.db package as per the specification, or put the new interface in my business package?

thanks
[ June 06, 2008: Message edited by: Aaron John ]
Aaron John
Ranch Hand

Joined: May 30, 2005
Posts: 74
I believe I've answered my own question with this link

http://www.coderanch.com/t/188630/java-developer-SCJD/certification/Exceptions-created-as-member-classes

A member class is not a class that has visibility within a given package. This clears up my misunderstanding.

So obviously it makes sense to have these exceptions as public.

However for my other question, if I defined an exception in my business layer, would it be best to put that exception in the suncertify.db package or put that exception in my business layer package?
Soroj Margun
Ranch Hand

Joined: Jun 15, 2008
Posts: 44
Hi, I think you should put your exception class where it's belong to. This is an OO design concept.


SCJP 1.2; SCWCD 1.2,1.4; SCBCD 1.3; SCJD 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: B&S: Unimplemented exceptions