O'Reilly logo

Component Development for the Java™ Platform by Stuart Dabbs Halloway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

7.6. Code Generation in EJB

The most interesting use of code generation in the J2EE environment is Enterprise JavaBeans. Despite the similar names, EJBs are completely unrelated to JavaBeans.[6] An EJB represents data and logic that executes in a server environment. There are two primary kinds of EJBs. Session beans represent short-lived conversational state between a client and server, and entity beans represent long-lived data, often in a back end database.

[6] There are only so many coffee metaphors, so the coolest ones have to be reused.

For our purpose here, the interesting thing about EJBs is that they leverage generated code to add semantics beyond the semantics specifically encoded in Java classes. Most importantly, EJBs can acquire transactional ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required