td4j 10.10 released

2010-10-10 by mira

This new release includes two major features; options for mutable individual properties and companion objects

Options let you specify a list of elements the user can choose from. The LocalizedHelloWorldExample declares options for the locale property:

public static class HelloWorld {
  private static final Map<Locale, String> messageMap = new HashMap<Locale, String>();

  static {
    messageMap.put(Locale.ENGLISH, "Hi %s! How are you?");
    messageMap.put(Locale.GERMAN, "Hallo %s! Wie gehts?");
    messageMap.put(Locale.FRENCH, "Salut %s! Ça va?");
    messageMap.put(Locale.ITALIAN, "Ciao %s! Come stai?");
  }

  public final List<Locale> localeOptions = new ArrayList<Locale>(messageMap.keySet());
  public Locale locale;

  public String name = "world";

  public String getGreeting() {
    return String.format(locale != null ? messageMap.get(locale) : "%s", name != null ? name : "");
  }

}

Localized HelloWorld Example

Companion Objects allow to define operations separated from domain entities. This is especially useful to implement behavior that spans multiple domain objects;

Check out the new IssueTrackerExample to see how companions are defined and configured.

Get the release from Sourceforge.

See the RELEASENOTES for minor changes.

Archive

architecture