Wednesday 30 March 2011

CDI Specializes

Introduction

CDI is what I call a modern specification / framework. The emphasis
is placed on a few concepts and their usage and not on a limited list of
functionalities that should be implemented and covered. And it is easy to
extend it or change a few internal implementations. In the specification,
there is explicitly noted that portable extensions should be possible. The
most known extensions at this moment are CODI, maintained by the MyFaces
project, and Seam 3, the JBoss lead project.

And the specializes in the title could refer to this; a blog entry
about the additional functionalities that can be found in CODI and Seam 3
on top of the standard. Because, once you are familiar with the concepts,
you have a complete new set of tools at hand to handle dependencies and
managed beans in a type safe way. And those two projects have defined for
you some very common additions that you will use very often.

But the goal of this text is different. I'll try to explain you one
of the concepts in CDI offered by the annotation
javax.enterprise.inject.Specializes. The goodies of those CDI extensions
might be a subject of another entry. In the mean time, you can read their
documentation on how to use the provided functionality.

Thursday 10 March 2011

JSF Security

Introduction

Securing parts of the view of a JSF application is mostly done by
calling some backing bean methods in the rendered attribute of the
components. And although it works, it isn't optimal. Security is one of
those cross-cutting concerns of applications, like logging, and one should
try to give it his own seperate place in the application. It is obvious
linked to the rest of the application but it shouldn't be mixed with the
other code like business rules.