• Post Reply Bookmark Topic Watch Topic
  • New Topic

Model View Controller  RSS feed

 
Nitish Bangera
Ranch Hand
Posts: 537
Eclipse IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is a Model? Is model considered as a Bean/Java Class which encapsulates the data? Also if have to create a model for a file Lister, how would i proceed?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the model is how you do what you need to do. For example, let's look at a device to tell the time.

The model could be a pendulum/escapement, an oscilating quartz crystal, sand falling through a small hole, or a candle of a fixed diameter burning down. all of these can be used to measure the passing of time.

the View is how that data is presented to the user. They could be hands on a clock face, or digits representing HH:MM:SS, or a few other ways.

And the controller is how someone makes adjustments to things. Buttons you press, a stem you pull in/out and twist, a fully functioning keyboard, etc.
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nitish Bangera wrote:Is model considered as a Bean/Java Class which encapsulates the data? Also if have to create a model for a file Lister, how would i proceed?

Yes. The model would contain objects (not always beans) which encapsulate the data. A file lister model would contain File objects. Check out the File API where you will find useful methods to help you build the model.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!