Enterprise JavaBeans 3.1

  Application development can be a deceivingly complex undertaking. Not only must our programs do their jobs, they must do them well. There’s a laundry list of characteristics that Good Software implies: • Secure • Sound/maintains integrity • Scalable • Interoperable • Robust/resilient • Correct/functions as specified And while these are all prerequisites to a […]

Component Types (Enterprise JavaBeans 3.1)

  Modeling real-life objects and concepts is one of the first skills a programmer must develop. As such, we’ve become fairly adept at implementing object-oriented axioms such as reusability and extensibility on a daily basis. When we focus these principles on business logic, we end up with a set of business objects that encapsulate the […]

Container Services (Enterprise JavaBeans 3.1)

  While server-side component types handle business logic and entities address state, the EJB Container can continue to make our jobs easier by providing a wide range of generic and configurable services. Enterprise applications generally handle a large number of concurrent users, and each request might need to be handled carefully so it does not […]

Developing Your First EJBs

  Now that we’ve covered the concepts behind the various component models and container services provided by the specification, it’s time to start putting these lessons into practice. In this topic we’ll introduce the terminology and syntax necessary to code, package, deploy, and test some functional EJBs. Step 1: Preparation Let’s briefly lay out some […]

The Stateless Session Bean (Enterprise JavaBeans 3.1)

  The stateless session bean is designed for efficiency and simplicity. Central to its design is the absence of conversational state, which is a topic worth exploring a bit further before delving into SLSB mechanics. When we say conversational state, we refer to information exchanged and remembered within the context of a series of requests […]

The Stateful Session Bean (Enterprise JavaBeans 3.1)

  While the strengths of the stateless session bean lie in its speed and efficiency, stateful session beans are built as a server-side extension of the client. Each SFSB is dedicated to one client for the life of the bean instance; it acts on behalf of that client as its agent (see Figure 6-1). Stateful […]

The Singleton Session Bean (Enterprise JavaBeans 3.1)

  So far, we’ve enjoyed the isolated invocation context provided by stateless and stateful session beans. These bean types service requests independently of one another in separate bean instances, relieving the EJB developer of the burden introduced by explicit concurrent programming. Sometimes, however, it’s useful to employ a scheme in which a single shared instance […]

Message-Driven Beans (Enterprise JavaBeans 3.1)

  The message-driven bean (MDB) is an asynchronous listener. Its callers are systems that say, “Check out this message; do whatever you want with it” and don’t have the decency to wait around for a response. In fact, clients of an MDB have no idea that the messages they send may be processed by an […]

Persistence: EntityManager (Enterprise JavaBeans 3.1)

  Persistence is a key piece of the Java EE platform. In older versions of J2EE, the EJB 2.x specification was responsible for defining this layer. In Java EE 5, persistence was spun off into its own specification. Now, in EE6, we have a new revision called the Java Persistence API, Version 2.0, or more […]

Mapping Persistent Objects (Enterprise JavaBeans 3.1)

  In this topic, we take a thorough look at the process of developing entity beans— specifically, mapping them to a relational database. A good rule of thumb is that entity beans model business concepts that can be expressed as nouns. Although this is a guideline rather than a requirement, it helps determine when a […]