Implied values

The development process has been simplified by the use of implied values in the EJB 3.1 specifications. Previously, you had to specify the behavior of your EJB by using extra code or metadata in your deployment descriptor. This is no longer the case.

To reduce the amount of clutter produced from coding values and behavior, EJB 3.1 automatically assigns values based on what is likely to be correct. The implied values tend to match the most common usage. If you add an @Stateless annotation tag into a POJO without providing a value for the name parameter, its assigned or implied value is derived from the name of the class:

assigned value

Overridden values

One of the features of EJB 3.1 is that you can still use the deployment descriptor to override the values set out in your entities. For implied values, you can code the XML to override field values so that they do not take on default or implied values. The Annotations view indicates when a value is overridden in the deployment descriptor file:

Override attribute
By hovering over the Override icon, you can see the override value for the attribute. Similarly, within the Session bean Java™ class, the Override icon appears in the margin beside the attribute and its value:
Override icon in Java class
By hovering over the Override icon, you can see the override value for the attribute:

You must understand what the default values and default behaviors are for your EJB files because of the automatic setting of default values. Since you no longer need to have the deployment descriptor describe all this, you must understand how your bean is going to behave from the code itself. The new Annotations view shows you these values explicitly when you hold your mouse over the bottom left corner of the field you are looking at. If there is an implied value, it is marked by an "I". The following figure illustrates the hover help in action:

Figure 1. Using hover help to identify implied values
Implied value

Feedback