• Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB - Component Model???

 
ravinderSingh singh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recently heard some describe EJBs as a component model. When I looked up the term component model I couldn't seem to find a definition.

Could anyone please explain to me what a component model is?

Thank you!!
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Head First EJB book gives a good explanation, but if you don't have access to that book just think of code you can use and adapt at deploy time, i.e. without source code changes.

The adaptation could be through a deployment descriptor (the EJB approach), JavaBean properties (the AWT/Swing approach), injection (the Swing approach), or aspects (the AspectJ approach), maybe others that I'm missing... but the idea is that it is a hunk of compiled code with a well-defined set of services that you can use without the source but still adapt effectively to your needs.

EJB adds a bunch of other meat to the concept to support distributed components that make extensive use of container-managed services.
 
ravinderSingh singh
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. I've searched the web and it's difficult to find a standard definition.

Just to clarify, any ejb I develop is a component since aspects of its behaviour can be configured at run-time using xml attributes?
 
Reid M. Pinchback
Ranch Hand
Posts: 775
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, specifically a distributed component. How good a component depends upon you, obviously. If you could imagine deploying the component twice with different bits of configuration and have two useful things for your app, you know you are heading in the right direction.

Doesn't mean that you always need to deploy EJBs multiple times, but if you find you *never* do multiple deployments of any EJB, it suggests you might not be getting all of the EJB benefit that you could - either meaning more learning is needed, or maybe you weren't dealing with a very EJB-ish problem in the first place.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!