Women in Technology

Hear us Roar

  Introducing JavaServer Faces
Subject:   Promotes an Old School Way of Thinking
Date:   2003-07-31 06:00:28
From:   sethladd1
Thanks for the great article. I enjoyed having JSF displayed for me.

This technology, and its baby brother Struts, seems to be solving the problem in the wrong way. JSF and Struts are both verb centric. That is, they promote actions being taken. These actions are the Resource themselves. The nouns in this world, the objects we want to act on, seem like second class citizens here.

In a RESTful web, the nouns of the system are the first class citizens. The verbs are just the HTTP methods (GET/POST/DELETE/PUT).

Struts, and from what I can tell from JSF, promote the opposite. The promote things like addUser.do. What Resource is this? How do a GET addUser.do?

I want to interact and identify the User I'm adding, not the method by which I'm adding the User. Identifying the User directly is much more useful in the long run.

Want to see the user?
GET /users/12345

Want to update the user?
POST /users/12345

Deleting is a bit harder, because web browsers don't support DELETE natively. ugh.

My point is, when building web apps, think about them as a hyperlinked collection of Resources and their Representations. There is a heavy emphasis on Nouns here. Don't think of building web apps as a set of callable methods. Early incarnations of SOAP tried to work like that, and it fails.

GUI/Event programming might work great in a local GUI app, but in a distributed information system such as the web, we need a different paradigm. This is where REST helps us.

Full Threads Oldest First

Showing messages 1 through 3 of 3.

  • simpler
    2003-11-04 08:31:45  anonymous2 [View]

    i guess REST (maybe together with XSLT) is much simpler then mixing simple HTML with JSF tags. Like JSP before these pages will be very difficult to build with different teams.

    IMO JSF seems way too complicated. maybe huge applications are complicated but the language used needs not.
  • Promotes an Old School Way of Thinking
    2003-08-21 09:46:48  anonymous2 [View]

    REST is like falling back to C programming. JSF is the OO way of web programming. If you prefer structured programming, it's ok. I'd rather have the benefits of OO (code reuse, mainly).

  • Promotes an Old School Way of Thinking
    2003-07-31 17:49:49  anonymous2 [View]

    Except not everyone one thinks REST is the best way to do things.

    Personally, I would prefer to use the browser to bootstrap a Java Webstart enabled full blown GUI App and forget about struts/jsf and all of it, but that day is far off.

    In the mean time, Struts and JSF, with their MVC underpinnings are still the best game in town.

    BTW, the last thing a web app is is a collection of hyperlinked resources. Maybe in 1993 it was but many web apps today are more sofisticated applications that actually DO things for the user. JSF provides a view and Struts a particular framework that includes a view.

    BTW, I do things like getUserList.do, updateUser .do and getUser.do in a web app, more than just GET,POST, PUT and DELETE.

    And since Struts is one of the most commonly used Web application frameworks, I appear not to be the onely person who thinks so.