请E文好的翻译一下(50分)

  • 主题发起人 主题发起人 zhanggok
  • 开始时间 开始时间
Z

zhanggok

Unregistered / Unconfirmed
GUEST, unregistred user!
First, let it be said that, for the most part, the Struts ActionServlet components canbe used as they are. Theydo
not need to be subclassed (but can be), and thedefault classes get the jobdo
ne with a minimum of fuss. From an architecturalperspective, the Struts ActionServlet is a blackbox component [Johnson].
Throughout this book, we have often referred to the Struts controller servlet
and described how it fits in with the various components that make up the Struts framework. This jibes well with actual practice, since to work with Struts on a dayto-day basis, most developers only need to know how the ActionServlet interacts with the other components they use. Struts developers, rarely, if ever, work with the ActionServlet directly.
The implementation of the ActionServlet changed quite a bit between
Struts 1.0 and Struts 1.1—so much so, that we will cover only the
Struts 1.1 ActionServlet here. Most developers did not subclass the Struts
1.0 ActionServlet, or did so in very minor ways. Moreover, the ActionServlet
is designed as a singleton. At most, applications will subclass Action-
Servlet exactly once. Since Struts developersdo
not work with the
ActionServlet on a day-to-day basis, we will not contrast the differences
between the releases, as we havedo
ne else
where. By simply describing
the ActionServlet as it now stands, if necessary, Struts 1.0 developers will
be able to adapt any changes they might have made.
There are two key reasons why Struts developers are so detached from the Action-Servlet. First, it is a true singleton. There is exactly one ActionServlet present in any Struts application. Wedo
not create new ActionServlets the way we create new Actions or ActionForms. In Struts, there is simply not much development work left todo
with a servlet.
Second, the ActionServlet spends most of its time invoking other objects.
Rather than code to the servlet, we code to the objects the servlet calls. Many frameworks use this approach. In fact, it is considered a formal design pattern, Inversion of Control [Johnson]. The ActionServlet coordinates the application’s activities, but the methods defined by the user to tailor the framework are only called by the servlet. They are not declared within the servlet.
 
首先,据说让成为,对于大多数部分,被用作他们的Struts ActionServlet组成部分canbe。 他们不需要是子类(但是能),而thedefault类别工作以最少的大惊小怪做。 从architecturalperspective,Struts ActionServlet是黑盒子组成部分[Johnson]。
遍及这本书,我们经常已指的是Struts控制器servlet
同时,描述它如何在中用构成Struts框架的各组成部分予以适合。 这以实际的实践嘲弄好,由于大多数开发者仅仅需要知道与dayto-day基础上的Struts工作,ActionServlet如何与他们使用的其它组成部分相互作用。 Struts开发者,很少,如果与ActionServlet直接工作曾经,。
执行ActionServlet在之间十分有一点变化
Struts 1.0和Struts 1.1—so许多如此,我们将仅仅涉及
Struts 1.1 ActionServlet在这里。 大多数开发者没有子类Struts
1.0 ActionServlet,或者这样做按照十分次要的方法。 此外,ActionServlet
被设计作为singleton。 至多,应用意志子类行动
Servlet确切地一次。 由于Struts开发者以不工作
在一个日常的基础上的ActionServlet,我们将不对比区别
在释放之间当我们已在其它地方做。 通过简单地描述
虽然如果必要的话它现在站ActionServlet,,Struts 1.0种开发者意志
能够适应他们可能已做的任何变化。
有两个钥匙阐明,Struts开发者如此脱离开行动Servlet。 首先,它是真实的singleton。 有在任何Struts应用中在场的确切地一ActionServlet。 我们不建立新的ActionServlets方法我们建立新的行动或者ActionForms。 在Struts中,有简单地不多的左的发展工作以servlet做。
第二,ActionServlet花费大多数其时间调用其它对象。
不愿servlet的代码,我们servlet称为的为对象编码。 许多框架使用这种方法。 事实上,它被考虑正式的设计模式,控制[Johnson]的倒置。 ActionServlet协同application’s活动,但是被用户定义制做框架的方法被servlet仅仅称为。 他们在servlet之内不是被宣布
 
后退
顶部