Jens Vagelpohl wrote:


On May 10, 2005, at 00:48, J Cameron Cooper wrote:

But please note, this is very hostile web design. I would suggest you re-think your need for such a "feature".


"Hostile" is an excellent word for that kind of behavior. It certainly breaks quite a few rules in the "user friendliness" book.

So what exactly is the goal for following such a user-defeating technique?

jens


If I might disagree, keeping a stable URL is not, by itself, "user-defeating". For example, user's do not like browser history clutter with subfolders and objects - all from the same application.

Also, we do not want a user to open browser history and click www.myApp.com/updateChartOfAccounts. Because that would be "out of context". Sure you can respond with an error message. But why should they see it in the first place?

With a stable URL they just click www.myApp.com and they get the main page - every time.

The question remains - is there an elegant solution to this.

I think there is. Maybe 3 years ago Jim Penny wrote a message (I wish I could find it now!) regarding a web technique which I believe he referred to as the "stateless machine".

I liked the idea and have used it ever since.

The idea is to use index_html as a request dispatcher. index_html simply responds to page requests and pulls in zpt macros, dtml and python code displaying to screen. An example:

index_html
request = context.REQUEST
if request[caller] == 'Budgeting':
 if request[action_type] == 'Process':
    context.SQL.updateBudget()
    context.ZPT.showUpdatePage(context,request)

and the caller looks like ...
Zpt module Budgeting
..
<form name="budgeting" action="index_html">
<input type="hidden" name="caller" value="Budgeting">
<input type="hidden" name="action_type" value="" > <---- see with javascript
<input type "button" name="process" value=" Process " onclick="Process()">


etc

I believe that this technique is not only useful in the "stable" URL way, but it is very useful for larger applications - index_html becomes the "engine" driving the whole application. This centralizes a big chunk of application logic in one place.

David






_______________________________________________
Zope maillist - Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to