当前位置:文档之家› 英文科技文献以及翻译

英文科技文献以及翻译

英文科技文献以及翻译
英文科技文献以及翻译

Struts In Action

1 What is struts (2)

2 Who makes the Struts software (2)

2.1 Why is Struts open source (2)

2.2 Why is it called Struts (3)

3 What are application frameworks (3)

3.1 Other types of frameworks (3)

3.2 Enabling technologies (4)

3.2.1 Hypertext Transfer Protocol (HTTP) (4)

3.2.2 Common Gateway Interface (CGI) (5)

3.2.3 Java servlets (6)

3.2.4 JavaServer Pages (6)

3.3 Enabling technologies 11 (7)

3.4.1 JSP tags (7)

3.4.1 JavaBeans (8)

3.4 Enabling technologies 111 (9)

4 Struts from 30,000 feet (10)

1 What is struts

Struts is open source software that helps developers build web applicationsquickly and easily. Struts relies on standard technologies—such as JavaBeans, Javaservlets, and Java Server Pages (JSP)—that most developers already know how touse. By taking a standards-based, “f ill-in-the-blanks” approach to software development,Struts can alleviate much of the time-consuming grunt work that comeswith every new project.

2 Who makes the Struts software

Struts is hosted by the Apache Software Foundation (ASF) as part of its Jakartaproject. Besides Struts, Jakarta hosts several successful open source products,including Tomcat, Ant, and Velocity.The initial Struts codebase was developed between May 2000 and June 2001 when version 1.0 was released. More than 30 developers contributed to the Struts distribution, and thousands more follow the Struts mailing lists. The Struts codebase is managed by a team of volunteer “Committers.” By 2002, the Struts team included nine active Committers.The primary architect and developer of the Struts framework is Craig R.McClanahan. Craig is also the primary architect of Tomcat 4 and the implementationarchitect of the Java Web Services Developer Pack. He is now Sun’s specification lead for JavaServer Faces (JSR-127) as well as the Web Layer Architect for the Java 2 Enterprise Edition (J2EE) platform.Struts is available to the public at no charge under the Apache Software License [ASF, License]. There are no acquisition or other recurring costs for using the software. Unlike some other open source licenses, the Apache Software License is business-friendly. You can use Struts to create a commercial project and distribute the Struts binary without any red tape, fees, or other hassles. You can also integrate the Struts components into your own framework just as if they were written in-house. For complete details, see the Apache Software License at

https://www.doczj.com/doc/509830839.html,/LICENSE.

2.1 Why is Struts open source

Most of the leading Java utilities and frameworks are now open source projects.Many of the developers working on these projects do so as part of their regular jobs with companies like IBM, Sun Microsystems, and Apple. Collaborating openly on this type of software benefits the entire marketplace. Today, many open source components are integrated into commercial products. Companies then sell professional documentation, guaranteed support levels, and other valuable aftermarket services to their clients.When software is freely available, it becomes much easier for the marketplace to support. Struts

is a prime example of this. Although still a youngster, it has already been featured in dozens of articles and seminars, not to mention books like this one. Many development teams do not like to use software that was not “invented” in-house. Open source components provide all the benefits of writing the same software in-house but do not lock you into a proprietary solution that only your team understands.Open source frameworks are a win-win for everyone.

2.2 Why is it called Struts

The framework is called “Struts” to remind us of the invi sible underpinnings that hold up our houses, buildings, bridges, and, indeed, ourselves when we are on stilts. This is an excellent description of the role Struts plays in developing web applications. When raising physical structures, construction engineers use struts to provide support for each floor of a building. Likewise, software engineers use Struts to support each layer of a business application.

3 What are application frameworks

A framework is a reusable, semi-complete application that can be specialized to produce custom applications [Johnson]. Like people, software applications are more alike than they are different. They run on the same computers, expect input from the same devices, output to the same displays, and save data to the same hard disks. Developers working on conventional desktop applications are accustomed to toolkits and development environments that leverage the sameness between applications. Application frameworks build on this common ground to provide developers with a reusable structure that can serve as the foundation for their own products.A framework provides developers with a set of backbone components that have the following characteristics:

_ They are known to work well in other applications.

_ They are ready to use with the next project.

_ They can also be used by other teams in the organization.

Frameworks are the classic build-versus-buy proposition. If you build it, you will understand it when you are done—but how long will it be before you can roll your own? If you buy it, you will have to climb the learning curve—and how long is that going to take? There is no right answer here, but most observers would agree that frameworks such as Struts provide a significant return on investment compared to starting from scratch, especially for larger projects.

3.1 Other types of frameworks

The idea of a framework applies not only to applications but to application components as well. Throughout this book, we introduce other types of frameworks that you can use with

Struts. These include the Lucene search engine, the Scaffold toolkit, the Struts validator, and the Tiles tag library. Like application frameworks,these tools provide semi-complete versions of a subsystem that can be specialized to provide a custom component.Some frameworks have been linked to a proprietary development environment.This is not the case with Struts or any of the other frameworks shown in this book. You can use any development environment with Struts: Visual Age for Java,JBuilder, Eclipse, Emacs, and Textpad are all popular choices among Struts developers.If you can use it with Java, you can use it with Struts.

3.2 Enabling technologies

Applications developed with Struts are based on a number of enabling

technologies.These components are not specific to Struts and underlie every Java web application. A reason that developers use frameworks like Struts is to hide the nasty details behind acronyms like HTTP, CGI, and JSP. As a Struts developer, you don’t need to be an alphabet soup guru, but a working knowledge of these base technologies can help you devise creative solutions to tricky problems.

3.2.1 Hypertext Transfer Protocol (HTTP)

When mediating talks between nations, diplomats often follow a formal

protocol.Diplomatic protocols are designed to avoid misunderstandings and to keep negotiations from breaking down. In a similar vein, when computers need to talk, they also follow a formal protocol. The protocol defines how data is transmitted and how to decode it once it arrives. Web applications use the Hypertext Transfer Protocol (HTTP) to move data between the browser running on your computer and the application running on the server.Many server applications communicate using protocols other than HTTP.Some of these maintain an ongoing connection between the computers. The application server knows exactly who is connected at all times and can tell when a connection is dropped. Because they know the state of each connection and the identity of each person using it, these are known as stateful protocols.By contrast, HTTP is known as a stateless protocol. An HTTP server will accept any request from any client and will always provide some type of response, even if the response is just to say no. Without the overhead of negotiating and retaining a connection, stateless protocols can handle a large volume of requests. This is one reason why the Internet has been able to scale to millions of

computers.Another reason HTTP has become the universal standard is its simplicity. An HTTP request looks like an ordinary text document. This has made it easy for applications to make HTTP requests. You can even send an HTTP request by hand using a standard utility such as Telnet. When the HTTP response comes back, it is also in plain text that developers can read.The first line in the HTTP request contains the method, followed by the location of the requested resource and the version of HTTP. Zero or more HTTP request headers follow the initial line. The HTTP headers provide additional information to the server. This can include the browser type and version, acceptable document types,

and the browser’s cookies, just to name a few. Of the seven request methods, GET and POST are by far the most popular.Once the server has received and serviced the request, it will issue an HTTP response. The first line in the response is called the status line and carries the HTTP protocol version, a numeric status, and a brief description of the status. Following the status line, the server will return a set of HTTP response headers that work in a way similar to the request headers.As we mentioned, HTTP does not preserve state information between requests.The server logs the request, sends the response, and goes blissfully on to the next request. While simple and efficient, a stateless protocol is problematic for dynamic applications that need to keep track of their users. (Ignorance is not always bliss.)Cookies and URL rewriting are two common ways to keep track of users between requests. A cookie is a special packet of information on the user’s computer.URL rewriting stores a special reference in the page address that a Java server can use to track users. Neither approach is seamless, and using either means extra work when developing a web application. On its own, a standard HTTP web server does not traffic in dynamic content. It mainly uses the request to locate a file and then returns that file in the response. The file is typically formatted using Hypertext Markup Language (HTML) [W3C, HTML] that the web browser can format and display. The HTML page often includes hypertext links to other web pages and may display any number of other goodies, such as images and videos. The user clicks a link to make another request, and the process begins anew.Standard web servers handle static content and images quite well but need a helping hand to provide users with a customized, dynamic response.

DEFINITION Static content on the Web comes directly from text or data files, like HTML or JPEG files. These files might be changed from time to time, but they are not altered automatically when requested by a web browser. Dynamic content, on the other hand, is generated on the fly, typically in response to an individualized request from a browser.

3.2.2 Common Gateway Interface (CGI)

