Exemplo n.º 1
0
  static void Main(){
    IStack stacy = new StackImpl1();
    StackDecorator1 orrico = new StackDecorator1(stacy);
    Observer StackObserver1 = new Observer();
    Observer StackObserver2 = new Observer();
    orrico.attach(StackObserver1);
    orrico.attach(StackObserver2);
    orrico.howMany();
    orrico.pushStack("Stella");
    orrico.pushStack("was");
    orrico.pushStack("a");
    orrico.pushStack("Diver");

    // Sin decorar
    stacy.pushStack("and");
    stacy.pushStack("she");
    stacy.pushStack("was");
    stacy.pushStack("always");
    stacy.pushStack("down");
    // decorar Sin

    orrico.howMany();
    orrico.popStack();
    orrico.howMany();
  }
Exemplo n.º 2
0
    static void Main()
    {
        StackImpl1 stacy = new StackImpl1();
        stacy.howMany();
        stacy.pushStack("Stella");
        stacy.pushStack("was");
        stacy.pushStack("a");
        stacy.pushStack("Diver");
        stacy.pushStack("and");
        stacy.pushStack("she");
        stacy.pushStack("was");
        stacy.pushStack("always");
        stacy.pushStack("down");

        stacy.howMany();
        stacy.popStack();
        stacy.howMany();
    }
Exemplo n.º 3
0
    static void Main()
    {
        StackImpl1 stacy = new StackImpl1();
        Observer StackObserver1 = new Observer();
        Observer StackObserver2 = new Observer();
        stacy.attach(StackObserver1);
        stacy.attach(StackObserver2);
        stacy.howMany();
        stacy.pushStack("Stella");
        stacy.pushStack("was");
        stacy.pushStack("a");
        stacy.pushStack("Diver");
        stacy.pushStack("and");
        stacy.pushStack("she");
        stacy.pushStack("was");
        stacy.pushStack("always");
        stacy.pushStack("down");

        stacy.howMany();
        stacy.popStack();
        stacy.howMany();
    }