Hi everyone,

I'd like to know what you guys think about this issue:
http://servlet.uwyn.com/issues/browse/RIFE-247

To summmarize, when you an element with the absolute ID:
Subsite1.Subsite2.Home

These new methods (without arguments):
getXhtmlTemplate()
getHtmlTemplate()
getXmlTemplate()
...

Would automatically detect the ID of the element that calls them, resulting in these calls in this case:
getXhtmlTemplate("Subsite1.Subsite2.Home")
getHtmlTemplate(Subsite1.Subsite2.Home)
getXmlTemplate(Subsite1.Subsite2.Home)
...

The implementation is very trivial for me:
public Template getXhtmlTemplate()
{
    return getXhtmlTemplate(getElementInfo().getId());
}

I can see the benefits, it allows someone that mirror the element IDs and template names in his application to have less duplication. This is similar to some of Rails' behavior I think.

The downside is that it makes the code more brittle. As soon as you change the ID of a subsite, add a new one above it or change the element ID, you'll get a bunch of errors about missing templates.

Do you think it's a good idea to add this feature to the public API?

Best regards,

Geert

--
Geert Bevin                       Uwyn bvba
"Use what you need"               Avenue de Scailmont 34
http://www.uwyn.com               7170 Manage, Belgium
gbevin[remove] at uwyn dot com    Tel +32 64 84 80 03

PGP Fingerprint : 4E21 6399 CD9E A384 6619  719A C8F4 D40D 309F D6A9
Public PGP key  : available at servers pgp.mit.edu, wwwkeys.pgp.net


_______________________________________________
Rife-users mailing list
[email protected]
http://www.uwyn.com/mailman/listinfo/rife-users

Reply via email to