The first widely used standard for producing dynamic content was the Common Gateway Interface (CGI). CGI uses standard operating system features, such as environment variables and standard input and output, to create a bridge, or gateway,between the web server and other applications on the host machine. The other applications can look at the request sent to them by the web server and create a customized response. When a web server receives a request that’s intended for a CGI program, it runs that program and provides the program with information from the incoming request. The CGI program runs and sends its output back to the server. The web server then relays the response to the browser. CGI defines a set of conventions regarding what information it will pass as environment variables and how it expects standard input and output to be used. Like HTTP, CGI is flexible and easy to implement, and a great number of CGI-aware

programs have been written. The main drawback to CGI is that it must run a new copy of the CGI-aware program for each request. This is a relatively expensive process that can bog down high-volume sites where thousands of requests are serviced per minute. Another drawback is that CGI programs tend to be platform dependent. A CGI program written for one operating system may not run on another.

3.2.3 Java servlets

Sun’s Jav a Servlet platform directly addresses the two main drawbacks of CGI programs.First, servlets offer better performance and utilization of resources than conventional CGI programs. Second, the write-once, run-anywhere nature of Java means that servlets are portable between operating systems that have a Java Virtual Machine (JVM).A servlet looks and feels like a miniature web server. It receives a request and renders a response. But, unlike conventional web servers, the servlet application programming interface (API) is specifically designed to help Java developers create dynamic applications.The servlet itself is simply a Java class that has been compiled into byte code,like any other Java object. The servlet has access to a rich API of HTTP-specific services,but it is still just another Java object running in an application and can leverage all your other Java assets.To give conventional web servers access to servlets, the servlets are plugged into containers. The servlet container is attached to the web server. Each servlet can declare what URL patterns it would like to handle. When a request matching a registered pattern arrives, the web server passes the request to the container, and the container invokes the servlet.But unlike CGI programs, a new servlet is not created for each request. Once the container instantiates the servlet, it will just create a new thread for each request. Java threads are much less expensive than the server processes used by CGI programs.Once the servlet has been created, using it for additional requests incursn very little overhead. Servlet developers can use the init() method to hold references to expensive resources, such as database connections or EJB Home Interfaces,so that they can be shared between requests. Acquiring resource s like these can take several seconds—which is longer than many surfers are willing to wait.The other edge of the sword is that, since servlets are multithreaded, servlet developers must take special care to be sure their servlets are thread-safe. To learn more about servlet programming, we recommend Java Servlets by Example, by Alan R. Williamson [Williamson]. The definitive source for Servlet information is the Java Servlet Specification [Sun, JST].

3.2.4 JavaServer Pages

While Java servlets are a big step up from CGI programs, they are not a panacea.To generate the response, developers are still stuck with using println statements to render the HTML. Code that looks like

