You made the points, that's for sure.

But, let's see your example:

MyPage(PageParameters params) throws Exception {
      long id = params.getLong("id");
      ....
}

PS: and believe me, I faced a case like this yesterday!

In my case, the checked exception alerted me to display a nice and beautiful message saying: "stupid user, you sent an invalid ID and that's why I will not display a message with some stack trace so you don't have to botter, or worst: a message saying the object doesn't exist in the database."

If it were unchecked and the project team wasn't expert within Wicket, we could get a lot of pages throwing exceptions in production and users calling the support to ask "Why?".

:)

Anyway, that's my opinion... :D

Regards,
On 8/16/06, Stephane Bailliez <[EMAIL PROTECTED]> wrote:
Bruno Borges wrote:
> Actually, I've seen a lot of code like this:

I have seen more code w/o rollback than with unfortunately, so yes
ideally software is perfect and bug free with great design, but time
being what it is, shortcuts and bad decisions make this world challenging.

> So, there is a lot of reasons to have SQLException been checked. :)

And you will also notice that JDBC 4.0 provides a SQLRuntimeException
which is used by DataSet helper. :)

SQLException is not exactly known for its great design as well.

> IMHO, RuntimeException are for programmers mistakes.

That's what I said indeed :)

I think we're actually saying the same thing but from different
viewpoints. My initial mail was based from the developer perspective. I
a create a Page with a PageParameters ctor and because I use a
BookmarkableLink where I use some 'id' param and get it from the ctor,
checked exceptions does not bring any value. You could of course assume
that the user will be messing with your params later on, but this could
be extrapolated to the fact that the user may also change the name of th
e target page (or even the target hostname and port).

> User input should
> be handled carefully by programmers, and that's why I believe
> PageParameters (because users can modify those values) should have
> checked exceptions.

Fair enough, I understand your point from the browser perspective if the
user is having fun with the url and changing the 'id=123' by
'id=abfjfkdfd'.

But what error handling do you do then which will make a massive
difference from the user perspective ? (assuming of course you did not
have multiples insert span in between your get() with no transactions).

Can you give an example of what you're doing with checked exceptions in
that case ?

What I simply expect people to do is this.

MyPage(PageParameters params) throws Exception {
      long id = params.getLong("id");
      ....
}


> On 8/15/06, *Stephane Bailliez*
> <[EMAIL PROTECTED]
> <mailto:[EMAIL PROTECTED]>> wrote:
>
>     Bruno Borges wrote:
>      > I agree with you that it could be unchecked, but remember that
>      > PageParameters are sent by users in many different ways!
>
>      > Users can change URL adding parameters, modifying values,
>     removing other
>      > parameters, etc. So, I think that it could but probably is not
>     the best
>      > way to go. Threating these convertions with checked exceptions
>     give us
>      > (programmers) a rule to follow: "please, check parameters and
>     alert user
>      > if he/she sent invalid values."
>
>     If it's a checked exception, I would be curious what more do you do ?
>     let it go and declare  it so that it's handled by the reflection part of
>     your page if any ?
>     wrap it around a runtime exception ?
>     wrap it around another checked exception which is 'maybe' handled by
>     another handling exception code ?
>
>     The runtime exception when thrown will remind you right away that
>     something is not correct. It will just remove unnecessary code on
>     pageparameters handling, since there is nothing you can do to recover
>     from an invalid type, which in itself is a programming error.
>
>     I have seen too many times things such as:
>
>     try {
>     } catch (SQLException e) {
>         LOG.error("database error", e);
>     }
>     ... some more code...
>
>     which generally make the whole thing crash 2K SLOC later with 5000 lines
>     of different exception logged due to instability which makes the
>     application crash with a totally cryptic unrelated message later.
>
>     Cheers,
>
>     Stephane
>
>
>     -------------------------------------------------------------------------
>     Using Tomcat but need to do more? Need to support web services,
>     security?
>     Get stuff done quickly with pre-integrated technology to make your
>     job easier
>     Download IBM WebSphere Application Server v.1.0.1 based on Apache
>     Geronimo
>     http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>     < http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642>
>     _______________________________________________
>     Wicket-develop mailing list
>     Wicket-develop@lists.sourceforge.net
>     <mailto:Wicket-develop@lists.sourceforge.net>
>     https://lists.sourceforge.net/lists/listinfo/wicket-develop
>
>
>
>
> --
> Bruno Borges
> Summa Technologies Inc.
> www.summa-tech.com <http://www.summa-tech.com>
> (11) 8565-7739 - (11) 3846-1622
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop



--
Bruno Borges
Summa Technologies Inc.
www.summa-tech.com
(11) 8565-7739 - (11) 3846-1622
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-develop mailing list
Wicket-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-develop

Reply via email to