Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Model–view–controller
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Model=== {{See also|Data model}} The central component of the pattern. It is the application's dynamic [[data structure]], independent of the user interface.<ref>Burbeck, Steve (1992) [https://web.archive.org/web/20120729161926/http://st-www.cs.illinois.edu/users/smarch/st-docs/mvc.html Applications Programming in Smalltalk-80:How to use Model–View–Controller (MVC)]</ref> It directly manages the data, logic and rules of the application. In Smalltalk-80, the design of a model type is left entirely to the programmer.<ref>{{cite book |last1=LaLonde |first1=Wilf R. |last2=Pugh |first2=John R. |date=1991 |title=Inside Smalltalk |url=https://books.google.com/books?id=RRkiAQAAIAAJ |location=U.S.A. |publisher=Prentice-Hall Inc. |isbn=0-13-467309-3 |page=8 |quote=The model can be any object without restriction.}}</ref> With WebObjects, Rails, and Django, a model type typically [[object–relational mapping|represents]] a table in the application's [[database]].<ref>{{cite book |author=<!--Staff writer(s); no by-line.--> |date=May 2001 |title=WebObjects System Overview |url=https://developer.apple.com/library/archive/documentation/LegacyTechnologies/WebObjects/WebObjects_5/WebObjectsOverview/WebObjectsOverview.pdf |location=Cupertino, CA |publisher=Apple Computer, Inc. |page=28 |quote=In WebObjects, a model establishes and maintains a correspondence between an enterprise object class and data stored in a relational database.}}</ref><ref>{{cite web |url=https://guides.rubyonrails.org/active_record_basics.html |title=Active Record Basics |author=<!--Not stated--> |date=<!--Not stated--> |website=Rails Guides |access-date=October 27, 2022 |quote=This will create a <code>Product</code> model, mapped to a products table at the database.}}</ref><ref>{{cite web |url=https://docs.djangoproject.com/en/4.1/topics/db/models/ |title=Models |author=<!--Not stated--> |date=<!--Not stated--> |website=Django Documentation |access-date=October 27, 2022 |quote=Generally, each model maps to a single database table.}}</ref> The model is essential for keeping the data organized and consistent. It ensures that the application's data behaves according to the defined rules and logic.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)