Package com.hotmoka.examples.patterns.factory

Examples of com.hotmoka.examples.patterns.factory.Pizza


public class Main {

  public static void main(String[] args) {
    NYPizzaFactory nyStrategy = new NYPizzaFactory();
    PizzaChainStore alPacino = new PizzaChainStore(nyStrategy);
    Pizza cheese1 = alPacino.orderPizza("cheese");

    ChicagoPizzaFactory chicagoStrategy = new ChicagoPizzaFactory();
    PizzaChainStore venezia = new PizzaChainStore(chicagoStrategy);
    Pizza cheese2 = venezia.orderPizza("cheese");

    System.out.println("This is what you eat in NY when you order a cheese pizza:");
    System.out.println(cheese1);

    System.out.println("\nwhile you would eat this in Chicago instead:");
View Full Code Here

TOP

Related Classes of com.hotmoka.examples.patterns.factory.Pizza

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.