[hibernate-issues] [Hibernate-JIRA] Commented: (BVAL-218) Offer contract to validate method parameters and return values

Ansgar Konermann (JIRA) noreply at atlassian.com
Fri Jun 17 17:39:25 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/BVAL-218?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=42647#action_42647 ] 

Ansgar Konermann commented on BVAL-218:
---------------------------------------

Although I like the idea to validate method parameters and return values, I'd like to draw your attention to the [sibling JSR 305, "Annotations for Software Defect Detection"|http://www.jcp.org/en/jsr/detail?id=305]. In my eyes, JSR 305 is more focused on validation of method parameters and return values, whereas JSR 303 explicitly limits its scope to "Bean Validation" through its title.

I didn't notice too much progress around JSR 305 over an extended period of time and would love to foster progress on that JSR, but before we run ahead defining our own annotations and API to validate method parameters as part of JSR 303, we should look carefully at the work which has already been done for JSR 305 and make sure that JSR 303 and 305 integrate nicely with each other. The JCP's JSR 305 page lists a number of existing works which could be used as a starting point.

I'm not that familiar with the JCP process, but maybe a spinoff of the JSR 303 effort breath new life into JSR 305.

My personal preference would be to define a very small subset of what the listed JSR 305 contributions might contain and define that as the starting point for a 1.0 release of JSR 305 API. In my eyes, JSR 305 has seen way too little attention over the last few years and a little standardization of at least a small part of the suggested annotations could really help. For example, Jetbrains has been distributing their own Nullability-annotations with their IDEA development environment for years to support their nullability code inspections; they had to do so since there simply is no released JSR 305 API. Also the [OVal object validation framework|http://oval.sourceforge.net/] defines its own annotations to define Nullability of parameters etc. The world would be simpler if e. g. Jetbrains could use the same annotations as those used by OVal and other validation software. There is a real need for standard mechanisms to express and check parameter/return value constraints.


> Offer contract to validate method parameters and return values
> --------------------------------------------------------------
>
>                 Key: BVAL-218
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/BVAL-218
>             Project: Bean Validation
>          Issue Type: New Feature
>          Components: spec-general
>            Reporter: Emmanuel Bernard
>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list