PartBuilder.java

 package ProductConfig; public class PartBuilder { public PartBuilder(PartList partList) { m_partList = partList; } public void beginPart(String name , String description ) { // We will use a composite part as the holding queue // if it turns out to be simple we will simply // transform it later m_pendingPart = new CompositePart(name,description); m_isComposite = false; } public void beginPart(String name , String description , double price) { // We will use a composite part as the holding queue // if it turns out to be simple we will simply // transform it later m_pendingPart = new CompositePart(name,description,price); m_isComposite = false; } public void endPart() { // if it's not composite transform it if (!m_isComposite) ...

Get Joy of Patterns: Using Patterns for Enterprise Development, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.