In turning this problem over in my mind, a few quick suggestions keep holding sway, then a raft of larger potential implications continue to haunt the problem.
On the suggestion side, of course, when a framework is doing something you don‘t want it to do, the simplest solution is to say it needs to be rearchitected to expose that particular part of its functioning to pluggable replacement. So somewhere in the JSF codebase, there is code that is responsible for marshaling/unmarshaling of data. Right now that follows a super simplistic approach: the EL expression is interpreted as bean.property, so User.name is the user bean having a property called name. At that point, the framework looks to gain access to name through a pair of set/get methods. (See prior post on why this is suboptimal.) The first, and simplest solution would be to make this a strategy pattern. Now, the problem would be of course that you would be making it so that the little language of the framework was subject to being rewritten, which means that the whole benefit of a standard faces possible dilution. I would propose that we should expose this piece, then do a swarm on how it should work, and ratify the result as the 2.0 strategy. For instance, what would be wrong with explicit support for static builders that followed the following guidelines?:
If this all sounds to wishy-washy, consider the fact that an EL-based process, by its nature, is going to require some functional form of an Interpreter. Interpreters that only cotton to one sort of expression often harm their own cause, as is the case here.
Other Haunting Issues
One of the other architectural features of JSF that has haunted it in its n years of existence is the fact that it is totally based on intercession at the component level, but on a per property basis. There is no ready means to effect page behavior (there is hardly a concept there at all), and likewise, there is no notion about the lifecycle of the beans that are part of the whole binding process. Now, clearly, this makes for a somewhat blind dynamic. Facelets is a good example of this: as superior as it is as a templating technology, as a component, it is out of gas very quickly because there is no sense of component state. Anyone who has written components in JSF knows that it isn‘t that the components don‘t have state, it‘s that they choose not to expose that state, but rather act as if it is always reflected in the bound bean. Consider also the fact that RIAs carry with them the concept of updating the current state of a set of components interactively. If you use RF, you know that you have to do that by going through the lifecycle each time, otherwise, you don‘t get updates out to the various interface elements. This causes pain when you have things like required, and validation in place because you might want to do an update of just part of the aggregated state. (This is where PAC starts to make a lot more sense: providing as it does for component state and intercomponent coordination to exist while editing.)
The other problem that JSF‘s choice of narrow intervention opens up is the fact that transformations of the entities being edited cannot be standardized in any way. For instance, we have done a wizard framework that is based on a single component that has many panels, and it can be run in 3 different modes: wizard, tabbed, and stacked. The advantage of this approach is I can walk you through the initial creation of an entity (e.g. a membership that includes a subscription), in wizard mode, then invoke the same component in tabbed mode when you want to edit it. Well, this recent exercise of doing a subscription made me realize a few things:
What form would this take? Well, there would have to be some simple means of knowing whether we were creating an entity or not, and frankly, the more sophisticated, builder-aware interpreter would only be needed for that mode. For edits, set/get would not only suffice, but would even communicate constraints that could help in defining the rights the ui had to transform the entity. This is a whole other area that bleeds into the process/tools layer, whereupon the components group (think PLE) would be able to prevent one of the typical JSF disasters: well-meaning juniors throwing all the doors open in the name of making a ui ‘easy to use.‘