/***
 * Excerpted from "Domain-Driven Design Using Naked Objects",
 * published by The Pragmatic Bookshelf.
 * Copyrights apply to this code. It may not be used to create training material, 
 * courses, books, articles, and the like. Contact us if you are in doubt.
 * We make no guarantees that this code is fit for any purpose. 
 * Visit http://www.pragmaticprogrammer.com/titles/dhnako for more book information.
***/
public class Car extends AbstractDomainObject {
    ...
    public void created() {
        setName(newTransientInstance(Name.class));
    }

    public String title() {
        return getName() != null? getName().title(): null;
    }
    public String iconName() {
        return getName() != null? 
            getName().getTitle().getIconName(): null;
    }
    
    private Name name;
    @MemberOrder(sequence="1")
    @Disabled
    public Name getName() { ... }
    public void setName(final Name name) { ... }

    @Hidden
    public boolean matches(String firstName, String lastName) {
        return getName() != null? 
            getName().matches(firstName, lastName): false;
    }
    ...
} 
