Yeah, that's a good solution. Another clean solution is to use the
decorator pattern.

class Foo {
  private String bar;
  public void setBar(String bar) { this.bar = bar; };
  public String getBar() { return bar; }
}

class Wrapper {
  private final Foo foo;
  private String formProperty;
  public Wrapper(Foo foo) {
    this.foo = foo;
  }
  public void setBar(String bar) { foo.setBar(bar); };
  public String getBar() { return foo.getBar(); }
  public void setFormProperty(String formProperty) { this.formProperty
= formProperty; }
  public String getFormProperty() { return formProperty; }
}


This is much more verbose of course, but I like the fact that it keeps
all your model code together. And your IDE can generate most of your
code for you.

I have to admit though that I usually go for what Igor proposed,
simply because it is less work.

Eelco


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to