Пример #1
0
  public static void main(String[] args) {

    MyView view = new MyView();
    MyModel model = new MyModel();

    Presenter presenter = new Presenter(model, view);
    model.addObserver(presenter);
    view.addObserver(presenter);
    view.start();
  }
Пример #2
0
  public static void main(String[] args) {

    MyModel model = new MyModel();
    MyView view =
        new MyView(
            new BufferedReader(new InputStreamReader(System.in)), new PrintWriter(System.out));

    MyController controller = new MyController(model, view);
    model.setController(controller);
    view.setController(controller);

    view.start();
  }