• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The EB must not attempt to define a class in a package

 
Kenny Lomax
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have seen this rule a few times and never understood it:

The Enterpirse Bean must not attempt to define a class in a package

What does this mean!? Clearly we can define classes in packages..
Thanks
Kenny
 
Ankit Doshi
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right, it is quite common to define the classes within package.

I have seen this rule a few times and never understood it:

The Enterpirse Bean must not attempt to define a class in a package


Where did you see this rule?
 
Frederic Esnault
Ranch Hand
Posts: 284
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is true! But it doesn't mean your bean cannot be part of the package ! (The HFE book tutorial bean is defined as part of the headfirst package.)

The restriction means that, at Runtime, a bean cannot use the ClassLoader methods (defineClass(), definePackage()) to create a class, because it would create a security hole. This is consistent with the restriction saying a bean cannot get/use/modify the ClassLoader.

Of course you can define your bean as being part of a package !
 
Kenny Lomax
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahhh.. now I see the light
Thanks
Kenny
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic