• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

B&S: Unimplemented exceptions

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I believe I've answered my own question with this link

https://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?
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I think you should put your exception class where it's belong to. This is an OO design concept.
 
reply
    Bookmark Topic Watch Topic
  • New Topic