I've not posted anything for quite awhile, so I thought I'd fire it back up with something that (I hope) sparks some discussion. This post got me to thinking about what a POJO is and what it isn't.
The term "POJO" means "plain-old Java object" and is commonly used as the antithesis of EJB. My own interpretation of the term (and I assume everyone else's) is that a POJO is any Java object not adhering to any spec beyond that of Java itself. The implication is that the only thing you need to use a POJO is a JVM and even then, no specific version of the JVM is required.
In contrast, EJBs require you to implement certain interfaces (javax.ejb.* interfaces), in turn implementing certain methods (ejbActivate(), ejbPassivate(), ejbLoad(), ejbStore(), etc). EJB classes are not POJO. Likewise, Struts Actions and ActionForms are also examples of non-POJOs.
This begs the question: At what point is a class no longer a POJO? I'd say that a class is no longer a POJO at the moment that it implements an interface to satisfy the requirements of a specific specification, product, or framework.
Supposing you agree with me up to this point (maybe you don't), then where does that put the talk about EJB 3.0 being made up of POJOs? Sure, this brave new EJB doesn't need to implement any interface to be an EJB. But (unless I'm mistaken), it does have to be annotated with certain JSR-175 metadata. Is an annotated class still a POJO?
Don't get me wrong. I'm quite excited about the direction that EJB 3.0 seems to be heading. It's certainly looking better than what we have today. But is it accurate to say that EJB 3.0 will be based on POJO when, in fact, you have to annotate your classes a certain way to make the spec happy?
Sure, this is mostly a matter of semantics. EJB 3.0 is more "plain" than EJB 2.1, but I don't think I'd call them POJO just yet. Maybe we come up with a new term. Perhaps AJO: Annotated Java Objects. I don't know...I'm just thinking out loud.
One thing I do know: I can get a lot of the same EJB power with honest-to-goodness POJOs by using Spring (and Hibernate). Rarely do my classes have to implement or extend a Spring-specifc or Hibernate-specific thing. Everything's much simpler that way. That's why I like Spring and Hibernate and why I was excited at the first news of EJB 3.0 being POJO-based. But now I'm less excited because it looks like EJB-specific interfaces have been replaced with EJB-specific metadata.
Okay, this is the point where you get to either tell me how brilliant I am for making this observation (thanks to Matt) or tell me what an idiot I am for bad-mouthing EJB 3.0 (in which case, you missed my point).