• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Enterprise bean environment mechanism

 
Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question asked by simulator:

Q:The Enterprise bean environment mechanism tries to achieve which of the following objectives?

a It allows to users of an Enterprise bean to customize its business logic without modifying the source code.

b It allows an enterprise bean to modify its environment properties without knowing about them at the development time.

c It allows an enterprise bean to customize its container in a standard way.

d It allows an enterprise bean to locate external information without prior knowledge of how the information is named and organized in the target operational environment.

My answer: D and C

I was pretty convinced C was not right, but the others seemed more wrong
Now, the correct answers are D and A

The reason why A is correct (copy from spec):

The Application Assembler and Deployer should be able to customize an enterprise bean's business logic without accessing the enterprise bean's source code. In addition, ISVs typically develop enterprise beans that are, to a large degree, independent from the operational environment in which the application will be deployed. Most enterprise beans must access resource managers and external information. The key issue is how enterprise beans can locate external information without prior knowledge of how the external information is named and organized in the tar-get operational environment. The enterprise bean environment mechanism attempts to address both of the above issues.


What is this ? How on earth can you change the business logic of a bean without changing its code ? Unless you externalize business code, this is imposible. And to my knowledge the business logic is in the bean class, not externalized.

Probably they are refering to properties which can be externally customized. Such as security, resources etc. But this is not 'business logic'....

Any one a good explanation for this ?

EDIT:

Hmm, maybe it has something to do with the 'customize' word ? Its probably not the same as 'change' (I hate it when they do this, its hard to find such differences if English is not your primary language)
[ July 20, 2005: Message edited by: Koen Serneels ]
 
Adrian Pang
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about something like this in your bean:

...
if (env entry is true) {
callMethodA();
} else {
callMethodB();
}
...

then, the value of the env entry customizes the behaviour of the bean...
 
Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, thats indeed a pretty clear example. Thanks.
 
Chetan Sahasrabudhe
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess same example is applicable in any normal java program. That example is simple property driven case statement.

I would still like to know whatz so special in EJB
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic