# Getting Started

This chapter is more of super quick reference for those who are busy Googling for answers like,

* "when was this annotation introduced ?"
* "can I use this annotation with this EJB type ?"
* "what's up with the latest version of EJB 3.x ..?"
*   "which annotation(s) is/are useful for a specific feature I am

    interested in ?"

.....etc.

You can easily find answers to these common questions since this information has been conveniently sub-divided into logical categories.

* As per Java EE **version** - Java EE 5/6/7
*   As per EJB type - Stateless, Stateful, Message

    Driven, Singleton, common to all
* As per EJB **feature** - the central theme of this book

## Categorization as per Java EE version

This section presents _all_ the EJB annotations as per their respective release version.

> Only EJB 3.x releases (Java EE 5 and later) have been covered

### EJB 3.0

Java EE 5 was where it all began - ease of use was driven by POJO based declarative programming model and the annotations were largely responsible for this recarnation. Here is a snapshot

![](https://484634056-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3y20sbOi0gXZ39PrWP%2F-M3y21GTEI5f3h3u-Uah%2F-M3y23fymAU1GJMQ7exa%2Fejb-3-0.jpg?generation=1585883943973399\&alt=media)

### EJB 3.1

Building further on the simplified model put forth in EJB 3.0, the 3.1 version introduced richer features and made things even easier

![](https://484634056-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3y20sbOi0gXZ39PrWP%2F-M3y21GTEI5f3h3u-Uah%2F-M3y23g-wgsvLYHs7Ki0%2Fejb-3-1.jpg?generation=1585883942106751\&alt=media)

### EJB 3.2 (Java EE 7)

Although there were some improvements to the EJB specification as part of the 3.2 (Java EE 7) release, new annotations were not added.

#### New in EJB 3.2

*   Sensible defaults for local interfaces: From version 3.2 onwards,

    EJBs implementing other (java) interfaces are assumed (by default)

    to be exposing a local view (`@javax.ejb.Local`) as opposed to

    forcing the implementation class (EJB) to specify the exact view

    type (`@Local` or `@Remote`)
* `EJBContainer` API now supports _try-with-resources_ (JDK 7) feature
* `Stateful` beans passivation has been made optional
* `TimerService` API has been enhanced to add a `getAllTimers` method which returns all the timers configured within that EJB module
* Improvement to Message Driven Beans
*   The following parts of the EJB specification have now been made

    optional - entity beans, EJB QL and JAX-RPC

## Categorization as per EJB types

EJBs can be divided into four major types - Stateless, Stateful, Message Driven and Singleton. This section categorizes annotations as per their applicability to specific type of EJBs and also highlights the ones which are commonly used across all EJBs in general.

![](https://484634056-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3y20sbOi0gXZ39PrWP%2F-M3y21GTEI5f3h3u-Uah%2F-M3y23g3N8n5L8HIIwlm%2Fejb-by-type1.jpg?generation=1585883943055689\&alt=media)

![](https://484634056-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3y20sbOi0gXZ39PrWP%2F-M3y21GTEI5f3h3u-Uah%2F-M3y23g5bYLa57zygPhk%2Fejb-by-type2.jpg?generation=1585883941006785\&alt=media)

## Categorization as per EJB features

The below diagram should give you a quick yet clear overview of EJB features. This along with the rest of the information in this chapter should hopefully set you up for the upcoming content

![](https://484634056-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3y20sbOi0gXZ39PrWP%2F-M3y21GTEI5f3h3u-Uah%2F-M3y23g7IMqB-zU99zeV%2Fejbfeature-set.jpg?generation=1585883939948839\&alt=media)

## Up next ...

Time to dive in ....!
