On 09/28/2012 05:37 AM, Thomas Mortagne wrote:
Hi devs,
I find myself starting to copy past a lot of stuff from one
ScriptService to another and I wanted to discuss with you think I find
common enough to be put in a AbstractScriptService in
xwiki-commons-script to be reused everywhere.
As a discussion based I committed a first thing in
https://github.com/xwiki/xwiki-commons/commit/a19c6df56fa984dacc9a8eeb50bb9…
in a branch.
So here are some ideas:
* helper to set/get exception that every method is supposed to catch
to make error handling in languages like velocity easier (in the
commit)
* helper to find a proper "safe" wrapper based on the type of an
object (there is a example of such helper in
https://github.com/xwiki/xwiki-commons/tree/master/xwiki-commons-core/xwiki…)
Any other ?
WDYT ?
+1.
I was wondering what could possibly be common to most script services...
Good idea with the exception handling stub. I usually just ignored
errors and returned null in the services that I wrote.
--
Sergiu Dumitriu
http://purl.org/net/sergiu/