/// <summary>
        /// Here I receive the two instantiated objects to which I will have access to its methods without view or model ever noticing who is
        /// manipulating them. This is pretty smart because this way I can request from the view the properties needed instead of making the view to 
        /// hand it those to the controller without the controller even requesting them in the first place making the view to know about the controller and the model
        /// about the controller as well, making it tighly coupled instead of loosly coupled as I did here.
        /// </summary>
        /// <param name="view"></param>
        /// <param name="model"></param>
        public ControllerBank(ref ViewBank view, ref ModelBank model)
        {
            this.view = view;
            this.model = model;

            
        }
Exemplo n.º 2
0
        /// <summary>
        /// the is the best MVC I could think of
        /// it has instantiated objects of view and model. It basically makes both of them unaware that there are
        /// this classes, the only one aware is controller which has both. The nice thing about this is that in
        /// the model and view's constructors there is no instance of controller so they don't know there is even a controller
        /// only an object requesting data so this mvc is more of a middle man rather than a forward mvc used a couple of years
        /// ago.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World MVC");

            // Create instance of View
            ViewBank bankView = new ViewBank();
            // Create instance Model
            ModelBank bankModel = new ModelBank();
            // Create instance Controller passing view and model
            ControllerBank bankController = new ControllerBank(ref bankView, ref bankModel);

            startApp(ref bankController);



            Console.ReadKey();
        }
        /// <summary>
        /// the is the best MVC I could think of
        /// it has instantiated objects of view and model. It basically makes both of them unaware that there are
        /// this classes, the only one aware is controller which has both. The nice thing about this is that in 
        /// the model and view's constructors there is no instance of controller so they don't know there is even a controller
        /// only an object requesting data so this mvc is more of a middle man rather than a forward mvc used a couple of years
        /// ago.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World MVC");

            // Create instance of View
            ViewBank bankView = new ViewBank();
            // Create instance Model
            ModelBank bankModel = new ModelBank();
            // Create instance Controller passing view and model
            ControllerBank bankController = new ControllerBank(ref bankView, ref bankModel);
            
            startApp(ref bankController);

           


            Console.ReadKey();
        
        }
 /// <summary>
 /// Here I receive the two instantiated objects to which I will have access to its methods without view or model ever noticing who is
 /// manipulating them. This is pretty smart because this way I can request from the view the properties needed instead of making the view to
 /// hand it those to the controller without the controller even requesting them in the first place making the view to know about the controller and the model
 /// about the controller as well, making it tighly coupled instead of loosly coupled as I did here.
 /// </summary>
 /// <param name="view"></param>
 /// <param name="model"></param>
 public ControllerBank(ref ViewBank view, ref ModelBank model)
 {
     this.view  = view;
     this.model = model;
 }