Re: Hairy generics question
Arved Sandstrom wrote:
If you choose to think of JSF as MVC - let's say because you aren't
interested in breaking out MVP as a derivative of MVC - then that's fine
too. I have no problem with that, it's what I actually do myself,
because most folks haven't heard of MVP anyway so why confuse them? I
would like it though if people who "knowledgeably" classify JSF as being
MVC could identify what the Controller is in JSF: I've run across more
people than not who either think it's the FacesServlet or just don't know.
JSF is MVC if you think of a backing bean as a (generally) per-screen
controller. It coordinates the purely view-oriented actions of the XHTML (JSP
being out of fashion now) with the POJO logic types that implement the model.
But a JSF application does not have a simple, single-controller MVC structure,
as people usually think of the architecture. It is similar to Swing, as
(in a section lacking citations):
"An MVC application may be a collection of model/view/controller triads, each
responsible for a different UI element."
Your distinctions between MVP and MVC are useful, as is your reticence to
enforce the distinction.
The difficulty isn't that things are or aren't different, it's that the term
"MVC" is rather broad. It applies to just about any architecture that
comprises triads of view, model and some coordinating third element. (What the
hell is the difference between a "controller" and a "presenter", really? I've
always called it a "dispatcher".) We need a common terminology to distinguish
the various flavors.
As for people thinking the FacesServlet is the controller, they can be excused
if they believe the pundits. There are articles about JSF out there that say so.
So even where the terminology is consistent, the taxonomy is in dispute.
I suppose that at that height, the FacesServlet is the dispatcher and backing
beans the model, but they're the interaction model, not the business model.
As a programmer I don't face the FacesServlet. (You see what I did there?)
It's black box and so I dismiss it. The part I design, the part that I model,
is the application-level MVC pattern. That's why I think of each
POJO-screen-bean triad as an MVC unit. (MSD in my universe -
dispatcher-screen-model.) (I did that on purpose. Which leg of the tripod is
the most important, after all?)
I think we're too late to peg MVC to any one flavor, but it makes sense to
reserve MVP for the specific variant that it describes. I would go along with
Honi soit qui mal y pense.