Johnny's Software Saloon

Weblog where I discuss things that really interest me. Things like Java software development, Ruby, Ruby on Rails, Macintosh software, Cocoa, Eclipse IDE, OOP, content management, XML technologies, CSS and XSLT document styling, artificial intelligence, standard document formats, and cool non-computing technologies.

My Photo
Name:
Location: Germantown, Maryland, United States

I like writing software, listening to music (mostly country and rock but a little of everything), walking around outside, reading (when I have the time), relaxing in front of my TV watching my TiVo, playing with my cat, and riding around in my hybrid gas/electric car.

Saturday, August 07, 2004

Simplifying web form programming with more savvy URI forms

Before I went to bed last night, I brainstormed for a while and came up with a nice little standard form for web application URIs - for refering to forms, actions, and for static files - that I think will make creating sites easier.

URI format that simplifies creation of interactive web pages


Standard (STD) URI forms:


STD "object/action" URI
/ [webapp-context-name] / [object-type] / [object-id] / [object-action]
Examples of object-action: view [default], edit, delete
Note: destructive actions like delete should be performed via POST - not GET, so that they cannot be bookmarked.

STD "object/resource" URI
/ [webapp-context-name] / [object-type] / [object-id] / [object-type] / [object-resource-id]
Examples of object-resource-id: icon.jpg, portrait.png, thumbnail.gif, controlPanelApplet.jar, statusBarApplet.jar

STD "system/action" URI
/ [webapp-context-name] / [system-action]
Examples: login; where [system-action] = "login" OR logout; where [system-action] = "logout"

STD "system/resource" URI
/ [webapp-context-name] / [object-type] / [system-resource-id]
Examples: Logo for system; where [object-type] = "image", [system-resource-id] = "logo.gif"
OR Favicon for web site where [object-type] = "image", [system-resource-id] = "favicon.ico"

Rationales:

1. This lets web pages, which tend to be focussed on a subject after all, use relative URIs for things that are part of that subject, and absolute URIs for things that should be part of the system as a whole. A concrete example of this would be images, but it could be background music wave or MIDI files, downloadable content, etc.

2. It also makes it easier to navigate from one page to another within the context of the same subject. So, getting from a view page to an edit page would be quite simple. You would just specify edit in the action attribute for the form.

0 Comments:

Post a Comment

<< Home

Related pages & news