Model View Controller
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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?
posted 14 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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.
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.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
posted 14 years ago
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.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
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.
| Whatever you say buddy! And I believe this tiny ad too: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |








