Quoting Niclas Hedhman <[email protected]>:

On Thu, Dec 3, 2009 at 5:40 PM, Stanislav Muhametsin
<[email protected]> wrote:

What do you think about this?

I have thought about this in the past, but never gotten to a reason to
fully analyze it.

In essence, it is fairly straight forward to implement it in Qi4j
Runtime, if we can nail down the specification, I think. But, one
thing should also be clear; We could either split the constraint
validation between method input and return, OR we could extend the
current interface to include a separate method for return value
validation. (And in usual Qi4j magic, allow either one to be absent).

Could you elaborate on theory a bit? Is this what is known in UML as
"post conditiions", or does those also include internal state?



About implementation - extending interface sounds more easy and straightforward. As long as it wouldn't create any abnormal situations and won't confuse the constraint implementator too much, IMO that sounds like a better idea.

About theory - I'm not 100% familiar with UML post-conditions. Most definitions I know and the ones available on Internet, seem to include the internal state to both pre- and post-conditions. Because we are talking about Qi4j Constraints, and they don't have access to internal state, we can leave out the internal state when talking about pre- and post-conditions. I think the internal state conditions can be expressed in Concerns, since Concerns have access to internal state, and the composite implementator is aware of all Concern implementations his/her composite has.

Hence constraint post-condition evaluation could consist of analyzing return value only. However, do you think that sometimes it is also required to analyze input parameters (for possible changes) along with return value? I mean, technically speaking, if pre-conditions cover method input, post-conditions should cover both input AND output. Would that get too complicated and confusing for users of Qi4j?


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

Reply via email to