wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Melendez <nmelen...@getsense.com.ar>
Subject Re: User name validation - how to check database to find if a name has already been taken?
Date Thu, 01 Oct 2009 14:59:13 GMT
Thanks Igor.Always is good another point of view.
NM


On Wed, Sep 30, 2009 at 5:14 PM, Igor Vaynberg <igor.vaynberg@gmail.com>wrote:

> actually you got it completely wrong. especially as your project, and
> the number of devs who work on it, grows exceptions are a much more
> scalable way of handling errors.
>
> 1) the compiler tells you exactly what the exceptions are right off the bat
> 2) exception class name gives you a clue as to what the error is
> without reading javadoc
> 3) exception classes can contain error-related data that is easy to
> retrieve
> 4) you cannot forget to handle a checked exception
> 5) if someone adds a new error code you do not have to hunt down all
> the places that now need to be changed - once again you get a compile
> time error
> 6) a bunch of other stuff i dont feel like typing out
>
> -igor
>
> On Wed, Sep 30, 2009 at 7:55 AM, Nicolas Melendez
> <nmelendez@getsense.com.ar> wrote:
> > why do you use an exception for user already exits?Don`t you think that
> > return true/false, could be better?
> > i said that, because if the application start growing, you will have lot
> of
> > exceptions class.
> > thanks,
> > NM
> >
> >
> > On Wed, Sep 30, 2009 at 4:43 PM, Paul Huang <paulhuang98@gmail.com>
> wrote:
> >
> >>
> >>
> >>
> >> igor.vaynberg wrote:
> >> >
> >> > form {
> >> >   onsubmit() {
> >> >        try {
> >> >           users.persist(getmodelobject());
> >> >        } catch (usernamealreadyexistsexception e) {
> >> >           error("error.username.exists");
> >> >        }
> >> >    }
> >> > }
> >> >
> >> > -igor
> >> >
> >>
> >> Thanks, it works like a charm. I did not  know I could show an error
> >> message
> >> by calling "Component.error" and then use a filter to catch all error
> >> messages targeting a specific FormComponent.
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/User-name-validation---how-to-check-database-to-find-if-a-name-has--already-been-taken--tp25614625p25682499.html
> >> Sent from the Wicket - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> >> For additional commands, e-mail: users-help@wicket.apache.org
> >>
> >>
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message