You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Eran Chinthaka <ch...@opensource.lk> on 2007/02/18 07:16:44 UTC

Re: [Axis2] Input Parameter Validation, Error and Exception handling

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Sanjaya,

While agreeing with David's comments on these, let me add a bit more.
Sanjaya Karunasena wrote:
> Hi All,
> 
> What are the typical guidelines followed in the project?

This is all we have for now :
http://wiki.apache.org/ws/FrontPage/Axis2/CodeQuality

> 
> 
> Few suggestions on input parameter validation are;
> * An instance of a class which make use of an input parameter for the 
> first time should validate the parameter

I am bit concerned about this. For example, if there are methods in
classes which takes message context as an argument, are u suggesting to
validate it each and every time?

I hope we do have validations now, most of the time. Adding more
validations, that are not absolutely required, might affect the
performance as well.

> * A instance of a interface class (Actor interface) should assume 
> default values for required (mandatory) parameters where possible (Could be 
> due to a flexibility provided in a specification)

+1.

> * If there are optional parameters for an interface, that should be 
> handled through method overloading (not by allowing null inputs)

Hmm, I don't think I get this. We have reduced the number of methods
using this technique.

For example, declareNamespace(String localName, String nsURI, String
nsPrefix). Here u can pass null for last two params. If do not wanna do
that that, we have to define methods for each and every combination,
which increases the number of methods un-necessarily and clutter the class.
But the best option is to document the valid inputs, IMO.

> * Any exceptions to this can be discussed and come to some logical 
> agreement based on the specific scenario (80, 20 rule)

??

Thanks,
Chinthaka
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF1+9MjON2uBzUhh8RAom2AJ9+JlqbaKzwi3TjqEcP1z4YhoQ6awCeN50m
+Ldu7drtf1ruZXN0gtVRTVY=
=1B8x
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org