MVC 架構
Model-View-Controller is a software design pattern that helps you logically separate your code, make it more reusable, maintainable, and generally better. Model View Controller was first described by the author group Gang of Four. Dean Helman wrote (an extract from Objective Toolkit Pro white paper):
"The MVC paradigm is a way of breaking an application, or even just a piece of an application's interface, into three parts: the model, the view, and the controller. MVC was originally developed to map the traditional input, processing, output roles into the GUI realm.
Input -> Processing -> Output
Controller -> Model -> View
The user input, the modeling of the external world, and the visual feedback to the user are separated and handled by model, view port and controller objects.
- The controller interprets mouse and keyboard inputs from the user and maps these user actions into commands that are sent to the model and/or view port to effect the appropriate change.
- The model manages one or more data elements, responds to queries about its state, and responds to instructions to change state.
- The view port manages a rectangular area of the display and is responsible for presenting data to the user through a combination of graphics and text."
延伸閱讀:
留言
張貼留言
,,