• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is this the real essence of MVC pattern?

 
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suppose we have an application with three windows: oneView, twoView, threeView.
I've should have a main controller and other three controller, one for each view.
When the software starts, the main controller should instantiate and open the first view. When i click on the link for the second view, i should call the "openSecondView" method in the controller. The controller instantiate twoView and open it. twoView store a reference for the twoController with it own methods and that extends the mainController...

In other words, we can see a software like a tree structure, driven by a maincontroller (the trunk) and from wich other controllers (branches) inherit. A branch can generate other branches and each of them should inherit from the previos branch. When i'm on the branch number 43 i can easly go back to the branch 42, 41, 40 and so on, until the main trunk.
In any moment what i can see in the sofwtare is avaible in any moment inside my code, because i've all data stored inside controllers (always in memory) and models?

Is it the main philosophy of mvc pattern?
 
Greenhorn
Posts: 8
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That is not the only benefit of MVC pattern. It is not necessary to have separate controller for oneview, twoview, threeview etc. In fact, several view can reuse the same controller based on the requirements. MVC is mainly used to separate model(business logic), Controller ( to redirect the request between model and view) and View (display the data).

MVC provides the following benefits:
1. Reusability
2. Maintainability (Changes in model will not affect the view)
3. Several people can work simultaneously

Hope this is clear..
 
reply
    Bookmark Topic Watch Topic
  • New Topic