incubator-cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fang Wang <fang.w...@citrix.com>
Subject RE: [DISCUSS] Api refactoring -- validation
Date Thu, 13 Dec 2012 18:22:39 GMT
The DB validation and the API validation are both needed.
For API validation, e.g., regarding a min_max value, our goal is to make sure the input value
is in the range,
Avoid an out-of-range value being passed down and failing finally at the DB.  


Thanks,
-Fang
-----Original Message-----
From: Koushik Das [mailto:koushik.das@citrix.com] 
Sent: Wednesday, December 12, 2012 10:01 PM
To: cloudstack-dev@incubator.apache.org
Subject: RE: [DISCUSS] Api refactoring -- validation

If API input directly maps to a column in the DB then same validation needs to be present
at both layers.
For e.g. if there is a max_size constraint on API parameter then that should map to column
size in the DB.
-Koushik

-----Original Message-----
From: Chip Childers [mailto:chip.childers@sungard.com]
Sent: Thursday, December 13, 2012 11:13 AM
To: <cloudstack-dev@incubator.apache.org>
Subject: Re: [DISCUSS] Api refactoring -- validation

Thanks Min!  I think the comment about validating the DB entity was what confused me. Got
it now.

- chip

Sent from my iPhone.

On Dec 13, 2012, at 12:39 AM, Min Chen <min.chen@citrix.com> wrote:

> I think that it is the latter case.
>
> -min
>
> Sent from my iPhone
>
> On Dec 12, 2012, at 9:32 PM, "Chip Childers" <chip.childers@sungard.com> wrote:
>
>> On Wed, Dec 12, 2012 at 6:16 PM, Fang Wang <fang.wang@citrix.com> wrote:
>>> Hi all,
>>>
>>> In our current API refactoring work, we plan to add a validation 
>>> annotation to Validate DB entity, validate some parameter range,  etc.
>>> We plan to add the @validate annotation to API commands.
>>
>> This might be a silly question, but why the command classes and not 
>> the Dao's?  Is this to validate the database inputs?  Or are we 
>> talking about cleaning up the API input validation logic?
>>
>> Thanks!
>>
>>> IT is suggested we could use Hibernate Validator.  Anyone with 
>>> experience with Hibernate validator, how we could deploy it here?
>>>
>>> 1. is there a version we should definitely use?
>>> 2. Which option is better to integrate into our maven? Add it as dependency or
as a plugin?
>>> 3. What is the latest version working with maven?
>>>
>>> Thanks for any input,
>>> -Fang
>

Mime
View raw message