On 8/3/11 17:10 , Nicolas Delsaux wrote:
Having not used Qi4J, my contribution may be of rather small
interest, anyway ...
From what I understand, most of what Qi4j uses are interfaces. As
a
consequences, the methods you mention returns proxies over those
interfaces. In such a case, it would be great to use the NullObject
pattern : instead of returning null, you return a proxy implementing
the same interface that always return zero values or empty
collections (but not null). Mor details on c2wiki :
http://c2.com/cgi/wiki?NullObject

I'm not sure which methods this would make sense with in the current API. None of the methods I mentioned return proxies actually. Do you have any examples of what you mean?

When not possible, it would be better to return a Qi4J specific
exception, that would be able to carry far more meaning than
standard Java one and maybe provide continuation mechanisms (think
about an exception that would contain the aforementionned NullObject,
or an exception that would provide additionnal debug infos ina
structured form, as opposed to the String+StackTrace we usually
get).

Sounds incredibly complicated. Got usecase?

/Rickard

_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev

Reply via email to