out.println("

One line of HTML.

");

out.println("

Another line of HTML.

");

is all too common in servlets that generate the HTTP response. There are libraries that can help you generate HTML, but as applications grow more complex, Java developers end up being cast into the role of HTML page designers.Meanwhile, given the choice, most project managers prefer to divide development teams into specialized groups. They like HTML designers to be working on the presentation while Java engineers sweat the business logic. Using servlets alone encourages mixing markup with business logic, making it

difficult for team members to specialize.To solve this problem, Sun turned to the idea of using server pages to combine scripting and templating technologies into a single component. To build Java-Server Pages, developers start by creating HTML pages in the same old way, using the same old HTML syntax. To bring dynamic content into the page, the developer can also place JSP scripting elements on the page. Scripting elements are tags that encapsulate logic that is recognized by the JSP. You can easily pick out scripting elements on JSP pages by looking for code that begins with <% and ends with %>. For instance, to display the last modified date on the page, the developer would place the following code in the page:This page was accessed at <%= new Date() %>There are three different types of scripting elements: expressions, scriptlets, and declarations, as shown in table 1.1.

Table 1.1 JSP scripting elements

3.3 Enabling technologies 11

To be seen as a JSP page, the file just needs to be saved with an extension of .jsp.When a client requests the JSP page, the container translates the page into a source code file for a Java servlet and compiles the source into a Java class file—just as you would do if you were writing a servlet from scratch. At runtime, the container can also check the last modified date of the JSP file against the class file.If the JSP file has changed since it was last compiled, the container will retranslate and rebuild the page all over again.Project managers can now assign the presentation layer to HTML developers, who then pass on their work to Java developers to complete the business-logic portion. The important thing to remember is that a JSP page is really just a servlet. Anything you can do with a servlet, you can do with a JSP.

3.3.1JSP tags

Scripting elements are only one of the two ways to generate dynamic JSP content. Scriptlets are quick, easy, and powerful but require that developers mix Java code with HTML. Experience has taught us that embedding logic into JSP pages leads to

non-maintainable applications with minimal opportunity for reuse. A popular alternative is to use JSP tags.JSP tags are mixed in with the HTML markup and can be used as if they were ordinary HTML tags. A single JSP tag may represent dozens of Java statements, but all the developer needs to know is to how to insert the tag. The programming code is hidden away in a Java class file.To use the same code on another page, the developer only has to insert the tag markup again. If the code for the tag changes, all the tags will

automatically use the updated version.The JSP page using the tag does not need to be revised. JSP tags provide much better reuse than scriptlets and can be easier for page developers

JSPs vs. ASPs

Microsoft and Sun both offer their o wn brand of server pages. Sun offers JavaServer P ages and Microsoft offers Active Server P ages (ASP). Both JSP s and ASP s are designed so that developers can create dynamic web pages customized with back-office data. While similar on the surface, there are several di f ferenc es between ASP s and JSP s: _ JSP s are platform independent— write once, run anywhere. _ Developers have input to the direction of JSP s through the Java Community P rocess (JCP)._ JSP developers can extend the JSP tag set w ith custom tags. _ JavaBeans and E nterprise JavaBeans (EJB) can be used w ith JSP s to increase reusability and reduce maintenance. _ JSPs can access many other Java libraries, including Java Database Connectivity (JDBC), Java Mail, Java Message Servi c e (JMS), and Java Naming and Directory Interface (JNDI). _ JSP s are compiled into a binary class file and do not need to be interpreted for every request. _ JSP s find wide support w ith tool vendors, containers, and w eb servers. to use, since they look like the familiar HTML tags.A number of prebuilt JSP tags libraries are available that will perform useful functionality for developers. Among these is the new JSP Standard Tag Library (JSTL). This new standard provides a rich library of reusable JSP tags.For more on JSTL, we highly recommend JSTL in Action, by Shawn Bayern[Bayern]. Struts works well with JSTL and other publicly available tag libraries,as well as any you might write yourself.For more on JSP and JSP pages, we highly recommend Web Development with JavaServer Pages, by Duane K. Fields,Mark A. Kolb, and Shawn Bayern[Fields]. The definitive source for JSP information is the JavaServer Pages Specification [Sun, JSP].JSP pages are an integral part of the Struts dev eloper’s toolbox. Most Struts developers use JSP pages and custom tags to create all the dynamic content for their applications.

3.3.2JavaBeans

JavaBeans are Java classes which conform to a set of design patterns that make them easier to use with development tools and other components.

DEFINITION A JavaBean is a reusable software component written in Java. To qualify as a JavaBean, the class must be concrete and public, and have a noargument constructor. JavaBeans expose internal fields as properties by providing public methods that follow a consistent design pattern. Knowing that the property names follow this pattern, other Java classes are able to use introspection to discover and manipulate JavaBean properties. Rolling your own

1 Create a class that implements

jav ax.serv let.jsp.tagext.TagSupport

or jav ax.serv let.jsp.tagext.Body TagSupport by implementing the doStart() or doEnd() method.These methods obtain a JspWriter object to write out any valid HTML content you need.

2 Create a tag library descriptor (TLD) file to map the classes you just created to a JSP tag name.

3 Define your elements in the web application descriptor file (web.xml). Tell the JSP page that you will be using your tags by placing a @taglib statement at the top of the page:<%@taglib uri="/tags/app.tld pref ix="app" %>

4 This statement imports the library for use on this page and assigns it a tag prefi x. For more, see the JSP Tag Library technology page.

3.4 Enabling technologies 111

The JavaBean design patterns provide access to the bean’s internal state through two flavors of methods: accessors are used to read a JavaBean’s state; mutators are used to change a JavaBean’s state.Mutators are always prefixed with lowercase token set followed by the property name. The first character in the property name must be uppercase. The return value is always void—mutators only change property values; they do not retrieve them. The mutator for a simple property takes only one parameter in its signature,which can be of any type. Mutators are often nicknamed setters after their prefix.The mutator method signature for a weight property of the type Double would be public void setWeight(Double weight) A similar design pattern is used to create the accessor method signature. Accessor methods are always prefixed with the lowercase token get, followed by the property name. The first character in the property name must be uppercase. The return value will match the method parameter in the corresponding mutator.Accessors for simple properties cannot accept parameters in their method signature.Not surprisingly, accessors are often called getters.The accessor method signature for our weight property is public Double getWeight() If the accessor returns a logical value, there is a variant pattern. Instead of using the lowercase token get, a logical property can use the prefix is, followed by the property name. The first character in the property name must be uppercase. The return value will always be a logical value—either boolean or Boolean. Logical accessors cannot accept parameters in their method signature.The boolean accessor method signature for an on property would be public boolean isOn() The canonical method signatures play an important role when working with Java-Beans. Other components are able to use the Java Reflection API to discover a JavaBean’s properties by looking for methods prefixed by set, is, or get. If a component finds such a signature on a JavaBean, it knows that the method can be used to access or change the bean’s properties.Sun introduced JavaBeans to work with GUI components, but they are now used with every aspect of Java development, including web applications. When Sun engineers developed the JSP tag extension classes, they designed them to work with JavaBeans. The dynamic data for a page can be passed as a JavaBean,and the JSP tag can then use the bean’s properties to customize the output.For more on JavaBeans, we highly recommend The Awesome Power of JavaBeans,by Lawrence H. Rodrigues [Rodrigues]. The definitive source for JavaBean information is the JavaBean Specification [Sun, JBS].

Model 2

The 0.92 release of the Servlet/JSP Specification described Model 2 as an architecture that uses servlets and JSP pages together in the same application. The term Model 2 disappeared from later releases, but it remains in popular use among Java web developers.Under Model 2, servlets handle the data access and navigational flow, while JSP pages handle the presentation. Model 2 lets Java engineers and HTML developers each work on their own part of the application. A change in one part of a Model 2 application does not mandate a change to another part of the application. HTML developers can often change the look and feel of an application without changing how the back-office servlets work.The Struts framework is based on the Model 2 architecture. It provides a controller servlet to handle the navigational flow and special classes to help

with the data access. A substantial custom tag library is bundled with the framework to make Struts easy to use with JSP pages.

4 Struts from 30,000 feet

Hold on to your hats! Now that we’ve covered the basics, it’s time for a whirlwind tour of Struts. Before we try to get into the nuts and bolts of the framework components,let’s start with the big picture.Struts uses a Model 2 architecture. The Struts ActionServlet controls the navigational flow. Another Struts class, the Action, is used to access the business classes.When the ActionServlet receives a request from the container, it uses the URI (or “path”) to determine which Action it will use to handle the request. An Action can validate input and access the business layer to retrieve information from databases and other data services.To validate input or use the input to update a database, the Action needs to know what values were submitted. Rather than force each Action to pull these values out of the request, the ActionServlet bundles the input into a JavaBean.The input beans are subclasses of the Struts ActionForm class. The ActionServlet can determine which ActionForm to use by looking at the path of the request, in Struts from 30,000 feet 15 the same way the Action was selected. An ActionForm extends

org.apache.struts.action.ActionForm. Each HTTP request must be answered with an HTTP response. Usually, a Struts Action does not render the response itself but forwards the request on to another resource, such as a JSP page. Struts provides an ActionForward class that can be used to store the path to a page under a logical name. When it has completed the business logic, the Action selects and returns an ActionForward to the servlet. The servlet then uses the path stored in the ActionForward object to call the page and complete the response.Struts bundles these details together into an ActionMapping object. Each ActionMapping is related to a specific path. When that path is requested, the servlet retrieves the ActionMapping object. The mapping tells the servlet which Actions, ActionForms, and ActionForwards to use.All of these details, the Actions, ActionForms, ActionForwards, ActionMappings,and some other things, are declared in the

struts-config.xml file. The Action-Servlet reads this file at startup and creates a database of configuration objects. At runtime, Struts refers to the objects created with the configuration file, not the file itself. Figure 1.illustrates how these components fit together.Believe it or not, you already know enough about Struts to assemble a simple application. It won’t do much, but it will illus trate how Struts actually works.

Figure 1 Struts from 30,000 feet

Believe it or not, you already know enough about Struts to assemble a simple application. It won’t do much, but it will illustrate how Struts actually works.

Struts In Action

1 什么是struts (13)

2 谁创建了Struts (13)

2.1 为什么Struts 要开源 (13)

2.2 为什么叫Struts? (14)

3 什么是应用框架 (14)

3.1 其它类型的框架 (14)

3.2 使用的技术1 (14)

3.2.1 超文本传输协议(HTTP) (15)

3.2.2 公共网关接口(CGI) (15)

3.2.3 Java servlet (16)

3.2.4 JavaServer Pages (16)

3.3 使用的技术2 (17)

3.3.1 JSP标签 (17)

3.3.2 JavaBean (18)

3.4 使用的技术3 (18)

4 Struts从三万英尺激流而下 (19)

翻译:

1.什么是struts

Struts 是一个开源软件,有助于开发者更加快速和容易地建立Web 应用程序。Struts 依靠绝大多数开发者已熟知的标准技术—比如JavaBeans, Java servlet, 以及JavaServer Page (JSP)。通过基于标准的技术,“填空式”的软件开发方法,Struts 可以减轻在创建新项目时那些令人抱怨的极费时间的工作。

2.谁创建了Struts

Struts 是Apache 软件基金下Jakarta 项目子项目。除Struts 之外, Jakarta 还有其他成功的开源产品,包括Tomcat, Ant, 和Velocity。开始的代码基础从2000 年5 月开始开发,直到2001 年6 月,1.0 版本发布。有30 多个开发者参与进来,并有数千人参与到讨论组中。Struts 代码基础由一个志愿者团队来管理。到2002年,Struts 小组共有9 个志愿者参与。Struts 框架的主要架构设计和开发者是Craig R. McClanahan。Craig 也是Tomcat 4 的主要架构师,以及Java Web Services Developer Pack 的主要架构师和实现者。他现在是Sun 的JavaServer Faces (JSR-127) 的规范领导以及J2EE 平台的Web 层架构师。Struts 在Apache 软件许可[ASF, License]下对公众是免费的。使用此软件没有任何获得和再现成本。不象其他一些开源许可协议,Apache 软件许可对商业用途是友好的。你可以在你的商业项目中使用Struts,并自由分发Struts 库。你也可以将Struts 组件集成到你的框架中,就像他们是你自己编写的一样。

2.1 为什么Struts 要开源

现在有许多非常优秀Java 程序和框架都是开源项目。有许多的开发人员为这些项目工作,他们同时又在诸如IBM,Sun Microsystems,以及Apple 这样的公司从事其日常工作。这类软件的开发式协作有利于整个软件市场。今天,许多开源组件都集成到了商业产品之中。公司可以向其客户出售其专业的文档,保证支持服务水平,以及其他有价值的售后服务和增值服务。当软件是自由的时候,对市场来说它更容易得到支持。Struts 就是个典型例子虽然它还只是个很新的产品,也已经有很多文章和教程涉及到它,但却还没有什么象样的书籍。许多开发团队不喜欢使用不是自己内部开发的软件。开源组件提供了所有自行开发的软件的优点,但绝不会将你锁定在一个只有你们团队才懂的专有解决方案上。开源软件对所有人都是双赢的。

2.2 为什么叫Struts?

这个框架之所以叫“Struts”,是为了提醒我们记住那些支撑我们房屋,建筑,桥梁,甚至我们踩高跷时候的支撑。这也是一个对Struts 在开发Web 应用程序中所扮演的角色的精彩描述。当建立一个物理建筑时,建筑工程师使用支柱为建筑的每一层提供支持。同样,软件工程师使用Struts 为业务应用的每一层提供支持。

3.什么是应用框架

框架(framework)是可重用的,半成品的应用程序,可以用来产生专门的定制程序[Johnson]。象人一样,软件应用的相似性比不同点要多。它们运行在相似的机器上,期望从相同的设备输入信息,输出到相同的显示设备,并且将数据存储到相同的硬盘设备。开发传统桌面应用的开发人员更习惯于那些可以涵盖应用开发同一性的工具包和开发环境。构架在这些公共基础上的应用框架可以为开发人员提供可以为他们的产品提供可重用服务的基础架构。框架向开发人员提供一系列具有以下特征的骨架组件:

已经知道它们在其它程序上工作的很好;

它们随时可以在下一个项目中使用;

它们可以被组织的其它团队使用;

对于框架是典型的构建还是购买命题。如果你自己构建它,在你完成时你就会理解它,但是在你被融入之前又将花费多长时间呢?如果要购买,你必须得克服学习曲线,同样,在你可以用它进行工作之前又得花多长时间?这里没有所谓正确答案,但许多观察者都会同意,象Struts这样的框架能提供比从头开始开发更显著的投资回报,特别是对于大型项目来说。

3.1 其它类型的框架

框架的概念不仅用于应用程序也可用于组件。通过此书,我们也介绍其它可以和Struts 一起使用的框架。这些包括Lucene 搜索引擎,Scaffold 工具包,Struts 验证器,以及Tiles 标签库。与应用框架一样,这些工具也提供了一些半完成的版本,可以用在用户的定制组件之中。某些框架被限制于专门的开发环境中。Struts 以及本书中涉及的组件却不是这样。你可以在很多环境中来开发Struts: Visual Age for Java, JBuilder, Eclipse, Emacs, 甚至使用Textpad 。对于你的工具,如果你可以用来开发Java, 你就可以用它来开发Struts1。

3.2 使用的技术1

使用Struts 的应用开发使用了大量的其他基础技术。这些技术并不是专门针对Struts ,而是所有Java web 应用都可以使用的。开发者使用Struts 之类的框架是为了隐藏在诸如HTTP,CGI,以及JSP 之类技术后面的繁琐的细节。作为一个Struts 开发者,你并不需要知晓所有的相关知识,但是这些基本技术的工作原理可能有助于你针对棘手问题设计出创造性的方案。

3.2.1 超文本传输协议(HTTP)

当两个国家之间进行调解时,外交官们总是遵循一定的正式协议。外交协议主要设计来避免误解,以及防止谈判破裂。同样,当计算机间需要对话,它们也遵循一个正式的协议。这个协议定义数据是如何传输,以及它们到达后如何进行解码。Web 应用程序就是使用HTTP 协议在运行浏览器的计算机和运行的服务器的程序间传输数据。很多服务器应用程序使用HTTP 之外的其他协议。他们在计算机之间维护一个持久性的连接。应用服务器可以清楚的知道是谁连接上来,而且何时中断连接。因为它们知道每一个连接的状态,以及每一个使用它的人。这称之为状态协议。相反,HTTP 是一个无状态协议。HTTP Server 可以接受来自于各种客户的各种请求,并提供各种响应,即使是这个响应仅仅是说No。没有大量的协商和连接持久性,无状态协议可以处理大量的请求。这也是Internet 可以扩展到很多计算机的原因。HTTP 成为通用标准的原因是其简单性。HTTP 请求看起来就像一个平常的文本文档。这使应用程序很容易创建HTTP 请求。你甚至可以通过标准的程序如Telnet 来手动传递一个HTTP请求。当HTTP 响应返回时,它也是一个开发者可以直接阅读的平面文本。HTTP 请求的第一行包含方法,其后是请求的来源地址和HTTP 版本。HTTP 请求头跟在首行后面,可以没有也可以有多个。HTTP 头向服务器提供额外的信息。可以包括浏览器的种类和版本,可接受的文档类型,浏览器的cookies 等等。7 种请求方法中,GET 和POST 是用得最多的。一旦服务器接收到请求,它就要产生一个HTTP 响应。响应的第一行称为状态行,包含了HTTP协议的版本,数字型状态,以及状态的简短描述。状态行后,服务器将返回一个HTTP 响应头,类似于HTTP 请求头。如上所述,HTTP 并不在请求间保持状态信息。服务器接受请求,发出响应,并且继续愉快地处理文本请求。因为简单和效率,无状态协议不适合于需要跟踪用户状态的动态应用。Cookies 和URL 重写是两个在请求间跟踪用户状态的方式。cookie 是一种特殊的信息包,存储于用户的计算机中。URL 重写是在页面地址中存储一个特殊的标记,Java 服务器可以用它来跟踪用户。这两种方法都不是无缝的,是用哪一个都意味着在开发时都要进行额外的工作。对其本身来说,标准的HTTP web 服务器并不传输动态内容。它主要是使用请求来定位文件资源,并在响应中返回此资源。通常这里的文件使用Hypertext Markup Language (HTML) [W3C,HTML] 格式化,以使浏览器可以显示它们。HTML 页面通常包含一些到其他页面的超文本连接,也可以显示其他一些内容比如图像和视频等等。用户点击连接将产生另一个请求,就开始一个新的处理过程。标准web 服务器处理静态内容处理得很好,但处理动态内容时则需要额外的帮助手段了。

定义静态内容直接来自于文本或数据文件,比如HTML 或者JPEG 文件。这些文件可以随时改变,但通过浏览器请求时,却不能自动改变。相反,动态内容是临时产生的,典型地,它是针对浏览器的个别请求的响应。

3.2.2 公共网关接口(CGI)

第一个普遍用来产生动态内容的标准是通用网关接口(Common Gateway Interface (CGI))。CGI 使用标准的操作系统特征,比如环境变量和标准输入输出,在Web 服务器间以及和主机系统间创建桥接和网关。其他程序可以看到web server 传递过来的请求,并创建一个定制的响应。当web 服务器接收到一个对CGI 程序的请求时,它便运行这个程序并向其提供它请求里面所包含的信息。CGI 程序运行,并将输出返回给Web server,web server 则将输出响应给浏览器。CGI 定义了一套关于什么信息将作为环境变量传递,以及

它希望怎样使用标准输入和输出的惯例。与HTTP 一样,CGI 是灵活和易于实现的,并且已经有大量现成的CGI 程序。CGI 的主要缺点是它必须为每个请求运行一个程序。这是一个相对昂贵的处理方法,对大容量站点来说,每分钟有数千个请求,有可能使站点瘫痪。CGI 程序的另一个缺点是平台依赖性,一个平台上开发的程序不一定在另一个平台上能运行。

3.2.3 Java servlet

Sun 公司的Java Servlet 平台直接解决了CGI 程序的两个主要缺点。首先,servlet 比常规CGI 程序提供更好的性能和资源利用。其次,一次编写,随处运行的JAVA特性意味着servlet 在有JVM 的操作系统间是轻便的可移动的。Servlet 看起来好像是一个微小的web server。它接受请求并产生响应。但,和常规web server不同,servlet API 是专门设计来帮助Java 开发人员创建动态应用的。Servlet 本身是要编译成字节码的Java 类,就像其他Java 对象一样。Servlet 访问HTTP 特定服务的API,但它仍然是一个运行于程序之中的Java 对象,并可以利用所有的Java 资产。为了使常规web servers 能访问servlet,servlet 被安插在一个容器之中。Servlet 容器连接到Web 服务器。每个servlet 都可以声明它可以处理何种样式的URL。当符合所注册样式的请求到达,web server 将请求传递给容器,容器则调用响应的servlet。但和CGI 程序不同,并不是针对每个请求都要创建一个新的servlet。一旦容器实例化了一个servlet,它就仅为每个新的请求创建一个新的线程。Java 线程可比使用CGI 程序的服务器处理开销小多了。一旦servlet 被创建,使用它处理额外的请求仅带来很小的额外开销。Servlet 开发人员可以使用init() 方法保持对昂贵资源的引用,比如到数据库或者EJB Home 接口的连接,以便它们可以在不同的请求之间进行共享。获得这些资源要耗费数秒时间,这比大多数冲浪者愿意等的时间要长些。Servlet 的另一个好处是,它是多线程的,servlet 开发人员必须特别注意确保它们的servlet是线程安全的。学习servlet 编程,我们推荐Java Servlets by Example, 作者Alan R.Williamson[Williamson]。

3.2.4 JavaServer Pages

虽然servlets 对CGI 程序来说前进了一大步,但它也不是万能灵药。为了产生响应,开发人员不得不使用大量的println 语句来生成HTML。比如这样的代码

out.println("

One line of HTML.

");

out.println("

Another line of HTML.

");

在产生HTTP 响应的Servlet 中是很普遍的。也有一些库有助于你产生HTML。随着应用越来越复杂,Java 开发人员将不再扮演HTML 页面设计的角色。同时,大多数项目经理更喜欢将团队分成不同的小组。它们喜欢HTML 设计人员处理表现层的工作,而Java 工程师则专注于业务逻辑。单独使用servlet 的做法鼓励混合标记和业务逻辑,很难区分团队人员的专业工作。为解决这个问题,Sun 提出了一个将脚本和模板技术结合到一个组件中的服务器页面技术(JavaServer Pages)。为创建JSP 页面, 开发者按创建HTML 页面类似的方式创建页面,使用相同的HTML 语法。为将动态内容引入页面,开发人员可以将脚本元素置入页面之中。脚本元素是一些标记,封装了可以被JSP 识别的逻辑。你可以在JSP 页面中很容易的识别出脚本元素,他们被封装在一对<% 和%>标记中。例如,要显示页面的最后修改日期,开发人员可以将以下代码放入页面中:This page was accessed at <%= new Date() %>有三种不同的脚本元素:表达式,脚本小程序和声明。如表1

所示:

3.3 使用的技术2

为了识别JSP 页面,文件需要保存为扩展名.jsp。当一个客户请求JSP 页面时,容器将页面翻译成Java servlet 源代码文件,并将它编译成Java 类文件--就象你写的servlet 文件一样。在运行时,容器也能检测JSP 文件和相应的类的最后更新时间。如果,JSP 文件自上次编译以来被修改了,容器将重新翻译和编译JSP 文件。项目经理现在可以将表现层分派给HTML 开发人员,将业务逻辑工作分派给JAVA 开发人员。重要的是记住,JSP 页面事实上是一个servlet。你可以在servlet 做的,也可以在JSP 中做。

3.3.1JSP标签

脚本元素仅是两种产生动态内容的方式之一。Scriptlet 是快捷、简单、强大的手段但要求开发者在HTML 中混合Java 代码。经验告诉我们,混合业务逻辑到JSP 页面中将导致难以维护的应用和最小的可重用性。一个可选的方案是使用JSP 标签(tags)。JSP 标签可以和HTML 标记混合使用,就如同它们是原生HTML 标记一样。一个JSP 标签可以代表许多Java 语句,但是所有的开发者都需要了解如何在页面中插入标记。源代码隐藏在Java 类文件之中。

JSP和ASP

Microsoft 和Sun 都提供它们各自品牌的服务器页面。Sun提供JavaServer Pages (JSP)而Microsoft 提供ActiveServer Pages (ASP)。JSP 和ASP 都设计来能够使开发者能从后端系统产生动态页面。虽然表面看起来相似,ASP 和JSP仍有一些不同之处:

●JSP 是平台独立性的,一次编写,随处运行;

●开发者通过Java Community Process(JCP)指引方向;

●JSP 开发者可以通过定制标签扩展JSP标标签库;

●JavaBeans 和Enterprise JavaBeans (EJB) 可以和JSP一起使用,增强可重用性和减

小维护。

●JSP 可以存取其他一些Java 库,包括Java 数据库连接(JDBC),Java Mail,Java

MessageService(JMS),以及JNDI。

●JSP 编译成二进制类文件,不需要在每次请求时进行解释;

●JSP 有广泛的支持。包括工具,容器和服务器;

为在其他页面中使用同一代码,只需要在该页面中重新插入相同的标签。如果标签代表的代码改变了,所有的标签都将使用更新的版本。而使用标签的JSP 页面并不需要进行修订。JSP 标记比scriplet 提供了更好的可重用性,也更易被页面设计者使用,因为它们看起来很象HTML 标记。有大量的现成的JSP 标签库(tags libraries)可用,他们完成很多有用的

功能。其中就有新的JSP 标准标签库(JSTL)。这是一个新的标准,提供丰富的可重用的JSP 标签库。关于JSTL 的详细情况,我们高度推荐《JSTL in Action》,作者Shawn Bayern [Bayern]。Struts可以很好的和JSTL 以及其他公开标签库一起使用,甚至是你自己写的标签库。关于JSP 的详细内容,我们强烈推荐《Web Development with JavaServer Pages》,作者Duane K.Fields,Mark A. Kolb, 和Shawn Bayern[Fields]。JSP 是Struts 开发者工具箱的一部分。大多数Struts 开发者使用JSP 和定制标记来创建应用的动态内容。

3.3.2JavaBean

JavaBean 是一种Java 类,它遵从一定的设计模式,使它们易于和其他开发工具和组件一起使用。

定义JAVABEAN 是一种JAVA 语言写成的可重用组件。要编写JAVABEAN,类必须是具体类和公共类,并且具有无参数的构造器NON-ARGS CONSTRUCTOR)。JAVABEAN 通过提供符合一致性设计模式的公共访问方法将内部字段暴露称为属性。众所周知,属性名称也符合这种模式,其他JAVA 类可以通过自省机制发现和操作这些JAVABEAN 属性。

1 编写一个类,通过实现doStart()或者doEnd()方法来实现

javax.servlet.jsp.tagext.TagSupport 或者javax.servlet.jsp.tagext.BodyTagSupport 接口。这些方法获得一个JspWriter 对象,你可以用它来输出你需要的HTML 内容。

2 创建一个标签库描述文件(TLD)来将你的新建的类,映射到一个标签名称。

3 在你的Web 应用描述符(web.xml)中定义你的 元素。通过在JSP 页面的顶部

放置下面的语句:<%@tagliburi="/tags/app.tld prefix="app" %> 来告诉JSP 页面你将使用你自己的标签库。

4 这个语句导入将在本页中使用的标签库,并分配给它一个前缀。

3.4 使用的技术3

在使用JavaBean 时,规范的方法体签名扮演了极为重要的角色。其他组件可以使用Java 的反射API 通过查找前缀为set, is, 或者get 的方法来发现JavaBean 的属性。如果一个组件在一个JavaBean 中发现一个这样的方法,它就知道这个方法可以用来访问或者改变JavaBean 的属性。Sun 引入JavaBean 是为了用于GUI 组件,但它们已经用在Java 开发的各个方面,包括Web应用。Sun 的工程师在开发JSP 标签的扩展类时,也被设计来可以和JavaBean 一起工作。一个页面的动态数据可以使用一个JavaBean 来传递,并且JSP 标记可以随后使用bean 的属性来定制页面的输出。

Model 2

Servlet/JSP 规范的0.92 版描述了在一个应用中使用servlet 和JSP 的架构。在其后的规范中,Model 2 这个叫法消失了,但它已经在Java web 开发人员中非常通用了。根据Model 2,servlet 处理数据存取和导航流,JSP 处理表现。Model 2 使Java 工程师和HTML 设计者分别工作于它们所擅长和负责的部分。Model 2 应用的一部分发生改变并不强求其他部分也跟着发生改变。HTML 开发人员可以改变程序的外观和感觉,并不需要改变后端servlet 的工作方式。Struts 框架是基于Model 2 的架构。它提供一个控制器servlet 来处理导航流和一些特殊类来帮助数据访问。随框架也提供一个丰富的标签库,以使Struts 易于和JSP 一起使用。

4.Struts从三万英尺激流而下

抓紧你的帽子!既然我们已经讲了一些基本知识,我们现在可以进行一个Struts 的飞速之旅了。在我们打开盒子吃到果子之前,我们先了解一个大概模样。Struts 使用Model 2 架构。Struts 的ActionServlet 控制导航流。其他Struts 类,比如Action,用来访问业务逻辑类。当ActionServlet 从容器接收到一个请求,它使用URI (或者路径“path”)来决定那个Action 将用来处理请求。一个Action 可以校验输入,并且访问业务层以从数据库或其他数据服务中检索信息。为校验输入或者使用输入来更新数据库,Action 需要知道什么值被提交上来。它并不是强制每个Action 都要从请求中抓取这些值,而是由ActionServlet 将输入绑定到JavaBean 中。输入bean 是Struts ActionForm 类的子类。ActionServlet 通过查找请求的路径可以决定使用哪个ActionForm ,Action 也是通过同样的方法选取的。ActionForm 扩展了org.apache.struts.action.ActionForm 类。每个请求都必须以HTTP 响应进行应答。通常,Struts Action 并不自行渲染响应信息,而是将请求转发到其他资源,比如JSP 页面。Struts 提供一个ActionForward 类,用来将一个页面的路径保存为逻辑名称。当完成业务逻辑后,Action 选择并向Servlet 返回一个ActionForward。Servlet 然后使用保存在ActionForward 对象中的路径来调用页面完成响应。Struts 将这些细节都绑定在一个ActionMapping 对象中。每个ActionMapping 相对于一个特定的路径。当某个路径被请求时,Servlet 就查询ActionMapping 对象。ActionMapping 对象告诉servlet,哪些个Action,ActionForm,和ActionForward 将要被本次请求使用。所有这些细节,关于Action,ActionForm,ActionForward,ActionMapping,以及其它一些东西,都在struts-config.xml 文件中定义。ActionServlet 在启动时读取这个配置文件,并创建一个配置对象数据库。在运行时,Struts 应用根据文件创建的配置对象,而不是文件本身。

图1显示了这些组件是如何一起工作的。

图1 Struts 组件

不管你相信与否,你已经知道了足够的东西,可以构造一个简单的Struts 应用了。它并不需要做很多工作,但它显示了Struts 实际是如何工作的。

科技外文文献译文

流动的:一个快速的,多平台的开放源码的同步化多媒体整合语言唱机Dick C.A. Bulterman, Jack Jansen, Kleanthis Kleanthous, Kees Blom and Daniel Benden CWI: Centrum voor Wiskunde en Informatica Kruislaan 413 1098 SJ Amsterdam, The Netherlands +31 20 592 43 00 Dick.Bulterman@cwi.nl 摘要: 本文概述了一个出现在早期的流动性的同步化多媒体唱机。不同于其它同步化的实现,早期的播放器是一个可重组的同步化引擎,可以定制作为一个实验媒体播放器的核心。同步化唱机是一个引用了同步化多媒体引擎并可以集成在一个广泛的媒体播放器的项目。本文是以我们要创造一个新的同步化引擎为动机的综述开始的。然后论述的是早期媒体播放器的核心架构(包括可扩展性,播放器自定义的集成装置)。我们以一个关于我们在windows,Mac,Linux版本应用于台式机以及PDA设备上实施流动性例子的体验的讨论结束。 类别和主题描述符: H.5.2 多媒体的信息系统。 H.5.4 超级文本/超级媒体。 一般词汇: 试验,性能,验证。 关键词: 同步化多媒体整合语言,唱机,公开源代码,演示。 1.动机: 早期公开的同步化媒体播放器是一个非常有特色的公开源代码的同步化 2.0播放器,它以研究团体的意图被使用(在我们的研究团体内外)目的是为了研究项目的团体在需要源代码的时候可以访问生产特性的同步化播放器的网站。它也被用作一个独立的不需要专有的媒体格式的同步化播放器使用,播放器支持一系列同步化2.0配置文件(包括台式机和移动的配置)可以被分配利用在Linux,Macintosh,windows系统的台式机,PDA设备和掌上电脑。 同时现存的几个同步化播放器,包括网络视频播放软件,IE浏览器,小型同步化播放器, GRiNS ,X- GRiNS ,以及各种各样专有移动设备,我们发展流动性唱机有三个原因: 准许制作数字以及个人或者课堂使用中的的全部硬拷贝即时没有提供拷贝权限或者商业性的利益分摊,而且在第一页有这种拷贝的注意事项。服务器上有关于复制以及翻版的分发列表的通知。需要事先明确具体的许可权以及费用。 'MM’04, October 10-16, 2004, New Y ork, New Y ork, USA. Copyright 2004 ACM 1-58113-893-8/04/0010...$5.00. 现有的同步化播放器没有提供一个完整同步化2.0播放器的正确实现。早期的播放器所有的同步化工具,是以同步化2.0语言的属性为基础加上扩展功能能够支持高级的动画以及规范可移动设备以3GPP/PSS-6同步化使用. 所有的同步化播放器都是针对商业SMIL表达专有媒介。早期的播发器使用开源的媒体解码器和开源的网络传输协议,以便播放器可以轻松定制广泛的使用范围的研究计划。 我们的目标是建立一个鼓励发展类似的多媒体研究输出的平台,,我们期望的是一个标准的基线播放器的供给,其他研究人员和开发机构可以集中精力到基线播放器的集成扩展(从新媒体的解码器或新的网络控制算法任何一个中)。这些扩展可以在其它的平台上被共享。 在2004年中期,与螺旋形客户机对照,同时移动到一个GPL核心,早期的播放器支持一个广阔的范围的同步化应用指标构架,它提供了一个准确实现的更完整的同步化语言,它在低资源配置下提供了更好的性能,提供了更多可扩展的媒体播放器架构。它也提供了一个包含所有媒体解码作为部分开放的客户基础。

英文文献及中文翻译

毕业设计说明书 英文文献及中文翻译 学院:专 2011年6月 电子与计算机科学技术软件工程

https://www.doczj.com/doc/509830839.html, Overview https://www.doczj.com/doc/509830839.html, is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of https://www.doczj.com/doc/509830839.html, is part of https://www.doczj.com/doc/509830839.html, Framework,and when coding https://www.doczj.com/doc/509830839.html, applications you have access to classes in https://www.doczj.com/doc/509830839.html, Framework.You can code your applications in any language compatible with the common language runtime(CLR), including Microsoft Visual Basic and C#.These languages enable you to develop https://www.doczj.com/doc/509830839.html, applications that benefit from the common language runtime,type safety, inheritance,and so on. If you want to try https://www.doczj.com/doc/509830839.html,,you can install Visual Web Developer Express using the Microsoft Web Platform Installer,which is a free tool that makes it simple to download,install,and service components of the Microsoft Web Platform.These components include Visual Web Developer Express,Internet Information Services (IIS),SQL Server Express,and https://www.doczj.com/doc/509830839.html, Framework.All of these are tools that you use to create https://www.doczj.com/doc/509830839.html, Web applications.You can also use the Microsoft Web Platform Installer to install open-source https://www.doczj.com/doc/509830839.html, and PHP Web applications. Visual Web Developer Visual Web Developer is a full-featured development environment for creating https://www.doczj.com/doc/509830839.html, Web applications.Visual Web Developer provides an ideal environment in which to build Web sites and then publish them to a hosting https://www.doczj.com/doc/509830839.html,ing the development tools in Visual Web Developer,you can develop https://www.doczj.com/doc/509830839.html, Web pages on your own computer.Visual Web Developer includes a local Web server that provides all the features you need to test and debug https://www.doczj.com/doc/509830839.html, Web pages,without requiring Internet Information Services(IIS)to be installed. Visual Web Developer provides an ideal environment in which to build Web sites and then publish them to a hosting https://www.doczj.com/doc/509830839.html,ing the development tools in Visual Web Developer,you can develop https://www.doczj.com/doc/509830839.html, Web pages on your own computer.

科技文本的翻译

(一)科技英语特点和翻译原则 科技文本:科学专着、科学论文、科学报道、试验报告、技术规范、工程技术说明、科技文献以及科普读物等。 科技文本的特点:用词非常严谨,行文规范,注重客观;描述平易,一般不带感情色彩;准确,正式,逻辑严密。 1. 科技英语的词汇。 i. 普通词汇 ii.半专业词汇 半专业词所表达的意义根据不同的学科内容而定 .:1. pencil 光学中:光纤锥,射束 机械中:metal pencil 焊条 2. concentration

1)Electrode potential depends on the concentration of the irons.(浓度) 2) A concentration process is important now that the depletion of high grade ores is possible. (富集) iii.专业词汇 i.词义专一,构成呈多样化,前后词缀,如:auto-, a-, semi-,micro-等。 ii.外来词多 2.科技英语中长句较多, 汉译英时注意拆分 科技英语重表示某些复杂概念时用的长复合句大大多于一般英 语。长句特点是从句和短语多,同时兼有并列结构或省略,倒装顺序,结构显得复杂。但其所表达的科技内容严密性、准确性和逻辑性较强。 见4. . 3.科技英语专业术语性强,汉译英是强调术语翻译的正确性。 专业术语语义具有严谨性和单一性 平时阅读与所译材料同类的英文材料 给概念以约定俗成的译名 .:药品的“保存期”是“shelf life”而不是“storage period” 肺活量是“vital capacity”而不是“lung capacity” 科技英语重缩略语情况也比较多,需勤查相关专业词典或参考书,采用公认的缩略形式。

论文翻译网站

开题报告、文献检索账号、文献综述、外文翻译、抄袭检测软件、论文目录,都在这了都在这了,有备无患,拿去吧!! 开题报告、文献综述、外文翻译、论文反抄袭软件、论文目录,就差论文正文了,其他都全了!! 开题报告主要包括以下几个方面: (一)论文名称 论文名称就是课题的名字 第一,名称要准确、规范。准确就是论文的名称要把论文研究的问题是什么,研究的对象是什么交待清楚,论文的名称一定要和研究的内容相一致,不能太大,也不能太小,要准确地把你研究的对象、问题概括出来。 第二,名称要简洁,不能太长。不管是论文或者课题,名称都不能太长,能不要的字就尽量不要,一般不要超过20个字。 (二)论文研究的目的、意义 研究的目的、意义也就是为什么要研究、研究它有什么价值。这一般可以先从现实需要方面去论述,指出现实当中存在这个问题,需要去研究,去解决,本论文的研究有什么实际作用,然后,再写论文的理论和学术价值。这些都要写得具体一点,有针对性一点,不能漫无边际地空喊口号。主要内容包括:⑴研究的有关背景(课题的提出):即根据什么、受什么启发而搞这项研究。⑵通过分析本地(校)的教育教学实际,指出为什么要研究该课题,研究的价值,要解决的问题。 (三)本论文国内外研究的历史和现状(文献综述)。 规范些应该有,如果是小课题可以省略。一般包括:掌握其研究的广度、深度、已取得的成果;寻找有待进一步研究的问题,从而确定本课题研究的平台(起点)、研究的特色或突破点。 (四)论文研究的指导思想 指导思想就是在宏观上应坚持什么方向,符合什么要求等,这个方向或要求可以是哲学、政治理论,也可以是政府的教育发展规划,也可以是有关研究问题的指导性意见等。 (五)论文写作的目标 论文写作的目标也就是课题最后要达到的具体目的,要解决哪些具体问题,也就是本论文研究要达到的预定目标:即本论文写作的目标定位,确定目标时要紧扣课题,用词要准确、精练、明了。

步进电机及单片机英文文献及翻译

外文文献: Knowledge of the stepper motor What is a stepper motor: Stepper motor is a kind of electrical pulses into angular displacement of the implementing agency. Popular little lesson: When the driver receives a step pulse signal, it will drive a stepper motor to set the direction of rotation at a fixed angle (and the step angle). You can control the number of pulses to control the angular displacement, so as to achieve accurate positioning purposes; the same time you can control the pulse frequency to control the motor rotation speed and acceleration, to achieve speed control purposes. What kinds of stepper motor sub-: In three stepper motors: permanent magnet (PM), reactive (VR) and hybrid (HB) permanent magnet stepper usually two-phase, torque, and smaller, step angle of 7.5 degrees or the general 15 degrees; reaction step is generally three-phase, can achieve high torque output, step angle of 1.5 degrees is generally, but the noise and vibration are large. 80 countries in Europe and America have been eliminated; hybrid stepper is a mix of permanent magnet and reactive advantages. It consists of two phases and the five-phase: two-phase step angle of 1.8 degrees while the general five-phase step angle of 0.72 degrees generally. The most widely used Stepper Motor. What is to keep the torque (HOLDING TORQUE) How much precision stepper motor? Whether the cumulative: The general accuracy of the stepper motor step angle of 3-5%, and not cumulative.

小议科技英语翻译技巧

小议科技英语翻译技巧 科技文体崇尚严谨周密,概念准确,逻辑性强,行文简练,重点突出,句式严整,少有变化,常用前置性陈述,即在句中将主要信息尽量前置,通过主语传递主要信息。科技文章文体的特点是:清晰、准确、精练、严密。那末,科技文章的语言结构特色在翻译过程中如何处理,这是进行英汉科技翻译时需要探讨的问题。现分述如下: 一、大量使用名词化结构 大量使用名词化结构(Nominalization)是科技英语的特点之一。因为科技文体要求行文简洁、表达客观、内容确切、信息量大、强调存在的事实。而非某一行为。 Archimedes first discovered the principle of displacement of water by solid bodies. 阿基米德最先发展固体排水的原理。 句中of displacement of water by solid bodies 系名词化结构,一方面简化了同位语从句,另一方强调displacement 这一事实。 The rotation of the earth on its own axis causes the change from day to night. 地球绕轴自转,引起昼夜的变化。 名词化结构the rotation of the earth on its own axis 使复合句简化成简单句,而且使表达的概念更加确切严密。 If you use firebricks round the walls of the boiler, the heat loss, can be considerably reduced. 炉壁采用耐火砖可大大降低热耗。 科技英语所表述的是客观规律,因之要尽量避免使用第一、二人称;此外,要使主要的信息置于句首。 Television is the transmission and reception of images of moving objects by radio waves. 电视通过无线电波发射和接受活动物体的图象。 名词化结构the transmission and reception of images of moving objects by radio waves 强调客观事实,而"谓语动词则着重其发射和接受的能力。 二、广泛使用被动语句 根据英国利兹大学John Swales 的统计,科技英语中的谓语至少三分之一是被动态。这是因为科技文章侧重叙事推理,强调客观准确。第一、二人称使用过多,会造成主观臆断的印象。因此尽量使用第三人称叙述,采用被动语态,例如:Attention must be paid to the working temperature of the machine.应当注意机器的工作温度。而很少说:You must pay attention to the working temperature of the machine .你们必须注意机器的工作温度。此外,如前所述,科技文章将主要信息前置,放在主语部份。这也是广泛使用被动态的主要原因。试观察并比较下列两段短文的主语。 We can store electrical energy in two metal plates separated by an insulating medium. We call such a device a capacitor, or a condenser, and its ability to store electrical energy capacitance .It is measured in farads. 电能可储存在由一绝缘介质隔开的两块金属极板内。这样的装置称之为电容器,

英文科技文献及翻译

外文翻译 DC GENENRATORS 1. INTRODUCTION For all practical purposes, the direct-current generator is only used for special applications and local dc power generation. This limitation is due to the commutator required to rectify the internal generated ac voltage, thereby making largescale dc power generators not feasible. Consequently, all electrical energy produced commercially is generated and distributed in the form of three-phase ac power. The use of solid state converters nowadays makes conversion to dc economical. However, the operating characteristics of dc generators are still important, because most concepts can be applied to all other machines. 2. FIELD WINDING CONNECTIONS The general arrangement of brushes and field winding for a four-pole machine is as shown in Fig.1. The four brushes ride on the commutator. The positive brusher are connected to terminal A1 while the negative brushes are connected to terminal A2 of the machine. As indicated in the sketch, the brushes are positioned approximately midway under the poles. They make contact with coils that have little or no EMF induced in them, since their sides are situated between poles. Figure 1 Sketch of four-pole dc matchine The four excitation or field poles are usually joined in series and their ends brought out to terminals marked F1 and F2. They are connected such that they produce north and south poles alternately. The type of dc generator is characterized by the manner in which the field

PLC论文中英文对照资料外文翻译文献

PLC论文中英文对照资料外文翻译文献 外文资料: PLC technique discussion and future development Along with the development of the ages, the technique that is nowadays is also gradually perfect, the competition plays more more strong; the operation that list depends the artificial has already can't satisfied with the current manufacturing industry foreground, also can't guarantee the request of the higher quantity and high new the image of the technique business enterprise. The people see in produce practice, automate brought the tremendous convenience and the product quantities for people up of assurance, also eased the personnel's labor strength, reduce the establishment on the personnel. The target control of the hard realization in many complicated production lines, whole and excellent turn, the best decision etc., well-trained operation work, technical personnel or expert, governor but can judge and operate easily, can acquire the satisfied result. The research target of the artificial intelligence makes use of the calculator exactly to carry out, imitate these intelligences behavior, moderating the work through person's brain and calculators, with the mode that person's machine combine, for resolve the very complicated problem to look for the best path We come in sight of the control that links after the electric appliances in various situation, that is already the that time generation past, now of after use in the mold a perhaps simple equipments of grass-roots control that the electric appliances can do for the low level only;And the PLC emergence also became the epoch-making topic, adding the vivid software control through a very and stable hardware, making the automation head for the new high tide. The PLC biggest characteristics lie in: The electrical engineering teacher already no longer electric hardware up too many calculationses of cost, as long as order the importation that the button switch or the importation of the sensors order to link the PLC up can solve problem, pass to output to order the conjunction contact machine or control the start equipments of the

电子 电流 外文翻译 外文文献 英文文献 高度稳压直流电源

高精度稳压直流电源 文摘:目前对于可调式直流电源的设计和应用现在有很多微妙的,多种多样的,有趣的问题。探讨这些问题(特别是和中发电机组有关),重点是在电路的经济适用性上,而不是要达到最好的性能。当然,对那些精密程度要求很高的除外。讨论的问题包括温度系数,短期漂移,热漂移,瞬态响应变性遥感和开关preregualtor型机组及和它的性能特点有关的的一些科目。 介绍 从商业的角度来看供电领域可以得到这样一个事实,在相对较低的成本下就可以可以获得标准类型的0.01%供电调节。大部分的供电用户并不需要这么高的规格,但是供应商不会为了减少客户这么一点的费用而把0.1%改成0.01%。并且电力供应的性能还包括其他一些因素,比如说线路和负载调解率。本文将讨论关于温度系数、短期漂移、热漂移,和瞬态的一些内容。 目前中等功率直流电源通常采用预稳压来提高功率/体积比和成本,但是只有某些电力供应采用这样的做法。这种技术的优缺点还有待观察。 温度系数 十年以前,大多数的商业电力供应为规定的0.25%到1%。这里将气体二极管的温度系数定位百分之0.01[1]。因此,人们往往会忽视TC(温度系数)是比规定的要小的。现在参考的TC往往比规定的要大的多。为了费用的减少,后者会有很大的提高,但是这并不是真正的TC。因此,如果成本要保持在一个低的水平,可以采用TC非常低的齐纳二极管,安装上差动放大电路,还要仔细的分析低TC绕线电阻器。 如图1所示,一个典型的放大器的第一阶段,其中CR1是参考齐纳二极管,R是输出电位调节器。

图1 电源输入级 图2 等效的齐纳参考电路 假设该阶段的输出是e3,提供额外的差分放大器,在稳定状态下e3为零,任何参数的变化都会引起输出的漂移;对于其他阶段来说也是一样的,其影响是减少了以前所有阶段的增益。因此,其他阶段的影响将被忽略。以下讨论的内容涵盖了对于TC整体的无论是主要的还是次要的影响。 R3的影响 CR1-R3分支的等效的电路如图2所示,将齐纳替换成了它的等效电压源E'和内部阻抗R2。对于高增益调节器,其中R3的变化对差分放大器的输入来说可以忽略不计,所以前后的变化由R3决定。 如果进一步假定IB << Iz;从(1)可以得到 同时,

科技文献翻译电子档答案

科技文献翻译电子档答案

科技文献翻译考试试题 1.大型飞机自动化装配技术 摘要:本文简述了大型飞机及其结构特点,通过比较人与机器两种装配系统的特性,分析装配自动化水平与装配成本等诸多因素的关系曲线,指出了自动化装配技术在保证大型飞机长寿命、高效率、低成本研制和生产等方面的意义;对外国大型飞机的装配自动化发展状况进行了综述,简要分析了国外发展的几种主要自动化装配系统,总结了国外大型飞机的自动化装配水平;对西方国家在大型飞机自动化装配中采用的先进的装配理念和方法,如决定性装配方法等进行了概述。最后针对国内自动化装配水平低的现状和大型飞机研制和生产的需求,提出了发展模块化结构的自动化装配系统、贯彻并行工程理念实现面向制造和面向装配的设计等发展建议。 关键词:自动化装配;大型飞机;长寿命;柔性装配;模块化;决定性装配 1. Automatic Assembly Technology for Large Aircraft Abstract: This paper aims at the large

assembly system, carrying out the means of concurrent engineering and realizing the designs for manufacturing and assembly. Key words: automatic assembly; large aircraft; long life; flexible assembly; modularization; determinant assembly 2.基于SAT的快速电路时延计算 摘要:针对现有的基于时间展开电路求解时延算法在电路规模较大或者时延模型精度较高时效率较低的问题,提出一种基于子电路抽取的电路时延计算方法。基于展开电路,通过分析输出端约束找到相关的输出端,利用回溯抽取与这些输出端相关的逻辑锥子电路,并在子电路而不是在展开电路上进行求解。由于抽取的子电路的规模远小于展开电路的规模,加速r求解过程;同时提出了抽象电路的概念,并分析了抽取子电路的同构特性。通过在抽象电路上进行预处理得到学习子句,从而可以利用学习子句加速每一次的SAT求解过程。在ISCA85和ISCA89电路上的实验结果表明,采用文中方法使得电路时延的求解效率平均提高了约8倍。

科技英语翻译的原则_方法及技巧.

翻译是把一种语言里已经表达出来的事物用另一种语言准确流畅地进行重新表达的过程。与其他题材的文章相比,科技专业文章在内容、表达形式和风格上有很大的差别,具有科技性强、专业性强、逻辑严密、表达要求简练的特点,在翻译上力求准确全面、严谨明确和通顺简练。 1科技英语翻译遵循的基本原则 从科技文章的特点来看,大多具有以下几个特征:述说事理、逻辑性强、结构严密、术语繁多,语言严谨、数据精确。这就要求译文必须概念清楚、条理分明、逻辑正确、数据无误,尤其对定义、定律、公式、图表、结论等更应特别注意。科技英语作为特殊英语的一个分支,在词汇构成、遣词造句等方面都有其自身的特点,其语法结构不十分严密、语言习惯和汉语也有不少差别、词汇量大、词语繁多,因此科技英语翻译起来比较困难。另外,科技文章比较重视叙事逻辑上的连贯及表达上的明晰与畅达; 避免行文晦涩,避免表露个人感情,避免论证上的主观随意性。因此,科技英语翻译力求少用或不用描述性形容词以及具有抒情作用的副词、感叹词及疑问词,而是大量使用科技词汇、专业技术用语,译者应尊重客观事实,不能随意改动数据、回避不易翻译的文字,更不能加进自己的主观想象,进行自由翻译。 我国著名翻译家严复提出的“信、达、雅”三准则一直为不少翻译工作者所接受。 “信”指的是译文要忠实于原文,“达”是指译文的通顺达意,“雅”指的是译文的用词修辞。三准则体现了译文和原文信息等值这一基本要领。 “信、达、雅”的翻译准则对各种英语文体的翻译实践都具有指导意义,是衡量一篇译文好坏的标准,也同样适用于科技文献的翻译。由于科技文章特有的文体特征,与其他类文章相比,其“达”和“雅”的内涵不同,它要求在准确传达信息的基础上,使译文更加简洁明快,流畅通顺。2科技英语翻译的基本方法

机械英文参考文献及翻译

Abstract: With a focus on the intake tower of the Yanshan Reservoir, this paper discusses the method of modeling in the 3D CAD software SolidWorks and the interface processing between SolidWorks and the ANSYS code, which decreases the difficulty in modeling complicated models in ANSYS. In view of the function of the birth-death element and secondary development with APDL (ANSYS parametric design language), a simulation analysis of the temperature field and thermal stress during the construction period of the intake tower was conveniently conducted. The results show that the temperature rise is about 29.934 □ over 3 or 4 days. The temperature differences between any two points are less than 24 □. The thermal stress increases with the temperature difference and reaches its maximum of 1.68 MPa at the interface between two concrete layers. Key words: SolidWorks; ANSYS; APDL; birth-death element; temperature field; thermal stress 1 Introduction Mass concrete is widely used in civil and hydraulic engineering nowadays, and its thermal stress increasingly attracts attention during design and construction. It is necessary to analyze the temperature field and thermal stress of important mass concrete structures with both routine methods and the finite element method (FEM). Some researchers have done a large amount of simulation analyses using FEM software (Tatro 1985; Barrett et al. 1992; Kawaguchi and Nakane 1996; Zhu and Xu 2001; Zhu 2006), but difficulties in these methods remain. There are two main difficulties: (1) Most mass concrete structures are complex and difficult to model with FEM software. (2) Complete simulation is difficult with FEM software because of the complex construction processes and boundary conditions of concrete. The structure of the intake tower of the Yanshan Reservoir is complex. It is 34.5 m high and there is a square pressure tunnel at the bottom, the side length of which is 6 m. The intake tower was modeled in the 3D CAD software SolidWorks and imported into ANSYS with an interface tool. Then, using the APDL program, analysis of the temperature field and thermal stress during construction was conducted. 2 Modeling in SolidWorks and interface processing between SolidWorks and ANSYS 2.1 Modeling in SolidWorks SolidWorks is a CAD/CAE/CAM/PDM desktop system, and the first 3D

英文文献及翻译

Determination of Arsenic in Palm Kernel Expeller using Microwave Digestion and Graphite Furnace Atomic Absorption Spectrometry Method Abdul Niefaizal Abdul Hammid, Ainie Kuntom, RazaIi Ismail, and Norazilah Pardi 1Malaysian Palm Oil Board, Persiaran Institusi, Bandar Baru Bangi, 43000, Kajang Selangor, Malaysia. niefaizal@https://www.doczj.com/doc/509830839.html,.my Abstrak – A study on the method to determine arsenic in palm kernel expeller was carried out. Microwave digestion technique is widely applied in the analytical chemistry field. In comparison to conventional sample digestion method, the microwave technique is simple, reduced contamination, usage of safe reagent and matrix completely digested. A graphite furnace atomic absorption spectrometry method was used for the total determination of arsenic in palm kernel expeller. Arsenic was extracted from palm kernel expeller in a closed vessel digestion system with nitric acid and hydrogen peroxide. The results showed that the optimal ashing and atomizing temperatures were 800°C and 2400°C respectively. The limit of detection was estimated to be 0.001 ppm. The mean recoveries of arsenic for repeatability and reproducibility for 1, 2 and 4 ppm were in the range between 79 – 90%. Ten samples of palm kernel expeller from mills were analyzed to contain 0.18 to 3.05 ppm of arsenic. Therefore, is proposed that this method be used to detect arsenic in palm kernel expeller Key Words –Microwave digestion, graphite furnace atomic absorption spectrometry, palm kernel expeller, arsenic, mills. 1 Introduction Arsenic has been considered as an essential trace element for normal growth and development of animals (Lasky et al, 2004). However, arsenic is more often regarded as a hazardous element rather than as essential element widely encountered in the environment and organisms (Cullen and Reimer, 1989). Arsenic is extensively distributed in the environment because of its presence naturally as well as from industrial production. Natural arsenic concentration in plants hardly exceeds 1 mg/kg (Porter and Peterson, 1975). This level increases to several folds when plants are coerced to grow in arsenic treated soils, but arsenic is primarily retained in the roots. Studies showed that vegetable grown in arsenic-spiked soils exhibited 7.1 and 5.0 mg/kg in the roots and shoots respectively Jones and Hatch, 1945). In tomato and bean plants, arsenic is primarily concentrated in the roots, and a small quantity is translocated to the pods (Cobb et al., 2000). A similar pattern is observed in Tamarik (Tamarix parviflora) and Eucalyptus (Eucalyptus camaldulensis) where the roots accumulate more arsenic compared to the shoots (Tossell et al., 2000). In Malaysia the level of arsenic in oil palm is not well established. Contamination of arsenic may come from the use of herbicides such a monosodium methyl arsenate (MSMA), disodium methyl arsenate (DSMA) and cacodylic acid (dimethylarsenic acid) in oil palm plantations. However these compounds are not in used anymore. Numerous methods are available for extracting arsenic from various matrices and analyzing total arsenic (Hudson-Edwards et al., 2004). The most common 641

相关主题
文本预览
相关文档 最新文档