On Wed, 27 Jul 2011 18:29:22 -0400
Jeremy Thomerson <jer...@wickettraining.com> wrote:

> Hello all,
> 
>   I'm writing an article for a Java magazine and would like to
> include in it a list of "ten things every Wicket programmer must
> know".  Of course, I have my list, but I'd be very curious to see
> what you think should be on that list from your own experience.  Or,
> put another way, maybe the question would be "what I wished I knew
> when I started Wicket" - what tripped you up or what made you kick
> yourself later?

Not ten things, but a few anyway. This is what I really try to get
across in training classes:

- Understand how models work, that they are a shared reference to a
  domain object, and they connect your components. If you find yourself
  shoveling data around manually, have a second, third and fourth look
  at it, you're probably doing it wrong.

- Detach your models. There's a simple rule: Any model that you
  instantiate or that you get passed in from elsewhere you need to
  either
    - detach yourself
    - or pass it to another component, thus delegating the
      responsibility for detaching it.
  "Detach it or pass it on."

- Try to use as few instance variables in your components as possible.
  Use instance variables only for handling state completely internal
  to your component. Use models for everything else - that is,
  everything that might be visible from outside your component. Internal
  state is stuff that never leaves your component, neither to whomever
  called you, nor to anything you call. The latter includes components
  that you aggregate in your panel.
  This rule greatly simplifies refactoring later on.

- Did I mention that models are important? :-)

Carl-Eric
www.wicketbuch.de


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to