What makes EJB components special is the declarative programming model through which we can specify the services such as security, persistence, transaction etc., that the container should provide. An EJB only implements the business logic; the services are associated through a deployment descriptor, which essentially acts as metadata for the EJB. At runtime, the container uses the metadata specified in the deployment descriptor to provide the services. The deployment descriptor is an XML file, not part of the Java classes that make up the EJBs. Is there a standard way to annotate the Java classes that make up the EJBs so that a developer can look at the class definition, together with annotations, and know everything about that class? It would be even better if the remote, home interfaces and the deployment descriptor could be automatically generated by a tool using the annotations. Better yet, can we provide the same kind of declarative services for a simple Java object? If so, how? This article examines how JSR-175: A Metadata Facility for the Java Programming Language will help us in finding answers to these questions and more.
I haven't actually read the article, but... This is a really bizarre use of the term declarative programming, which normally means something utterly different: it normally refers to a programming system in which you describe the problem, and the system finds the solution -- as in rule-based programming. Configuring an EJB app is is what most people would think of as "configuration," not "declarative programming."
This is a really bizarre use of the term declarative programming
May not be as bizarre as you think. I haven't read the article either, but the books I've read so far on servlets and EJB all refer to the "configuration" (or at least certain aspects of it) as declarative programming. Declarative programming sounds so much fancier than configuration.
Blake Minghelli<br />SCWCD<br /> <br />"I'd put a quote here but I'm a non-conformist"