Articles on the Spring Framework, Java EE, Hibernate
Search, RichFaces, Groovy, and Scala
Technologies covered include the Spring Framework, EJB
(Enterprise Java Beans), JPA (Java Persistence API), Hibernate,
Hibernate Search, and different flavors of JavaServer Faces
(JSF 1.2, 2.0, RichFaces).
Related technologies, such as Spring AOP (Aspect-Orientated
Programming), various types of Remoting Services, Facelets, and
Design Patterns, are discussed as well.
Reaching beyond Java as a language, we're also providing an
article on the Groovy programming language and SDK.
Our newest article deals with fundamental topics in the context
of the Scala programming language.
These are solutions for the exercises in Martin Odersky's
Scala By Example manual.
To my knowledge, official, or commonly approved, solutions do
not exist. Moreover, only sporadically have single, or few,
solutions been published by third-party authors. The only
(well, half-way) comprehensive collection I'm aware of is the
one provided by whiter4bbit. – In contrast, this article
covers any and every exercise.
Exercise 16.0.1, which is exceptionally hard, has been worked
on by Nada Amin.
Most code samples in the article at hand are shortened for
clarity. You can download the entire source code, where every
solution has a startable main method and is
usually accompanied by corresponding unit tests.
Primarily, this article has been written in order to qualify
for the SpringSource Certified Spring Professional exam. It
might cover a decent number of themes being on the curriculum,
however, certainly not all.
This article comes with a sample application that should be
easy to set up for other developers. This application is not
meant to illustrate any aspects introduced in the article, but
covers what the author thought to be common use cases in a -
not so - real-world application.
Reading the article and studying the sample application is
recommend for software developers that don't want to read the -
even more comprehensive - Spring Reference (although the latter
certainly provides much more accuracy), want to refresh their
knowledge on Spring, look at it from an additional perspective,
or have working working samples that partially extend what's
covered by Spring's own sample applications.
Readers are supposed to have a basic knowledge of the Java
language, Database access, and Servlet / JSP technologies.
This article deals with version 2.5 of the Spring framework.
The upcoming 3.0 version will add new features, but, basically,
not revoke existing ones. Thus, the article will remain valid
to a large degree.
Primarily, this article and sample application have been
written to study the feasibility of using the Lucene full-text
search engine - or some framework on top of it - in a Spring,
and Hibernate, application.
In contrast to my other recently written articles, this one has
been dealt with in an ad-hoc way. That is, I have had
not read the complete documentation before starting to
code. Likewise, the article is intentionally kept brief.
As for Lucene integration with Hibernate and Spring, there are
a number of frameworks around (see chapter
Related Resources). While the Compass framework might be
worth more than a second look, Hibernate Search has been chosen
for the simple reason of JBoss being an industry leader with
Hibernate itself.
Interested readers are supposed to already have a basic
knowledge of the Spring framework, Hibernate, and (for that
matter) JavaServer Faces (JSF).
If there is one conservative language in the modern programming
world, then it's probably Java. Just take closures as an
example, which most other languages already support for years.
(Closures, finally, are to be integrated into Java 8, which is
expected to be released in 2012; however, their functional
range to date will be limited.)
When it comes to a programming language's "expressiveness", I,
personally, have been always in doubt about that: Programming
languages need to be readable, and thus, maintainable, at first
place (fortunately, Groovy is, to a large degree). Moreover,
when working in teams, rather "exotic" programming languages
don't make much sense - the ideal expressiveness of a language
ought to be near the common denominator within the team.
Thus, I well decided to work into common Java frameworks over
learning languages like Groovy or Scala.
Nonetheless, at some point, I did make myself familiar with
Groovy - and the reason was ... the Grails framework,
which I consider one
of "the" most advanced, at the same time convenient, and yet
modularly extensible, web frameworks, at all.
After having read one or two books on Grails, I'd been tempted
to do my first Grails project right away. That might have
worked, easily, but then again, I'd been so excited about
Grails that I wanted to "do it right" just from the beginning.
And so it came that I did my homework on Groovy, learning
syntax constructs and functional capabilities, but also
estimating Groovy's environmental impact, as well as its "good,
bad, and ugly" paradigms. - These are documented in the article
at hand.
As Groovy leverages the Java language and its class libraries,
readers of this article are supposed to be already proficient
in Java. Discussing aspects of the Java language is out of this
article's scope.
While in the past Java Enterprise Edition had a reputation of
being overly complex (while being rock-stable), developers'
productivity has greatly improved with Java EE 6 (and EE 5,
before). Even Rod Johnson, founder of the - much more agile -
Spring Framework, came out in support of Java EE 6, remarking
that "Java EE 6 gets it right".
This article introduces into Java EE 6, discussing basic and
new (and really cool) features of EJB (Enterprise Java Beans)
3.1, JPA (Java Persistence API) 2.0, and JSF (JavaServer Faces)
2.0 from a mostly practical and only partially didactical
("things to remember") perspective.
The associated sample application should - hopefully - work
out-of-the-box for anyone importing it.
Studying the article and application is recommended for
developers with basic or intermediate skills in the
technologies covered.
JBoss RichFaces is a feature-rich, AJAX-enabled, framework,
based on JavaServer Faces (JSF).
This article describes the most important RichFaces components,
illustrates them visually with screenshots and practically with
simple code samples.
The article is aimed at developers that already have a basic
knowledge of JavaServer Faces.