O'Reilly logo

Joy of Patterns: Using Patterns for Enterprise Development, The by Brandon Goldfedder

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part.java

package ProductConfig;
import java.io.PrintStream;

class NotACompositeException extends Exception {
    NotACompositeException() { super(); }
    NotACompositeException(String s) { super(s); }
}

public abstract class Part
{

public abstract double getPrice();

public abstract String getName();

public abstract String getDescription();

public abstract ResourceList getResourceList();

public abstract void displayInvoice(PrintStream stream, int level);

public abstract void addPart(Part part) throws
      NotACompositeException;

public abstract void removePart(Part part) throws
      NotACompositeException;;
}

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required