W3C home > Mailing lists > Public > www-forms@w3.org > July 2006

Re: Need for a 'global instance' function [was Re: i18n, componentized forms and multiple models]

From: Mark Birbeck <mark.birbeck@x-port.net>
Date: Mon, 24 Jul 2006 23:43:08 +0100
Message-ID: <640dd5060607241543v61355700j6b6110b00d29a706@mail.gmail.com>
To: www-forms@w3.org

Hi Erik,

> But wouldn't allowing this function to be called from a model encourage
> breaking encapsulation? Wouldn't events be enough as a mechanism to
> communicate between models?
>
> For use within controls I don't disagree though. Maybe the instance()
> function could simply take an optional second parameter, that would
> indicate if the search for instances should be global:
>
> [...]

We felt that having a different function made it clearer that we were
really doing a lookup, rather than establishing a connection between
the models. The point here is that we actually *don't* want a
'connection' between the models, since this 'leak' would then require
longer rebuilds. But we *do* want to be able to reference data in
other models, such as when using an instance as a source of templates
for xf:insert.

There are actually many situations in XForms where you use a value in
a calculation on a 'per-use' basis, such as in xf:setvalue or
xf:insert, and since this creates no dependency, it's not going to
hurt to be able to get data from other models for these actions.

As it happens, in most of our stuff we don't have expressions that mix
models within one XPath statement; what we try to do is use our
encapsulation techniques, and just copy out the data we need with
setvalue or insert. So far we've kept our use of globalInstance() to
that, and it has worked pretty well.

Regards,

Mark

-- 
Mark Birbeck
CEO
x-port.net Ltd.

e: Mark.Birbeck@x-port.net
t: +44 (0) 20 7689 9232
w: http://www.formsPlayer.com/
b: http://internet-apps.blogspot.com/

Download our XForms processor from
http://www.formsPlayer.com/
Received on Monday, 24 July 2006 22:43:18 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:05 GMT