Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures - Retired Efficiency! Building the Model

Micki Harning
Micki Harning
3,696 Points

Model?

i don't get what a model is exactly, and what things we use it for. Could you maybe explain it in a simple way? :)

1 Answer

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,862 Points

A model is a, literally, thing. It represents anything you want. My guess is that there is a model call User in Treehouse that models a user. It would contain things like the number of points you have, if you are a mod or employee, what kind of account you have, etc.

If you were creating a program that represented a store, you would have a Product model that would have the product's name, department, price and any other attribute a product might have.

Micki Harning
Micki Harning
3,696 Points

isn't it just a class then?

Caleb Kleveter
Caleb Kleveter
Treehouse Moderator 37,862 Points

Not necessarily. A controller is (a more complicated subject) not a model, but a controller. But that is more advanced and goes into the whole MVC thing.