• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

exceptions = member classes ?

 
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

The assignment says:

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



"Java in a Nutshell" defines member classes this way:

A member class is a class that is declared as a non-static member of a containing class.



I just placed those exceptions (RecordNotFoundException, DuplicateKeyException, SecurityException) in package suncertify.db,
without making them inner classes to any containing class.

Did I violate this requirement ?

Kind regards,
Andy
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your exception classes should just be classes inside the db-package, not as inner classes of the Data class.
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Roel De Nijs wrote:Your exception classes should just be classes inside the db-package, not as inner classes of the Data class.



Agreed. And do not forget the constructors specified in the assignment!
 
Andy Jung
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
... ok, that's fine, I submitted the project yesterday anyways ...
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The spec says:

" ... member classes of the suncertify.db package..."

. Just put inside the package and it's alright.

Good lucky and keep on touch to let us know the positive result.
 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I do not think that the use of javax.ejb.DuplicateKeyException - is good. I think that we should make a new Exception.

I did as follows:
SecurityException already exists (in java.lang). RecordNotFoundException and DuplicateKeyException I have extends from java.lang.IllegalArgumentException.

A javax.ejb.DuplicateKeyException designed specifically for the EJB.

Best Regards..
 
David Kachen
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess I was a little mistaken. I'm new at this forum, please forgive me if I'm wrong. In the first message I passed on the link and got to DuplicateKeyException javax.ejb.DuplicateKeyException. I thought that the developer decided not to create a DuplicateKeyException and instead use javax.ejb.DuplicateKeyException.
And as it turned out, the editor himself makes reference to the message.

Best Regards
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

David Kachen wrote:I did as follows:
SecurityException already exists (in java.lang).


Javadoc of the SecurityException says:

Thrown by the security manager to indicate a security violation.

So i think you should create your own SecurityException instead of reusing this one (because your code will throw the exception and not a security manager)

Kind regards,
Roel
 
David Kachen
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Roel, I think that you are right.
 
Who among you feels worthy enough to be my best friend? Test 1 is to read this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic