MVC Concepts and the Front Controller J2EE Pattern
Let's look in more detail at what it means to adopt an MVC approach to web applications. In this section we'll consider theory and general principles. In the next section we'll look at some real MVC web frameworks that simplify the implementation of applications using an MVC approach.
The MVC Triad
The MVC approach divides components into three kinds of object: model data objects; view objects that present model data on screen; and controller objects that react to user input, updating models appropriately.
In a true MVC architecture, such as that of Java's Swing GUI libraries, each view registers with a model, which publishes events when its data is updated. Consider the Swing JList component. This simple view component displays items in a list and allows item selection. The list data is defined in an object implementing the ListModel interface, which publishes ListDataEvents when the data changes. The JList view component provides a ListDataListener implementation that registers with the ListModel and updates the display as events are received. This is a push model: the model pushes notifications to any number of listeners, which are typically (but not necessarily) views.
As changes in a web application are usually only displayed to the user when a request is received and a new page is generated, the push model doesn't work. Hence a web application view will only render once. It won't help to register it to receive ongoing notifications. The solution is to use a pull model, in which a view is given access to the models required to render a dynamic page, and the view pulls data from the model as necessary. Since a web page may contain different controls and sections of dynamic data, more than one model may be required to back it.
Whether we use a push or pull model, the MVC architecture still delivers its key benefits. Each component type has a clear responsibility. Models contain no view-specific code. Views contain no control code or data-access code and concentrate on displaying data. Controllers create and update models; they do not depend on particular view implementations.
Although the MVC approach has the potential to improve web-tier code tremendously, it is a little complex to set up. Thus we will generally use a generic MVC web application framework, rather than implement the pattern ourselves.
紧急求助,翻译成英文
详情请查看视频回答
紧急求助翻译
紧急求助翻译成英文是:Emergency help,见下图百度翻译
求助者 用英文怎么说
求助者:help caller
英文翻译求助(中译英)
1.I ask the leader today, still cannot determine whether in March, see your apology. If you come to Beijing, there are other issues that I can not travel in the talks in Beijing with you, but not to travel for conflict, also won't bring you much damage, If you come to...
"我要解决这个难题“求助这句话的英文翻译
I will work out\/ sort out \/solve this tough problem.
英文翻译求助
Company location: Tong Mei Industrial Park, Fuyong Road\/Street(具体用road还是street看当地习惯——译者注), Bao’an District, Shenzhen (City)Shenzhen Office\/Firm location: Rongchao Economic and Commercial Building, Jintian Road\/Street(选择同上), Futian District, Shenzhen (City)仅供参考。
帮助用英文怎么说
Answer: Help 解释:1. “帮助”这个词在英文中的对应翻译是“Help”。这是一个非常常见的词汇,其含义广泛且多功能。2. 在不同的语境中,“Help”可以有多种用法和含义。例如,在日常生活对话中,人们可能会说“Can you help me?”来表示请求帮助。在...
求助英文翻译
2, China advocates equality, mutual benefit, reciprocity with other countries based on economic and trade relations and common development.3、在高度竞争化的时代,建立一个国际性的分销与服务网络十分迫切。3, at the time of highly competitive, set up an international distribution and service...
求助,英文翻译
The ragged man in ragged clothes. He is Vincent Van Gogh. While I started to learn painting at my 5years old, I knew him at 10. In a painting book, I saw his pictures which touched my heart.衣衫褴褛的人的鹑衣。他是文森特凡高。虽然我开始学习绘画在我五年岁,我知道他在10 ...
英语中文翻译成英文
SOS帮忙翻译一下呜呜着急用哇!3Q3Q~起初我喜欢英语是因为想看原版电影每当我看到自己喜爱哒国外电影我就想有一天可以自己看懂而不需要借助字幕... SOS 帮忙翻译一下 呜呜 着急用哇!3Q3Q~起初 我喜欢英语是因为想看原版电影每当我看到自己喜爱哒国外电影我就想有一天可以自己看懂而不需要借助字幕 展开 ...