Thursday, December 20, 2007

Semi MVC templating

In the templating-demo, I (believe) I've used the MVC pattern for templating/transforming lookups. If anyone knowledgeable about patterns reads this, please let me know if I'm way off on this.

I'm not sure if this is similar to the technique Chris mentioned in a somewhat cryptic comment on another templating blogpost.

I use a naming convention for three kinds of fields. To do the actual transformation, I use a WebQueryOpen-agent.

Naming convention/description

Computed for display, allow multiple values. These fields fetches the data (using dblookup/-column). One field can be used by multiple templates.

Computed for display. These fields contain the description of how the data should be transformed. The label should correspond with the label of a lookup-field. Example of template.

Computed for display. These fields will be filled by the result of the transformation. The label/description should correspond the label/description of a template-field.

WebQueryOpen agent
This agent contains the transformation logic/fills the transformed-fields.


Dmytro said...

very impressive. Thank you for demo. I'll play with it

Tommy Valand said...

No problem.

If there is something confusing/wrong in the demo, leave a comment, and I'll look into it.

My goal with this is to have a readable/easy to maintain way of presenting data from lookups in webpages. So far, this is the best solution I've found.

I haven't tried it, but with a small rewrite of the agent doing the transformation, you could also use this technique for simple PassThruHTML-reports in the Notes-client.

The Grouse said...


I did a full article on using the MVC design pattern with Domino apps for The View back in 2004. YOu can see it at

Might require a View subscription to read the article, however.

Tommy Valand said...

I'll take a look at it, thanks!