some notes

Notes on web app modularity

I'm trying to distill the next generation web application platform that I want to be able to roll out soon, based on everything learned from Berylium, Gibson, and the ECC Community Portal.

This is totally interface independent, it's all back-end stuff. And pretty raw at that, but it'll give me a road map.



QuickSite

How To Build A Web App From Parts

Or, Thinking Around the CMS Box

Request (QuickRequest (see test))

request object is all about breaking down the request and serving back some output. think of it as the webserver's input/output loop
describing the type of connection, the requested object, via which scriptname, using what language and in what format. request is in charge of determining what the client desires to do with what object and using what values. generating and gathering information about the response.

request knows:
object name
template format
meaningful get and cookie vars for use with the request
language to use
protocol to use
processor method
template method
identity of the requestor
access level of the requestor
current time

request does:
timers
logging
redirect
confirmation
transmission of appropriate content-type and length headers
cache reading
session logging

Authentication/Authorization (QuickThentication (see test))

auth object is all about who can do what where, and with which objects

auth knows:
user identity
group identity
object selection policy
object manipulation policy

auth does:
login, logout, chpass
session handling
authentication
realm::role determination -- fine-grained access to individual properties at the processor / template level
access-level determination -- coarse-grained object acess at the request level, with the object parent as realm: none=>0, read=>1, write=>2, publish=>3, admin=>4
policy creation

Collection (QuickMySQL)

db gives us a custom interface to the database (or any other collection, really), which can save an awful lot of time while coding.

db knows:
very little

db does:
select - returns an array of raw record arrays ( array[counter][field]=value )
selectOne - returns an object
selectMany - returns an array of objects
action - returns true/false
buildSelect - builds a properly formatted and escaped select query from arguments, using current object selection policy
buildInsert - builds a properly formatted and escaped select query from arguments, using current object manipulation policy
buildUpdate - builds a properly formatted and escaped select query from arguments, using current object manipulation policy

Object (ContentObject)

object is the star of the show, this is who the request is going to work through. but here's the twist -- everything that can be saved in a collection is an object. so even if an object isn't _the_ object it may still be _an_ object. perhaps a distinction to be made: content object.

object knows:
everything there is to know about itself
its props (icons, attachments)
the format of its content payload (which may be binary)
its place among other objects -- x,y,z where x is path, y is siblings, and z is layer (and other coordinates as necessary)

object does:
saving and loading itself from storage
cascading updates to children for inherited properties
preparing itself for use (deserializing properties, expanding paths and URLs, loading props)
orientation with other objects
all kinds of stuff depending on context

Parent

an object's parent is the one whose name would serve as the directory name for the object, if this were a filesystem. so the parent of /foo/bar/quux is /foo/bar.
parents behave like any other content object
parents may be thought of as containers

Siblings

an object's siblings are all the other objects that share this object's parent.
each sibling behaves like any other content object
siblings may be thought of as peers

Children

an object's children are all the objects that have this object as a parent.
each child behaves like any other content object
children may be thought of as contents

Props

an object's props are child objects which serve a special purpose, like icons or attached files
each prop behaves like any other content object
props may be thought of as possessions or extensions; pasted onto, not contained within; external, not internal.
the distinction between children and props is completely context dependent -- the difference is that props are always loaded when an object is loaded

Processor (QuickMethod)

a processor carries out the requested method on the requested object
the most specific processor found is loaded, based on object name, datatype
should processors have access to the global scope?

processor knows:
its name
its container
its specificity to object type ( if any )
its specificity to protocol (if any)

processor does:
object handling
selection of children and siblings as necessary
template setup and variable assignment
template rendering
cache writing
post value handling and validation

Template (QuickTemplate)

a template displays information in a coherent fashion

template knows:
its name
its container
its specificity to object type ( if any )
its specificity to protocol (if any)
its language
form variables
variables within its scope

template does:
rendering, including appropriate headers and footers
form widget rendering
message communication

Cache (QuickCache)

the cache provides access to data served by a particular request.
the cache itself may be the filesystem, a database, or an SFTP mirror (or any storage medium, really)
different caches have different storage tolerances -- some might not want to objects with an access level greater than 0.
the cache system must be able to encode and determine the following:
creation time
protocol
object name
language
format
request method
access level
significant cgi vars (width, height, pagination info)


a cache may be non-transient, meaning that previous versions of cache entries may be retained for archival or auditing purposes. in this case, the cache system should also encode the following:
modification time
creator identity
version

cache does:
creation of new cache entries on request
expiration of object's cache entries, either globally or based on some criteria; applies recursively to children's cache entries
expiration of parents' entries (non-recursive)
expiration of siblings' entries (non-recursive)
checking for cache entry existence
fetching of cache entry metadata
fetching of cache entry

By Chris Snyder on November 19, 2003 at 8:59am

jump to top