On Thu, Oct 23, 2008 at 8:54 AM, Rickard Öberg <[EMAIL PROTECTED]> wrote:
> I can't think of any good reason not to do it, now that we have a pretty
> good framework for implementing it. I'm assuming that it would look
> something like:
>
> @NotEmpty @Matches("[A-Z][a-z]*")
> public String helloWorld(@NotNull String phrase, @NotNull String name);
Looks 'natural' in our world.
> One question is what should happen if an incorrect value is created? The
> current ConstraintViolationException extends IllegalArgumentException
> which doesn't seem to make sense. What exactly would the semantics be,
> and what should you do with the exception if you get it?
Logically speaking it is an InternalError in the implementation. And I
think we should create an RuntimeException for the purpose
(ContractViolationException?), and have these checks before execution
of the Concerns return path, so that one can plugin generic Concerns
doing something with it.
Cheers
Niclas
_______________________________________________
qi4j-dev mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/qi4j-dev