On 9/21/05, Ted Husted <[EMAIL PROTECTED]> wrote:
> On 9/21/05, Siva Jagadeesan <[EMAIL PROTECTED]> wrote:
> > > 1. is it difficult to switch from Struts to JSF for Struts-enabled ;-)
> > > developer. How steep is the learning curve?
> >
> > There is going to be initial learning curve for sure. BUT IT IS WORTH it.
> > Struts and JSF are totally in different paradiam. Struts is Action oriented
> > and JSF is component oriented. When I moved from struts to Tapestry ( which
> > is also Component based) it was kind of tough. But after I understood
> > Tapestry it was relatively easy for me to move to JSF.
> > Very unlogical comparison for struts and jsf is procedural and object
> > oriented programming. Moving to OOP has some initial learning curve, but no
> > one can deny it is worth it.
>
> This is a good comparison. After over a year of working in ASP.NET,
> which is also component-orientated, I'm just finally "getting it". One
> thing that slowed me down is that a lot of newbie ASPX material is
> focussed on pouring a "Classic" architecture into a component
> environment. Old-wine-in-new-bottles doesn't work any better and can
> even work worse. Once you get past action-orientation and start
> thinking in components, everything comes together. But, hey, it took
> me over year to migrate from procedural programming to OOP back in
> 19{cough}. :)

I would like to hear what a component is. Definitions can differ. JSF
hides the strict definition of component quite well, here is one, done
indirectly (JSF 1.1 spec, chapter 1.2.2):

=== cut here ===
Component writers are responsible for creating libraries of reusable
user interface objects. Such components support the following
functionality:
* Convert the internal representation of the component's properties
and attributes into the appropriate markup language for pages being
rendered (encoding).
* Convert the properties of an incoming request—parameters, headers,
and cookies—into the corresponding properties and attributes of the
component (decoding)
* Utilize request-time events to initiate visual changes in one or
more components, followed by redisplay of the current page.
* Support validation checks on the syntax and semantics of the
representation of this component on an incoming request, as well as
conversion into the internal form that is appropriate for this
component.
* Saving and restoring component state across requests
=== cut here ===

This spec talks about "redisplaying of the current page", not even
about re-rendering of a changed/affected component. Components in JSF,
Tapestry or ASP.NET are implemented differently.  Should we use the
least common denominator of all different frameworks to define what a
component is? Should people stop bashing Struts Classic on a wrong
premise that it cannot do components?

<relevant plug>
  It is possible to create Struts/JSP components which can do
  everything from the bulleted list above, maybe not nicely
  packaged, but they can be called components nonetheless:
  http://today.java.net/pub/a/today/2005/08/04/jspcomponents.html
  By the way, many books on JSP, especially older ones,
  define JSP as a "component technology". Funny.
</relevant plug>

ASP.NET components are nothing more than custom tags, heavily
supported by IDE and application server. Surely, IDE that allows
simply to drop a component on a page, is a big aid for .NET
developers. JSF wants to be for Java what ASP.NET is for Windows.

But if you imagine for a second that you are creating ASP.NET page
manually, the differences are not that huge.

<another relevant plug>
  This blog entry of mine seems related to the topic:
  http://www.jroller.com/page/javadujour?entry=code_behind_for_struts
  Anyway, it is a good intro to Struts Dialogs ;-)

  One may argue that Struts Dialogs is not Struts Classic anymore,
  but actually it still is: it relies on only one new action class.
</another relevant plug>

I hope that this email will not be taken as a personal insult :-) I
just wanted to clear some things up and to provide relevant links. By
the way, if a steam engine could be stuffed under the hood of an
average car, it would be a great alternative to gasoline engine, and
environment-friendly too ;-))

Michael.

Reply via email to