Class Director

java.lang.Object
Creational.Builder.Director

public class Director extends Object
Orchestrates the construction process. The Director class uses a Builder to construct a Product in a predefined sequence.
  • Constructor Details

    • Director

      public Director(Builder builder)
      Constructs a Director with the given builder.
      Parameters:
      builder - The Builder instance to use for constructing the product.
  • Method Details

    • construct

      public void construct()
      Constructs the product by invoking the builder's methods in sequence.
    • getProduct

      public Product getProduct()
      Retrieves the constructed product from the builder.
      Returns:
      The constructed Product instance.