JavaEE5:强大的功能、高生产率和低复杂性 毕业论文外文翻译
JAVA相关毕业论文外文翻译
Java 堆Java 堆,每一个Java 对象在其中分派,是您在编写Java 应用程序时利用最频繁的内存区域。
JVM 设计用于将咱们与主机的特性隔离,因此将内存看成堆来考虑再正常只是了。
您必然碰着过Java 堆 OutOfMemoryError ,它可能是由于对象泄漏造成的,也可能是因为堆的大小不足以存储所有数据,您也可能了解这些场景的一些调试技术。
可是随着您的Java 应用程序处置愈来愈多的数据和愈来愈多的并发负载,您可能就会碰着无法利用常规技术进行修复的OutOfMemoryError。
在一些场景中,即便java 堆未满,也会抛犯错误。
当这种场景发生时,您需要明白得Java 运行时环境(Java Runtime Environment,JRE)内部到底发生了什么。
Java 应用程序在Java 运行时的虚拟化环境中运行,可是运行时本身是利用C 之类的语言编写的本机程序,它也会耗用本机资源,包括本机内存。
本机内存是可用于运行时进程的内存,它与Java 应用程序利用的java 堆内存不同。
每种虚拟化资源(包括Java 堆和Java 线程)都必需存储在本机内存中,虚拟机在运行时利用的数据也是如此。
这意味着主机的硬件和操作系统施加在本机内存上的限制会阻碍到Java 应用程序的性能。
硬件限制本机进程碰着的许多限制都是由硬件造成的,而与操作系统没有关系。
每台运算机都有一个处置器和一些随机存取存储器(RAM),后者也称为物理内存。
处置器将数据流说明为要执行的指令,它拥有一个或多个处置单元,用于执行整数和浮点运算和更高级的计算。
处置器具有许多寄放器——常快速的内存元素,用作被执行的计算的工作存储,寄放器大小决定了一次计算可利用的最大数值。
处置器通过内存总线连接到物理内存。
物理地址(处置器用于索引物理RAM 的地址)的大小限制了能够寻址的内存。
例如,一个16 位物理地址能够寻址0x0000 到0xFFFF 的内存地址,那个地址范围包括2^16 = 65536 个惟一的内存位置。
Java技术介绍-毕业论文外文翻译
Java Technical DescriptionJava as a Programming Platform.Java is certainly a good programming language. There is no doubt that it is one of the better languages available to serious programmers. We think it could potentially have been a great programming language, but it is probably too late for that. Once a language is out in the field, the ugly reality of compatibility with existing code sets in."Java was never just a language. There are lots of programming languages out there, and few of them make much of a splash. Java is a whole platform, with a huge library, containing lots of reusable code, and an execution environment that provides services such as security, portability across operating systems, and automatic garbage collection.As a programmer, you will want a language with a pleasant syntax and comprehensible semantics (i.e., not C++). Java fits the bill, as do dozens of other fine languages. Some languages give you portability, garbage collection, and the like, but they don't have much of a library, forcing you to roll your own if you want fancy graphics or networking or database access. Well, Java has everything—a good language, a high-quality execution environment, and a vast library. That combination is what makes Java an irresistible proposition to so many programmers.Features of Java.1.SimpleWe wanted to build a system that could be programmed easily without a lot of esoteric training and which leveraged today's standard practice. So even though we found that C++ was unsuitable, we designed Java as closely to C++ as possible in order to make the system more comprehensible. Java omits many rarely used, poorly understood, confusing features of C++ that, in our experience, bring more grief than benefit.The syntax for Java is, indeed, a cleaned-up version of the syntax for C++. There is no need for header files, pointer arithmetic (or even a pointer syntax), structures, unions, operator overloading, virtual base classes, and so on. (See the C++ notes interspersed throughout the text for more on the differences between Java and C++.) The designers did not, however, attempt to fix all of the clumsy features of C++. For example, the syntax of the switch statement is unchanged in Java. If you know C++, you will find the transition to the Java syntax easy.If you are used to a visual programming environment (such as Visual Basic), you will not find Java simple. There is much strange syntax (though it does not take long to get the hang of it). More important, you must do a lot more programming in Java. The beauty of Visual Basic is that its visual design environment almost automatically provides a lot of the infrastructure for an application. The equivalent functionality must be programmed manually, usually with a fair bit of code, in Java. There are, however, third-party development environments that provide "drag-and-drop"-style program development.Another aspect of being simple is being small. One of the goals of Java is to enable the construction of software that can run stand-alone in small machines. The size of the basic interpreter and class support is about 40K bytes; adding the basic standard libraries and thread support (essentially a self-contained microkernel) adds an additional 175K.2. Object OrientedSimply stated, object-oriented design is a technique for programming that focuses on the data (= objects) and on the interfaces to that object. To make an analogy with carpentry, an "object-oriented" carpenter would be mostly concerned with the chair he was building, and secondarily with the tools used to make it; a "non-object-oriented" carpenter would think primarily of his tools. The object-oriented facilities of Java are essentially those of C++.Object orientation has proven its worth in the last 30 years, and it is inconceivable that a modern programming language would not use it. Indeed, the object-oriented features of Java are comparable to those of C++. The major differencebetween Java and C++ lies in multiple inheritance, which Java has replaced with the simpler concept of interfaces, and in the Java metaclass model. The reflection mechanism and object serialization feature make it much easier to implement persistent objects and GUI builders that can integrate off-the-shelf components.3. DistributedJava has an extensive library of routines for coping with TCP/IP protocols like HTTP and FTP. Java applications can open and access objects across the Net via URLs with the same ease as when accessing a local file system. We have found the networking capabilities of Java to be both strong and easy to use. Anyone who has tried to do Internet programming using another language will revel in how simple Java makes onerous tasks like opening a socket connection. (We cover networking in Volume 2 of this book.) The remote method invocation mechanism enables communication between distributedobjects (also covered in Volume 2).There is now a separate architecture, the Java 2 Enterprise Edition (J2EE), that supports very large scale distributed applications.4. RobustJava is intended for writing programs that must be reliable in a variety of ways. Java puts a lot of emphasis on early checking for possible problems, later dynamic (run-time) checking, and eliminating situations that are error-prone.… The single biggest difference between Java and C/C++ is that Java has a pointer model that eliminates the possibility of overwriting memory and corrupting data.This feature is also very useful. The Java compiler detects many problems that, in other languages, would show up only at run time. As for the second point, anyone who has spent hours chasing memory corruption caused by a pointer bug will be very happy with this feature of Java.If you are coming from a language like Visual Basic that doesn't explicitly use pointers, you are probably wondering why this is so important. C programmers are not so lucky. They need pointers to access strings, arrays, objects, and even files. In Visual Basic, you do not use pointers for any of these entities, nor do you need to worry about memory allocation for them. On the other hand, many data structures aredifficult to implement in a pointerless language. Java gives you the best of both worlds. You do not need pointers for everyday constructs like strings and arrays. You have the power of pointers if you need it, for example, for linked lists. And you always have complete safety, because you can never access a bad pointer, make memory allocation errors, or have to protect against memory leaking away.5. SecureJava is intended to be used in networked/distributed environments. Toward that end, a lot of emphasis has been placed on security. Java enables the construction of virus-free, tamper-free systems.In the first edition of Core Java we said: "Well, one should 'never say never again,'" and we turned out to be right. Not long after the first version of the Java Development Kit was shipped, a group of security experts at Princeton University found subtle bugs in the security features of Java 1.0. Sun Microsystems has encouraged research into Java security, making publicly available the specification and implementation of the virtual machine and the security libraries. They have fixed all known security bugs quickly. In any case, Java makes it extremely difficult to outwit its security mechanisms. The bugs found so far have been very technical and few in number. From the beginning, Java was designed to make certain kinds of attacks impossible, among them:∙Overrunning the runtime stack—a common attack of worms and viruses Corrupting memory outside its own process space Reading or writing files without permission.∙A number of security features have been added to Java over time. Since version1.1, Java has the notion of digitally signed classesWith a signed class, you can be sure who wrote it. Any time you trust the author of the class, the class can be allowed more privileges on your machine.6. Architecture NeutralThe compiler generates an architecture-neutral object file format—the compiled code is executable on many processors, given the presence of the Java runtime system.The Java compiler does this by generating bytecode instructions which have nothing to do with a particular computerarchitecture. Rather, they are designed to be both easy to interpret on any machine and easily translated into native machine code on the fly.This is not a new idea. More than 20 years ago, both Niklaus Wirth's original implementation of Pascal and the UCSD Pascal system used the same technique. Of course, interpreting bytecodes is necessarily slower than running machine instructions at full speed, so it isn't clear that this is even a good idea. However, virtual machines have the option of translating the most frequently executed bytecode sequences into machine code, a process called just-in-time compilation. This strategy has proven so effective that even Microsoft's .NET platform relies on a virtual machine.The virtual machine has other advantages. It increases security because the virtual machine can check the behavior of instruction sequences. Some programs even produce bytecodes on the fly, dynamically enhancing the capabilities of a running program.7. PortableUnlike C and C++, there are no "implementation-dependent" aspects of the specification. The sizes of the primitive data types are specified, as is the behavior of arithmetic on them.For example, an int in Java is always a 32-bit integer. In C/C++, int can mean a 16-bit integer, a 32-bit integer, or any other size that the compiler vendor likes. The only restriction is that the int type must have at least as many bytes as a short int and cannot have more bytes than a long int. Having a fixed size for number types eliminates a major porting headache. Binary data is stored and transmitted in a fixed format, eliminating confusion about byte ordering. Strings are saved in a standard Unicode format.The libraries that are a part of the system define portable interfaces. For example, there is an abstract Window class and implementations of it for UNIX, Windows, and the Macintosh.As anyone who has ever tried knows, it is an effort of heroic proportions to write a program that looks good on Windows, the Macintosh, and 10 flavors of UNIX. Java1.0 made the heroic effort, delivering a simple toolkit that mapped common user interface elements to a number of platforms.Unfortunately, the result was a library that, with a lot of work, could give barely acceptable results on different systems. (And there were often different bugs on the different platform graphics implementations.) But it was a start. There are many applications in which portability is more important than user interface slickness, and these applications did benefit from early versions of Java. By now, the user interface toolkit has been completely rewritten so that it no longer relies on the host user interface. The result is far more consistent and, we think, more attractive than in earlier versions of Java.8. InterpretedThe Java interpreter can execute Java bytecodes directly on any machine to which the interpreter has been ported. Since linking is a more incremental and lightweight process, the development process can be much more rapid and exploratory.Incremental linking has advantages, but its benefit for the development process is clearly overstated. In any case, we have found Java development tools to be quite slow. If you are used to the speed of the classic Microsoft Visual C++ environment, you will likely be disappointed with the performance of Java development environments. (The current version of Visual Studio isn't as zippy as the classic environments, however. No matter what languageyou program in, you should definitely ask your boss for a faster computer to run the latest development environments. )9. High PerformanceWhile the performance of interpreted bytecodes is usually more than adequate, there are situations where higher performance is required. The bytecodes can be translated on the fly (at run time) into machine code for the particular CPU the application is running on.If you use an interpreter to execute the bytecodes, "high performance" is not the term that we would use. However, on many platforms, there is also another form ofcompilation, the just-in-time (JIT) compilers. These work by compiling the bytecodes into native code once, caching the results, and then calling them again if needed. This approach speeds up commonly used code tremendously because one has to do the interpretation only once. Although still slightly slower than a true native code compiler, a just-in-time compiler can give you a 10- or even 20-fold speedup for some programs and will almost always be significantly faster than an interpreter. This technology is being improved continuously and may eventually yield results that cannot be matched by traditional compilation systems. For example, a just-in-time compiler can monitor which code is executed frequently and optimize just that code for speed.10. MultithreadedThe enefits of multithreading are better interactive responsiveness and real-time behavior.if you have ever tried to do multithreading in another language, you will be pleasantly surprised at how easy it is in Java. Threads in Java also can take advantage of multiprocessor systems if the base operating system does so. On the downside, thread implementations on the major platforms differ widely, and Java makes no effort to be platform independent in this regard. Only the code for calling multithreading remains the same across machines; Java offloads the implementation of multithreading to the underlying operating system or a thread library. Nonetheless, the ease of multithreading is one of the main reasons why Java is such an appealing language for server-side development.11. DynamicIn a number of ways, Java is a more dynamic language than C or C++. It was designed to adapt to an evolving environment. Libraries can freely add new methods and instance variables without any effect on their clients. In Java, finding out run time type information is straightforward.This is an important feature in those situations in which code needs to be added to a running program. A prime example is code that is downloaded from the Internet to run in a browser. In Java 1.0, finding out runtime type information was anything but straightforward, but current versions of Java give the programmer full insight intoboth the structure and behavior of its objects. This is extremely useful for systems that need to analyze objects at run time, such as Java GUI builders, smart debuggers, pluggable components, and object databases.Java技术介绍Java是一种程序设计平台Java是一种优秀的程序设计语言。
java ee概述
java ee概述
Java EE,也称为Java Platform Enterprise Edition,是由Sun Microsystems(已被甲骨文公司收购)推出的企业级应用程序版本。
它是在Java SE的基础上构建的,为企业级应用提供了一整套的解决方案。
Java EE的主要目标是帮助开发和部署可移植、健壮、可伸缩且安全的服务器端Java应用程序。
它提供了一组丰富的API,用于Web 服务、组件模型、管理和通信,可以用来实现企业级的面向服务体系结构(service-oriented architecture,SOA)和Web 3.0应用程序。
Java EE的核心组件包括客户层(表示逻辑层)、业务逻辑层和企业信息系统层。
此外,Java EE还提供了一组容器,如Web Enterprise JavaBean(EJB)应用程序客户机、Applet等,这些容器可以帮助开发和部署各种类型的企业级应用。
随着Java的发展,Java EE也在不断进步,新的特性被引入以提高开发人员效率,满足苛刻的企业需求。
例如,通过引入更多的注释POJO来降低XML配置的复杂性,使用更紧密的集成技术提供一个更加无缝的开发体验,加强对HTML5动态可伸缩应用的支持等。
总的来说,Java EE是一个强大而灵活的企业级应用程序开发平台,它提供了丰富的功能和工具,帮助开发人员快速设计和开发高质量的企业级软件系统。
计算机系 Java EE 外文翻译 外文文献 英文文献
外文科技资料翻译英文原文The Java EE Platform is the leading enterprise web server. The Adobe Flash Platform is the leader in the rich Internet application space. Using both, developers can deliver compelling, data-centric applications that leverage the benefits of an enterprise back-end solution and a great user experience.In this article, you learn about the architecture of applications built using Flex and Java including:(1)An overview of the client/server architecture.(2)The different ways the client and server can communicate.(3)An introduction to Flash Remoting and why and how you use it.(4)How to integrate a Flex application with your security framework.(5)An overview of how to build Flex applications using events, states,MXML components, and modules.(6)An introduction to developing a Flex application with real-time serverdata push.(7)How to boost productivity developing data-intensive applicationsusing the Data Management service in LiveCycle Data Services.(8)An overview of model driven development using Flash Builder andLiveCycle Data Services to generate client and server-side code.(9)How to deploy a Flex application on a portal server.(10)Be sure to also watch the video Introduction to Flex 4 and Javaintegration.(11)To learn more about the technologies used to build these applications,read The technologies for building Flex and Java applications article.Client/server architectureFlex and Java applications use a multi-tier architecture where the presentation tier is the Flex application, the business or application tier is the Java EE server and code, and the data tier is the database. You can write the back-end code just as you normally would for a Java application, modeling your objects, defining your database, using an object-relational framework such as Hibernate or EJB 3, and writing the business logic to query and manipulate these objects. The business tier must be exposed for access via HTTP from the Flex application and will be used to move the data between the presentation and data tiers.Typical HTML applications consist of multiple pages and as a user navigates between them, the application data must be passed along so the application itself (the collection of pages and functionality it consists of) can maintain state. In contrast, Flex applications, by nature, are stateful. A Flex application is embedded in a single HTML page that the user does not leave and is rendered by Flash Player. The Flex application can dynamically change views and send and retrieve data asynchronously to the server in the background, updating but never leaving the single application interface (see Figure 1) (similar to the functionality provided by the XMLHttpRequest API with JavaScript.)Figure 1. The client/server architecture.Client/server communicationFlex applications can communicate with back-end servers using either direct socket connections or more commonly, through HTTP. The Flex framework has three remote procedure call APIs that communicate with a server over HTTP: HTTPService, WebService, and RemoteObject. All three wrap Flash Player'sHTTP connectivity, which in turn, uses the browser's HTTP library. Flex applications cannot connect directly to a remote database.You use HTTPService to make HTTP requests to JSP or XML files, to RESTful web services, or to other server files that return text over HTTP. You specify the endpoint URL, listener functions (the callback functions to be invoked when the HTTPService request returns a successful or unsuccessful response), and a data type for the returned data (what type of data structure it should be translated into once received in the Flex application). You can specify the data to be handled as raw text and assigned to a String variable or converted to XML, E4X, or plain old ActionScript objects. If you get back JSON, you can use the Adobe Flex corelib package of classes to deserialize the JSON objects into ActionScript objects. To make calls to SOAP based web services, you can use the HTTPService API or the more specialized WebService API, which automatically handles the serialization and deserialization of SOAP formatted text to ActionScript data types and vice versa.The third option for making remote procedure calls is to use the RemoteObject API. It makes a Flash Remoting request to a method of a server-side Java class that returns binary Action Message Format over HTTP. When possible, use Flash Remoting whose binary data transfer format enables applications to load data up to 10 times faster than with the more verbose, text-based formats such as XML, JSON, or SOAP (see Figure 2). To see a comparison of AMF to other text-based serialization technologies, see James Ward's Census RIA Benchmark application.Figure 2. Methods for connecting Flex and Java.Flash RemotingFlash Remoting is a combination of client and server-side functionality that together provides a call-and-response model for accessing server-side objects from Flash Platform applications as if they were local objects. It provides transparent data transfer between ActionScript and server-side data types, handling the serialization into Action Message Format (AMF), deserialization, and data marshaling between the client and the server.Flash Remoting uses client-side functionality built in to Flash Player and server-side functionality that is built in to some servers (like ColdFusion and Zend) but must be installed on other servers (as BlazeDS or LiveCycle Data Services on Java EE servers, WebORB or FluorineFX on .NET servers, the Zend framework or amfphp on PHP servers, and more). See the technologies for building Flex and Java applications article for more details about BlazeDS and LiveCycle Data Services.BlazeDS and LiveCycle Data Services use a message-based framework to send data back and forth between the client and server. They provide Remoting, Proxying, and Messaging services, and for LiveCycle, an additional Data Management service. The Flex application sends a request to the server and the request is routed to an endpoint on the server. From the endpoint, the request is passed to the MessageBroker, the BlazeDS and LiveCycle Data Services engine that handles all the requests and routes them through a chain of Java objects to the destination, the Java class with the method to invoke (see Figure 3).Figure 3. Flash Remoting architecture.AMFAMF is a binary format used to serialize ActionScript objects and facilitate data exchange between Flash Platform applications and remote services over the Internet. Adobe publishes this protocol; the latest is AMF 3 Specification for ActionScript 3. You can find tables listing the data type mappings when converting from ActionScript to Java and Java to ActionScript here.For custom or strongly typed objects, public properties (including those defined with get and set methods) are serialized and sent from the Flex application to the server or from the server to the Flex application as properties of a general 0bject. To enable mapping between the corresponding client and server-side objects, you use the same property names in the Java and ActionScript classes and then in the ActionScript class, you use the [RemoteClass] metadata tag to create an ActionScript object that maps directly to the Java object.Here is an example Employee ActionScript class that maps to a server-side Employee Java DTO located in the services package on the server.package valueobjects.Employee{ [Bindable] [RemoteClass(alias="services.Employee")] public class Employee { public var id:int; public var firstName:String; public var lastName:String; (...) } }Installing BlazeDS or LiveCycle Data ServicesTo use Flash Remoting with BlazeDS or LiveCycle Data Services, you need to install and configure the necessary server-side files. For BlazeDS, you can download it as a WAR file which you deploy as a web application or as a turnkey solution. The turnkey download contains a ready-to-use version of Tomcat in which the the BlazeDS WAR file has already been deployed and configured along with a variety of sample applications. Similarly, for LiveCycle Data Services, the installer lets you choose to install LiveCycle with an integrated Tomcat server or as a LiveCycle Data Services web application.In either scenario a web application called blazeds or lcds (usually appended by a version number) is created. You can modify and build out this application with your Java code, or more typically, you can copy the JAR files and configuration files the blazeds or lcds web application contains and add them to an existing Java web application on the server (see Figure 4).Figure 4. The required BlazeDS or LiveCycle Data Services files.Modifying web.xmlIf copying the files to a different web application, you also need to modify the web.xml file to define a session listener for HttpFlexSession and a servlet mapping for MessageBroker, which handles all the requests and passes them off to the correct server-side Java endpoints. You can copy and paste these from the original blazeds or lcds web application web.xml file.<!-- Http Flex Session attribute and binding listener support --> <listener> <listener-class>flex.messaging.HttpFlexSession</listener-class> </listener> <!-- MessageBroker Servlet --> <servlet><servlet-name>MessageBrokerServlet</servlet-name><display-name>MessageBrokerServlet</display-name><servlet-class>flex.messaging.MessageBrokerServlet</servlet-class><init-param> <param-name>services.configuration.file</param-name><param-value>/WEB-INF/flex/services-config.xml</param-value></init-param> <load-on-startup>1</load-on-startup> </servlet><servlet-mapping> <servlet-name>MessageBrokerServlet</servlet-name><url-pattern>/messagebroker/*</url-pattern> </servlet-mapping>Optionally, you may also want to copy and paste (and uncomment) the mapping for RDSDispatchServlet, which is used for RDS (Remote Data Service) access with the data service creation feature in Flash Builder 4 that introspects a server-side service and generates corresponding client-side code. See the model driven development section for more details.<servlet> <servlet-name>RDSDispatchServlet</servlet-name><display-name>RDSDispatchServlet</display-name><servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class><init-param> <param-name>useAppserverSecurity</param-name><param-value>false</param-value> </init-param><load-on-startup>10</load-on-startup> </servlet> <servlet-mappingid="RDS_DISPATCH_MAPPING"><servlet-name>RDSDispatchServlet</servlet-name><url-pattern>/CFIDE/main/ide.cfm</url-pattern> </servlet-mapping> Reviewing services-config.xmlFor Flash Remoting, the client sends a request to the server to be processed and the server returns a response to the client containing the results. You configure these requests by modifying the services-config.xml and remoting-config.xml files located in the /WEB-INF/flex/ folder for the web application.The services-config.xml file defines different channels that can be used when making a request. Each channel definition specifies the network protocol and the message format to be used for a request and the endpoint to deliver the messages to on the server. The Java-based endpoints unmarshal the messages in a protocol-specific manner and then pass the messages in Java form to the MessageBroker which sends them to the appropriate service destination (you'll see how to define these next).<channels> <channel-definition id="my-amf"class="mx.messaging.channels.AMFChannel"> <endpointurl="http://{}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition><channel-definition id="my-secure-amf"class="mx.messaging.channels.SecureAMFChannel"> <endpointurl="https://{}:{server.port}/{context.root}/messagebroker/amfsecu re" class="flex.messaging.endpoints.SecureAMFEndpoint"/></channel-definition> (...) </channels>Defining destinationsIn the remoting-config.xml file, you define the destinations (named mappings to Java classes) to which the MessageBroker passes the messages. You set the source property to the fully qualified class name of a Java POJO with a no argument constructor that is located in a source path, usually achieved by placing it in the web application's /WEBINF/classes/ directory or in a JAR file in the /WEBINF/lib/ directory. You can access EJBs and other objects stored in the Java Naming and Directory Interface (JNDI) by calling methods on a destination that is a service facade class that looks up an object in JNDI and calls its methods.You can access stateless or stateful Java objects by setting the scope property to application, session, or request (the default). The instantiation and management of the server-side objects referenced is handled by BlazeDS or LiveCycle Data Services.<service id="remoting-service"class="flex.messaging.services.RemotingService"> <adapters><adapter-definition id="java-object"class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> </adapters> <default-channels> <channel ref="my-amf"/> </default-channels> <destination id="employeeService"> <properties><source>services.EmployeeService</source> <scope>application</scope></properties> </destination> </service>You can also specify channels for individual destinations.<destination id="employeeService " channels="my-secure-amf">Lastly, you use these destinations when defining RemoteObject instances in a Flex application.<s:RemoteObject id="employeeSvc" destination="employeeService"/>SecurityIn many applications, access to some or all server-side resources must be restricted to certain users. Many Java EE applications use container managed security in which user authentication (validating a user) and user authorization (determining what the user has access to—which is often role based) are performed against the Realm, an existing store of usernames, passwords, and user roles. The Realm is configured on your Java EE server to be a relational database, an LDAP directory server, an XML document, or to use a specific authentication and authorization framework.To integrate a Flex application with the Java EE security framework so that access to server-side resources is appropriately restricted, you add security information to the BlazeDS or LiveCycle Data Services configuration files (details follow below) and then typically in the Flex application, create a form to obtain login credentials from the user which are passed to the server to be authenticated. The user credentials are then passed to the server automatically with all subsequent requests.Modifying services-config.xmlIn the BlazeDS or LiveCycle Data Services services-config.xml file, you need to specify the "login command" for your application server in the <security> tag. BlazeDS and LiveCycle Data Services supply the following login commands: TomcatLoginCommand (for both Tomcat and JBoss), JRunLoginCommand, WeblogicLoginCommand, WebSphereLoginCommand, OracleLoginCommand. These are all defined in the XML file and you just need to uncomment the appropriate one.You also need to define a security constraint that you specify to use either basic or custom authentication and if desired, one or more roles. To do custom authentication with Tomat or JBoss, you also need to add some extra classes tothe web application for integrating with the security framework used by the Jave EE application server and modify a couple of configuration files. Mode details can be found here.<services-config> <security> <login-commandclass="flex.messaging.security.TomcatLoginCommand" server="Tomcat"><per-client-authentication>false</per-client-authentication></login-command> <security-constraint id="trusted"><auth-method>Custom</auth-method> <roles> <role>employees</role><role>managers</role> </roles> </security-constraint> </security> ...</services-config>Modifying remoting-config.xmlNext, in your destination definition, you need to reference the security constraint:<destination id="employeeService"> <properties><source>services.EmployeeService</source> </properties> <security><security-constraint ref="trusted"/> </security> </destination>You can also define default security constraints for all destinations and/or restrict access to only specific methods that can use different security constraints.The default channel, my-amf, uses HTTP. You can change one or more of the destinations to use the my-secure-amf channel that uses HTTPS:<destination id="employeeService"> <channels> <channelref="my-secure-amf"/> </channels> ... </destination>where my-secure-amf is defined in the services-config.xml file:<!-- Non-polling secure AMF --> <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> <endpointurl="https://{}:{server.port}/{context.root}/messagebroker/amfsecu re" class="flex.messaging.endpoints.SecureAMFEndpoint"/></channel-definition>Adding code to the Flex applicationThat covers the server-side setup. Now, if you are using custom authentication, you need to create a form in the Flex application to retrieve a username and password from the user and then pass these credentials to the server by calling the ChannelSet.login() method and then listening for its result and fault events. A result event indicates that the login (the authentication) occurred successfully, and a fault event indicates the login failed. The credentials are applied to all services connected over the same ChannelSet. For basic authentication, you don’t have to add anything to your Flex application. The browser opens a login dialog box when the application first attempts to connect to a destination.Your application can now make Flash Remoting requests to server destinations just as before, but now the user credentials are automatically sent with every request (for both custom and basic authentication). If the destination or methods of the destination have authorization roles specified which are not met by the logged in user, the call will return a fault event. To remove the credentials and log out the user, you use the ChannelSet.logout() method.中文译文Java EE平台是全球领先的企业Web服务器。
Java EE ベースの大规模开発における単体テストの実践的アプローチ
第 号, ベースの大規模開発における単体テストの実践的アプローチ二 木 隆 彰, 新 井 敦要 約 Java EE(Java Platform, Enterprise Edition)はミッションクリティカルな大規模情報システムの基盤技術として広く普及しており,様々な開発支援ツールが提供されている.大規模な情報システムの開発において,品質と開発生産性を向上させるための重要なポイントの一つに,開発時の単体テストがある.膨大な量のソースコードで構成される大規模な情報システムはテストケースの数も多く,リグレッションテストを繰り返し実施するため,ツールを効果的に活用して手作業を効率化するための単体テストのアプローチが必要となる. また,多くの開発者が同時並行で作業する大規模開発では,成果物や作業の手順を定義することで作業プロセスを標準化した上で,開発環境の統一や検証作業の問題,リグレッションテストの簡素化など,実践する上でのいくつかの課題に対応する必要がある. 進化する開発技術を活用することを前提としたテストアプローチを作り上げて改善していくことが,システムの品質と開発の生産性を向上させることにつながる. As for Java EE (Java Platform, Enterprise Edition), it is widely spread as a basic technology of the mission-critical, large-scale information system, and being offered a variety of development supporting tools. In the development of a large-scale information system, there is a unit testing when developing in one of the important points to improve the quality and the development productivity. The large-scale infor-mation system composed of a huge amount of source code needs the approach of the unit testing to use the tool effectively so that the number of test cases may also repeatedly execute a lot of regression testing and to make the hand working more efficient. Moreover, it is necessary to deal with some problems in the standardization of development environ-ments, problems of verification working, and the simplification of regression testing etc., and practice in large-scale development that a lot of developers work parallel to each other after the work process is stan-dardized by defining the procedures of the deliverables and work. Developing and improving the testing approach based on the use of the evolving developmental technol-ogy will leads to the improved quality of the system and the enhanced productivity of development activity. は じ め に 社会全体の情報化が進む中,企業や官公庁の情報システムは重要な業務データや個人情報が蓄積され,様々な機能が盛り込まれて大規模化している.情報システムが対象とする業務の範囲やユーザ層が広がるにつれ,企業の競争優位や業務の効率化に及ぼす影響も大きくなるため,システム開発における品質と生産性に対する要求も高まってきている. 業務遂行に欠かせないミッションクリティカルな大規模情報システムの基盤技術として,Java EE(Java Platform, Enterprise Edition)が普及している.Java EEは,数多くの情報シ(541)151152(542)ステムで採用されて改良と拡充を重ねており,ベンダー各社も様々なサーバソフトウェアやフレームワーク製品,開発支援ツールを提供している.また,オープンソースソフトウェア(OSS)の機能性と品質の向上もめざましく,Java EEの普及に拍車をかけている. Java EEを基盤技術とした大規模な情報システムの開発において,品質と開発生産性を向上させるための重要なポイントの一つに,開発時の単体テストがある.膨大な量のソースコードで構成される大規模な情報システムはテストケースの数も多く,不具合修正や仕様変更による再テスト(リグレッションテスト)を繰り返し実施する.開発工程の早い段階で不具合を検出して修正することができれば,それ以降の結合テストや総合テストの工程での手戻りも少なくなる.また,多くの開発者が同時並行で作業する中で品質や開発生産性を高めるためには,設計から実装,テストまでの一連の作業工程において成果物や作業の手順を定義することで作業プロセスを標準化する必要がある.開発支援ツールの機能や特性を理解して適切に活用することで作業プロセスを工夫することができれば,作業を効率化させるだけでなく,機械的かつ網羅的にチェックすることで単純な人的ミスを防ぐことにもつながり,品質と開発生産性の両面で大きな効果がある. 本稿では,Java EEを基盤技術とした大規模なシステム開発プロジェクトで実際に適用している単体テストのアプローチを紹介し,それを実践する上での課題とその対応策を示す. なお,日本ユニシスは,本稿で紹介するアプローチを前提とした開発標準MIDMOST for Java EE[6]を提供しており,MIDMOST for Java EEには本稿で示す開発支援ツールや技術ノウハウが含まれている. ベースのシステム開発における単体テストの方法 本章ではJava EEを基盤技術としたシステム開発における単体テストの基本的な方法を説明する.まず,本稿で前提とする単体テストの定義とJavaプログラム開発での支援ツールについて述べ,次に,Java EEを基盤技術としたシステム開発でのテストの対象範囲と具体的な手順について述べる. 単体テスト 本稿で前提とするJava EEを基盤技術としたシステム開発における単体テストは,開発したソースコードが仕様通りに動作することを確認するテストであり,最小単位のモジュールに対して,入力と出力,内部処理の全てのパターンについてテストケースを定義し,仕様通りに正しく実装されていることを確認することを目的とした作業である. 一般的なテストの技法として,モジュール内部の構造や処理手順を考慮せずに設計書に定義された入出力(外部仕様)に着目したブラックボックス技法と,モジュールの構造やソースコードを前提にデータフローと制御フローの観点でコードが正しく動くことを確認するホワイトボックス技法とがある.テストケースの定義は,まず,設計書を基にブラックボックス技法でテストケースを挙げ,次に,ホワイトボックス技法により内部構造を確認しつつ,ブラックボックス技法で挙げたテストケースでは通過しないソースコード部分をテストするためのテストケースを追加していく手法が一般的である[1][5]. こうしたテスト設計の視点としては,エクストリーム・プログラミングのプラクティスの一つに挙げられているテストファーストや,その提唱者であるKent Beck氏が著した「TestJava EEベースの大規模開発における単体テストの実践的アプローチ (543)153 Driven Development」で示しているテスト駆動型開発のテストパターンが有名である[2]. プログラム開発と単体テスト支援ツール Javaプログラムの開発においては,開発作業を効率化するための支援ツールとして統合開発環境Eclipse[8]が広く普及している.Eclipseは開発者向けのオープンソースソフトウェアであり,コード入力やコンパイルエラー修正の支援機能や強力なデバッグ機能等を備えているほか,単体テスト自動化ツールJUnitをはじめ,ソースコードの静的チェック処理や解析レポートを出力するプラグインも豊富に提供されている.ソースコードの品質とテスト作業の効率を向上させる様々な機能があり,Javaによるシステム開発の現場で広く普及している. 一般的なJavaプログラムの開発では,開発者はEclipse上でソースコードを作成してJUnit によりテストを実行する.JUnitによるテストでは,テスト対象のモジュールを呼び出して出力結果をチェックする処理をテストドライバとして実装する.一般に一つのテストケースに対して一つのテストドライバを作成するため,あるモジュールのテストでは複数のテストドライバを実行することになる.JUnitは,複数のテストドライバを一括で実行し,テスト結果の合否を集計して表示する機能を具備しており,リグレッションテストを繰り返す単体テストにおいては,これを採用することにより作業効率の大幅な改善が可能となる. また,全てのソースコードを網羅的にチェックし,コーディングスタイルの規約違反やエラーの可能性が高いコードを検出する静的コード解析ツールも,膨大なソースコードを開発する大規模システム開発においては有効なツールである. システムのアーキテクチャ 次に,Java EEを基盤技術とするシステムのアーキテクチャについて説明する. 一般的にWebブラウザをクライアントとするような情報システムでは,クライアントからのリクエストを受け付け,画面上で入力された値を解析して業務処理を実行し,その結果として次の画面を表示する.業務処理のロジックでは必要に応じてデータベースを参照し更新する.この一連の処理を実現するための実行構造や,システム内部の構成要素とその関係を定義したものがアーキテクチャである. Webベースの情報システムにおけるアーキテクチャの基本的な考え方として,ここ数年でMVC2モデル*1が定着してきている.図1に示すように,システム内部の役割を,業務ロジック(Model)と画面の入出力処理(View),これらの実行制御(Controller)とに機能分割することで,それぞれの機能の独立性を高めて依存関係を最小化することができ,大規模システムにおける分散・並行開発を可能にしている. 単体テストの対象とテスト実施順 MVC2モデルにおいて,実行制御(Controller)の機能部分はシステムが対象とする業務分野に関わらず共通であり,一般にフレームワークと呼ばれて汎用化されている.フレームワークを適用することで,新たに開発するシステムで実装してテストする範囲は「画面の入出力処理」部分と「業務ロジック」部分および,これらから呼び出される共通的な業務ロジックをライブラリ化したモジュールである「業務共通ライブラリ」に限定することができる. また,呼び出し先のスタブ(完成していないプログラム部分の代用)を作成する手間を省くため,呼び出される下位のモジュールから単体テストを実施し,上位のモジュールのテストではテスト済みのモジュールを呼び出すボトムアップ方式のテストを実施する. これらの呼び出し関係とテストの実施順を図2に示す. モジュールごとの単体テスト モジュール単体テストの手順 モジュールの単体テストの基本的な手順は,テスト対象のモジュールを構成するソースコードを解析する静的テストと,実際に動作させて実行結果を確認する動的テストに分けられ,図3に示す手順となる. また,図2で示したモジュールの種類によって実施するテスト作業は異なる.他のモジュールから呼び出される業務共通ライブラリや業務ロジックの動的テストはJUnit テストが中心であり,補完的にデバッガテストを追加する.JUnit からの実行が難しい画面の入出力処理は打鍵テストが中心となる.この関係を表1に示し,それぞれのテスト手順の詳細を次項以降で説明する.図 モジュールの呼び出し関係とテスト実施順図 モデルのアーキテクチャ構造154(544) 静的テスト 静的テストはソースコードを実行せずに確認するテストである.コード解析ツールやチェックリストによって潜在的なバグや標準化違反を検出して修正する. 1) コード解析 Eclipse に組み込んだ以下のプラグインにより全てのJava ソースコードを網羅的にチェックし,コーディングレベルの誤りや不具合,標準化違反を検出して修正する.・CheckStyle [9]:コードの記述形式(コーディングスタイルの規約違反)をチェックする・FindBugs [10]:エラーの可能性が高いコードを検出する 2) コード検証 標準化規約や実装方式等に関するチェック項目を挙げたチェックリストを予め用意し,他の開発者も含めてソースコードをレビューすることで,コード解析ツールだけでは検出できない複合的なバグや非効率なコード,プロジェクト独自の規約に対する違反を目視で検出する. 動的テスト 動的テストは,実際にソースコードを実行して結果を検証するテストである.図 単体テストの基本的な手順表 モジュールの種類によるテスト作業の違いJava EE ベースの大規模開発における単体テストの実践的アプローチ (545)155156(546) 一つ一つのテストケースを実行するテストであり,テストケースに定義された入力値で実際に呼び出して実行し,期待された出力結果であることを確認する.テストケースを実行する方法として以下の三つのパターンがある. 1) JUnitテスト テストケースに従ってテストドライバを実装し,Eclipse上でJUnitにより実行する.業務ロジックやデータのチェック処理などのサブルーチンを呼び出すためのテストドライバを実装してJUnitで実行してテストする. 2) 打鍵テスト JUnitによるテスト実施が難しい機能部分は,手作業で入力してテストする.例えば,画面からの入力を受け付けて次画面の表示内容を確認するようなテストケースはテストドライバの実装が難しいため,Webブラウザから手作業で入力操作し,その実行結果の画面を目視で確認する. 3) デバッガテスト JUnitテストと打鍵テストでも実施が難しい機能部分は,Eclipseのデバッガ機能を使ってテストする.例えば,発生したエラーを処理する部分は,ファイルI/OやOSに起因するシステム障害を発生させる必要があり,このための設定や環境を作り出すことが難しい.このようなテストケースの場合は,Eclipseのデバッガ機能を使ってテストする.Eclipse上でテスト対象のコード部分にブレイクポイントを設定してステップ実行することができ,Eclipse上の操作によって仮想的にエラーを発生させることもできる. デバッガテストでも実施できない部分は,テスト除外項目として一覧表に列挙し,重点的なコードレビューを実施することでコードの正当性を確認する. また,システム開発におけるテストの対象には,JSPやJavaScript,ShellスクリプトなどJava以外の言語で実装したモジュールもあり,これらにはEclipse上でのコード解析やJUnit テストは実施できないため,レビューによるコード検証と画面やコマンドラインから打鍵によるテストを実施する. 単体テスト手順に関する考察 このように単体テストの工程を多段階のステップに分けることは,一見すると開発作業の手間を増やしているように見えるが,ツールを効果的に活用して手作業の効率化を図り,テストの品質を向上させるために必要な手段である.ツールで機械的かつ網羅的にチェックできるところはツールに任せ,それに合格している前提で目視確認ができれば,目視で確認すべき項目や考慮すべき範囲を限定することができ,手作業によるテストを効率化することができる.ツールは単純なチェックしかできないが,網羅性と処理スピード,単純な見落としのなさにおいて優れている.一方,複数の項目間の関連や意味的な整合性を確認することは,人による目視の方が優れている.ツールによる自動化と人による目視をうまく組み合わせて手順やチェック内容を考慮することで,高い品質と効率的な作業を実現できる. リグレッションテスト 大規模なシステムでは内部の処理構造は複雑で相互に関係しており,一つのソースコードの修正が想定外の機能部分に影響して不具合となることもある.このため,テスト対象のソースコード,もしくは,そこから呼び出す先のモジュールのソースコードを修正した際には,リグレッションテストを実施する.特に業務共通ライブラリは,システム全体の整合性を考慮して設計仕様の変更や機能を追加することも多く,頻繁にソースコードが更新されるため,それらを呼び出すモジュールはその都度リグレッションテストを実施する必要がある. リグレッションテストでは初回のテストと同じテストを実施するが,初回テストとは検証のポイントが異なる.初回テストではテスト結果がテストケースの期待結果と一致するかを中心に検証するが,リグレッションテストでは再テストの結果と初回テストの結果を突き合わせて比較し,テスト結果に差異がないことを中心に検証する.図4にその概要を示す. このように,初回テストとリグレッションテストとで検証ポイントが違う理由は,テスト結果の検証作業の難易度にある. テストの実行結果の証跡は,データベース上の更新レコードやファイルに出力されたログ,画面に表示された情報である.これに対して,テストケースに定義された期待される実行結果は,システムが対象とする業務の知識やデータモデルの理解を前提とした文章で記述されており,これらを解釈してテストの結果証跡から合格であると判断するためには,付随する業務データも含めた確認作業と相応の業務知識を必要とし,テスト結果の検証は簡単な作業ではない.図 初回テストとリグレッションテストJava EE ベースの大規模開発における単体テストの実践的アプローチ (547)157158(548) リグレッションテストでは,初回テストで合格であると判定した結果証跡が揃っているため,これとリグレッションテスト時の結果証跡を突き合わせて比較することで,比較的容易にテスト結果を検証することができる. 大規模開発における課題と対応策 本章では,これまでに紹介した単体テストのアプローチを大規模システム開発で実践する上での課題とその対応策について示す. 大規模なシステム開発では,多くの開発者を必要とする物理設計とプログラミング,テストの工程において,必要なタイミングで必要な数の開発者を調達するプロジェクト制組織が導入されており,経験やスキルが異なる多くの開発者が同時並行で作業を進めることで様々な問題が発生する. 本稿で対象としている大規模なシステム開発の例として,実際のプロジェクトのプロフィールを表2に示す.表 大規模なシステム開発のプロフィール 本章では,こうした大規模なシステム開発プロジェクトにおいて,2章で述べた単体テストのアプローチを実践する上での課題を挙げて,その対応策を示す. 開発環境の統一 課題 多くの開発者が同時並行で作業を進める場合,開発者ごとの開発環境の差異に起因するトラブルが発生する. システムを構成する個々のソースコードは,開発者それぞれのPC上で実装して単体テストまで実施する.次に,それぞれの開発者が作成した膨大な数のソースファイルを最終的に一つの実行環境上に集めて結合テストを実施する.このとき,開発者ごとのPCの開発環境の違いによって,単体テストは通過したが,結合テストで不合格になることがある.ここでいう開発環境とは,開発者の各PC上でのフォルダ構成やシステム変数の設定値,Java EEの一般ライブラリや業務共通ライブラリのバージョンである.大規模な開発になると1年以上の開発期間を要するため,その間にミドルウェア製品のライブラリもバージョンアップされる.最近ではインターネット上から最新のライブラリをダウンロードできるが,プロジェクトとしては実績のある安定版を採用するケースもある. こうした開発環境の差異によってテスト結果にも違いが生じる場合がある.大規模開発で開発者が増えるほど,開発者ごとの開発環境に差異が生じることが多くなり,開発環境の違いにJava EEベースの大規模開発における単体テストの実践的アプローチ (549)159起因するトラブルも発生しやすくなる.開発環境に起因するトラブルは,多くの要素が複合的に関係した特殊な状況下で発生するために原因調査にも時間を要することが多い. 対応策 開発環境の設定手順や使用するツールやライブラリのバージョンをルールとして明文化して開発者に周知徹底するだけでなく,開発者のPC上の権限を制御して設定を変更できないようにしたり,外部メディアやインターネットの接続を制限するなど,自由にツールをインストールできないようにする対策も必要である. また,プロジェクト内で開発する業務共通ライブラリは,システム開発を続ける段階で仕様変更や不具合の修正によって更新され,定期的に配布される.このバージョン管理を徹底するとともに,配布と開発者のPCへの取り込み手順の簡易化,開発環境にインストールされているライブラリのバージョンをチェックするツールの提供などで,開発者の作業負担を減らす工夫が必要である. による自動テスト 課題 テストケースに従ってテスト対象のモジュールを呼び出して実行し,その実行結果を確認するようなテストでは,テストドライバを実装してEclipseからJUnitで実行するが,その実装と検証には以下に挙げる二つの課題がある. 一つ目の課題は,テストドライバの実装負荷である.一般に,入力値の組み合わせや内部の処理パターンは複数あり,一つのテスト対象に対してテストケースは複数存在する.このため,テストケースごとに作成するテストドライバのコード量は多くなり,テスト対象のモジュールを実装するよりも多くの工数を費やすこともある.リグレッションテストまで含めると,テストドライバを実装してJUnitでテストを自動化するメリットは大きいが,テストの準備には相応の手間がかかる. もう一つの課題はテストドライバの検証である.実装したテストドライバは,テスト対象のモジュールの仕様を正しくテストできるか,呼び出す際の入力値の作成や出力結果を検証するテストドライバのソースコードに不具合がないかを検証する必要がある.入力値のパターンや業務ロジックが比較的単純であればテストドライバの検証は容易だが,結果の値が単一ではなく,DB上の複数レコードの更新やログの出力,複雑なデータ構造のオブジェクトである場合には,テストドライバが正しいことの検証が難しくなる.テストドライバの検証を怠ると,テストケースを間違った仕様で実装し,JUnit上のテスト結果では合格だが,意図したテストを実施できていないテストケースが生じる. 大規模開発においては,必ずしも全ての開発者が対象の業務処理やデータに精通しているわけではなく,こうした誤り(テスト結果は正常であるが,テストの設計と実装が間違っている)が起きやすく,業務仕様に精通した要員によるテストドライバの検証が必要となる.しかし,テストドライバの検証には,JavaのプログラミングやJUnitの動作原理の知識も必要であり,開発チームの業務担当者や顧客側担当者には,テストドライバの検証はさらに難しいことになる.160(550) 対応策 一つ目の課題であるテストドライバの実装負荷については,特に有効な対応策はなく,開発スケジュールに反映させる必要がある.これを軽減するアイデアとして,テストケースの入出力情報の定義ファイルを読み込ませてJUnitを自動で実行させるツールが考えられる.そのようなツールができれば,開発者は入出力情報の定義ファイルの作成だけでテストが実行できるため,作業負荷は大幅に軽減される.テストケースには様々なパターンがあり,その全てに対応できるツールを作成することはできないが,一部のテストケースだけでもツールを適用することができれば,一定の効果は得られる. 次のテストドライバの検証の課題に対する対応策として,テスト証跡(入出力情報,DBダンプ,ログ)の検証に関しては,目視で確認することが挙げられる.目視による検証は大変な作業負荷にはなるが,検証者の多くにとって,テストドライバのソースコードを理解して確認するよりも,現実的で確実な方法である.さらに,テストドライバはテスト対象のモジュールを呼び出して実行するだけとなり,ソースコードの実装の手間も少なくなる. ただし,目視による作業を効率化するためには,以下のような作業を自動化するテスト作業支援ツールを提供する必要がある.・出力されたログの該当部分を切り出してファイルに保存する・結果画面のイメージをキャプチャしてファイルに保存する・テスト証跡を検証者が見やすい形に編集する・更新されたDBテーブルを対象に,差分のレコードを抽出する JUnitはテストを一括で実行するための仕組みとしては有効であり活用すべきだが,テスト設計や結果検証の作業品質を担保するためには,目視での検証と,それを考慮した仕組みが必要である. リグレッションテストの簡易化 課題 不具合や仕様変更によるコード修正が行われた場合,関連するモジュールのリグレッションテストを実施するが,大規模開発ではテスト対象のモジュール数と繰り返されるリグレッションテストの回数が多く,何回も繰り返されるリグレッションテストの度にひととおりのテストケースを手作業で実行していたのでは,テストの実施と結果検証に膨大な作業負荷がかかってしまう. 対応策 まず,リグレッションテストは極力,JUnit上で実行できるようにすべきである.そのためには,モジュール分割や入出力仕様の設計,ソースコード実装の段階からJUnitで実行できることを意識して進めるべきである.JUnit上で単体テストの実行を自動化するためには,テストドライバの実装など,いくつかの手間がかかるが,リグレッションテストを繰り返すことを考えると,単体テストの実行と集計が自動化されるメリットは大きい. 次に,テスト結果の検証作業を効率化させるための工夫も必要である.2章で述べた通り,リグレッションテストでは再テストの結果と前回のテスト結果を突合し,差異があるかを検証する.この検証作業のために,呼び出し引数や結果の構造体オブジェクトをダンプ出力する仕Java EEベースの大規模開発における単体テストの実践的アプローチ (551)161組みや,前回のテスト結果の証跡と今回の証跡とを比較してその差異を検出するツールを提供するなどの工夫が必要である. テストデータ 課題 テストの入力となる業務データの質は,テストの精度に大きな影響を与える. テストを実施するためには,マスターテーブル上のレコードや設定値などの定数,二次的に参照する業務データなど,テスト対象のモジュールを動作させるために必要な最低限の入力データを用意する必要がある.しかし,対象業務の知識や経験が豊富な開発者は少なく,開発者が想定する業務データと実際の業務データとは大きく違う場合がある.開発者の思い込みで作成した誤った業務データによるテストは意味がないばかりでなく,誤った業務処理を実装することにもなる.さらに,開発者がそれぞれ作成したテストデータが間違っていると,モジュール間の呼び出しインターフェイスで思わぬミスマッチを引き起こす. 対応策 基本的な業務処理を動作させるために必要な最小限の業務データのセットは,開発者がそれぞれ作成するのではなく,開発プロジェクト全体で用意して開発者に提供する必要がある.それぞれの開発者は提供された業務データのセットに対してデータを追加し,テストケースに応じて必要なバリエーションを増やしていく. 基本的な業務データのセットを共通で提供することは,開発者のテスト準備の作業を軽減するだけでなく,開発者の対象業務の理解を向上させることにもつながる. ただし,実際の業務データは顧客情報の漏洩にもつながるため,一部をマスキングしたデータやランダムに加工処理した業務データを使うことが一般的である. テストの証跡の電子化 課題 単体テストの実行結果の証跡には,テスト実行前後の画面の表示イメージやDB上のデータの差分,出力されたログなどがあり,大規模なシステム開発で全てのテストケースの証跡を集めて紙に印刷すると膨大な量になる.さらに開発現場では,多くの開発者が数少ないプリンタに同時に出力することで競合し,作業時間の無駄にもなる. 対応策 テスト結果の証跡はExcelファイルやPDF*2の電子ファイルとして開発環境のファイルサーバ上に決められたルールで保管することで,検証者は紙に印刷せずにPC上で確認することができる.PDFファイルで保存した証跡は,Acrobat*3の注釈機能により指摘内容をPDFファイル上に追記することができ,証跡の検証結果をチーム内で共有する上でも大きな効果がある.さらに,電子印鑑機能で検証完了時の検証印にも利用できる. テスト証跡を電子的に管理することで検索性が向上し,出力された業務データやログから該当箇所を容易に探すことができる.紙資源の節約と印刷時間をなくすだけでなく,それを活用して工夫することで作業効率の向上にもなる.162(552) お わ り に 近年のシステム開発においては,開発支援ツールやアーキテクチャの技術が進歩したことで,テストのアプローチも複雑になっている.2章で示したように,ツールと手作業をうまく組み合わせたテストの手順を定義し,アーキテクチャ上のモジュールの種類や特性を考慮してテストのアプローチを工夫する必要がある.ツールによるチェック作業の機械化やその自動化は作業効率の向上や単純ミスの防止といった恩恵をもたらす.しかし,ツールで確認できる範囲や検出できる不具合は限られており,ツールの恩恵を最大限に享受しつつ,手順化された手作業を的確に実施する必要がある. また,大規模なシステム開発では,多くの開発者が同時並行で作業することを前提に,開発環境やテストの検証方法,テストデータについて,テストの計画と準備が重要である.リグレッションテストの自動化やツールによる検証作業の支援は大きな効果があり,システム開発全体の品質と生産性に与える影響も大きいだけに,プロジェクトの状況に合せた実践的なアプローチが求められる. コンピュータの処理速度や記憶容量の向上は目覚しいものがあり,それに合わせて支援ツールや開発環境も急速に発展している.一昔前には想像もしなかったような開発手法を可能にしており,進化する開発技術にキャッチアップし,それを活用することを前提としたアプローチや開発環境を作り上げて改善していくことが,システムの品質と開発の生産性を向上させることにつながる.─────────* 1 MVC2は,JavaベースのWebアプリケーションを構築するための開発モデルである.Smalltalk-80(スモールトーク)で確立されたMVCモデルを基本としてJavaEEの技術要素に対応させ,システム内部構造をModel-View-Controllerに分けて実装する考え方を示している.* 2 PDFは,Adobe Systems社が開発した電子文書のフォーマットPortable Document For-matの略称である.同社が提供するソフトウェアAdobe Readerで参照できる.* 3 Acrobatは,Adobe Systems社が提供する,PDFファイルを編集するためのソフトウェアである.参考文献[1]G. J. Myers他,ソフトウェアテストの技法第2版,近代科学社,2006年8月[2]Kent Beck, Test Driven Development, Addison-Wesley Professional, Nov. 2002[3]Rick D. Craig他,体系的ソフトウェアテスト入門,日経BP社,2004年10月[4]ソフトウェア・テストPRESS Vol.1-4,技術評論社,2005年6月-2007年1月[5]大塚俊章,荻野富二夫,ソフトウェアテスト技術,ユニシス技報,日本ユニシス,Vol.27 No.2 通巻93号,2007年8月[6]新井敦,日本ユニシスにおける開発標準の策定と適用への取り組み,ユニシス技報,日本ユニシス,Vol.27 No.2 通巻93号,2007年8月[7]Mary Poppendieck,Tom Poppendieck,平鍋健児,高嶋優子,佐野建樹訳,リーンソフトウエア開発,日経BP社,2004年7月[8]Eclipse, /[9]CheckStyle, /[10]FindBugs, /執筆者紹介 二 木 隆 彰(Takaaki Futatsugi) 2007年日本ユニシス(株)入社.Java EEベースのシステム開発のアーキテクトとして,開発プロジェクトの技術支援を手がけている.現在,総合技術研究所OSSセンターに所属. 新 井 敦(Atsushi Arai) 1992年 筑波大学卒業.同年 日本ユニシス(株)入社.電力・ガス・通信の顧客システム構築を中心に,開発プロジェクトを手掛ける.情報処理技術者 アプリケーション・エンジニア.企業派遣により,早稲田大学大学院アジア太平洋研究科MOTコース(国際経営学修士課程)を2004年に卒業.現在,総合技術研究所OSSセンターに所属し,社内プロダクトの開発と,開発プロジェクトへの技術支援を担当.Java EEベースの大規模開発における単体テストの実践的アプローチ (553)163。
基于Java EE的网上商店后台系统开发外文译文
这些问题,降低生产效率。开发的XYZ框架已经从它的代码分离的结构,我们可以使用一个配置设置专门针对向发展。这减轻了我们担心外部系统的可用性,这是解决眼前的发展无关的需求。
开发的XYZ框架定义了两个配置设置:默认和独立。我们还可以自定义应用程序添加基于我们的项目需要额外的配置集。默认的配置设置连接使用定义在JNDI DataSource开发数据库。它以充分开发应用服务和道。独立的配置集是发展最为灵活的环境。这个配置集:(1)连接到一个本地安装的数据库或使用DriverManagerDataSource开发数据库;(2)使用弹簧的地方DataSourceTransactionManager事务管理;(3)充分利用开发应用服务和道;和(4)完全有线的Spring应用程序上下文可以运行和测试完全的应用服务器外面。
2.开发框架主要技术
2.1代码层和配置的分离
Web应用程序有不同的设计问题如介绍,业务逻辑,数据访问与安全。一个分离的设计问题分为不同的代码层具有几个优点:易于维护,实现良好的设计模式的能力,并且能够选择专门的工具和技术的具体问题。分离成一个项目层可以导致这些层之间的依赖关系。例如,一个使用案例涉及简单的数据录入和查询通常必须整合显示,业务逻辑和数据访问在一起以提供所需的功能。因此,必须有一个良好定义的策略来管理依赖关系。XYZ的框架相结合的开发设计模式,可重用的代码和配置文件,使尽可能容易。该框架采用控制弹簧的反转来管理依赖性。Spring框架[提供了一种方式来联系在一起,构成一个应用程序的对象。它实现了这一目标,在Spring应用程序上下文,这是一个管理对象之间的依赖关系的策略。Spring使用依赖注入和方法拦截技术介绍如下。
Java技术外文翻译文献
Java技术外文翻译文献(文档含中英文对照即英文原文和中文翻译)外文:Core Java™ Volume II–Advanced Features When Java technology first appeared on the scene, the excitement was not about a well-crafted programming language but about the possibility of safely executing applets that are delivered over the Internet (see V olume I, Chapter 10 for more information about applets). Obviously, delivering executable applets is practical only when the recipients are sure that the code can't wreak havoc on their machines. For this reason, security was and is a major concern of both the designers and the users of Java technology. This means that unlike other languages andsystems, where security was implemented as an afterthought or a reaction to break-ins, security mechanisms are an integral part of Java technology.Three mechanisms help ensure safety:•Language design features (bounds checking on arrays, no unchecked type conversions, no pointer arithmetic, and so on).•An access control mechanism that controls what the code can do (such as file access, network access, and so on).•Code signing, whereby code authors can use standard cryptographic algorithms to authenticate Java code. Then, the users of the code can determine exactly who created the code and whether the code has been altered after it was signed.Below, you'll see the cryptographic algorithms supplied in the java.security package, which allow for code signing and user authentication.As we said earlier, applets were what started the craze over the Java platform. In practice, people discovered that although they could write animated applets like the famous "nervous text" applet, applets could not do a whole lot of useful stuff in the JDK 1.0 security model. For example, because applets under JDK 1.0 were so closely supervised, they couldn't do much good on a corporate intranet, even though relatively little risk attaches to executing an applet from your company's secure intranet. It quickly became clear to Sun that for applets to become truly useful, it was important for users to be able to assign different levels of security, depending on where the applet originated. If an applet comes from a trusted supplier and it has not been tampered with, the user of that applet can then decide whether to give the applet more privileges.To give more trust to an applet, we need to know two things:•Where did the applet come from?•Was the code corrupted in transit?In the past 50 years, mathematicians and computer scientists have developed sophisticated algorithms for ensuring the integrity of data and for electronic signatures. The java.security package contains implementations of many of these algorithms. Fortunately, you don't need to understand the underlying mathematics to use the algorithms in the java.security package. In the next sections, we show you how message digests can detect changes in data files and how digital signatures can prove the identity of the signer.A message digest is a digital fingerprint of a block of data. For example, the so-called SHA1 (secure hash algorithm #1) condenses any data block, no matter how long, into a sequence of 160 bits (20 bytes). As with real fingerprints, one hopes that no two messages have the same SHA1 fingerprint. Of course, that cannot be true—there are only 2160 SHA1 fingerprints, so there must be some messages with the same fingerprint. But 2160is so large that the probability of duplication occurring is negligible. How negligible? According to James Walsh in True Odds: How Risks Affect Your Everyday Life (Merritt Publishing 1996), the chance that you will die from being struck by lightning is about one in 30,000. Now, think of nine other people, for example, your nine least favorite managers or professors. The chance that you and all of them will die from lightning strikes is higher than that of a forged message having the same SHA1 fingerprint as the original. (Of course, more than ten people, none of whom you are likely to know, will die from lightning strikes. However, we are talking about the far slimmer chance that your particular choice of people will be wiped out.)A message digest has two essential properties:•If one bit or several bits of the data are changed, then the message digest also changes.• A forger who is in possession of a given message cannot construct a fake message that has the same message digest as the original.The second property is again a matter of probabilities, of course. Consider the following message by the billionaire father:"Upon my death, my property shall be divided equally among my children; however, my son George shall receive nothing."That message has an SHA1 fingerprint of2D 8B 35 F3 BF 49 CD B1 94 04 E0 66 21 2B 5E 57 70 49 E1 7EThe distrustful father has deposited the message with one attorney and the fingerprint with another. Now, suppose George can bribe the lawyer holding the message. He wants to change the message so that Bill gets nothing. Of course, that changes the fingerprint to a completely different bit pattern:2A 33 0B 4B B3 FE CC 1C 9D 5C 01 A7 09 51 0B 49 AC 8F 98 92Can George find some other wording that matches the fingerprint? If he had been the proud owner of a billion computers from the time the Earth was formed, each computing a million messages a second, he would not yet have found a message he could substitute.A number of algorithms have been designed to compute these message digests. The two best-known are SHA1, the secure hash algorithm developed by the National Institute of Standards and Technology, and MD5, an algorithm invented by Ronald Rivest of MIT. Both algorithms scramble the bits of a message in ingenious ways. For details about these algorithms, see, for example, Cryptography and Network Security, 4th ed., by William Stallings (Prentice Hall 2005). Note that recently, subtle regularities have been discovered in both algorithms. At this point, most cryptographers recommend avoiding MD5 and using SHA1 until a stronger alternative becomes available.The Java programming language implements both SHA1 and MD5. The MessageDigest class is a factory for creating objects that encapsulate the fingerprinting algorithms. It has a static method, called getInstance, that returns an object of a class that extends the MessageDigest class. This means the MessageDigest class serves double duty:•As a factory class•As the superclass for all message digest algorithmsFor example, here is how you obtain an object that can compute SHA fingerprints:MessageDigest alg = MessageDigest.getInstance("SHA-1");(To get an object that can compute MD5, use the string "MD5" as the argument to getInstance.)After you have obtained a MessageDigest object, you feed it all the bytes in the message by repeatedly calling the update method. For example, the following code passes all bytes in a file to the alg object just created to do the fingerprinting:InputStream in = . . .int ch;while ((ch = in.read()) != -1)alg.update((byte) ch);Alternatively, if you have the bytes in an array, you can update the entire array at once:byte[] bytes = . . .;alg.update(bytes);When you are done, call the digest method. This method pads the input—as required by the fingerprinting algorithm—does the computation, and returns the digest as an array of bytes.byte[] hash = alg.digest();The program in Listing 9-15 computes a message digest, using either SHA or MD5. You can load the data to be digested from a file, or you can type a message in the text area.Message SigningIn the last section, you saw how to compute a message digest, a fingerprint for the original message. If the message is altered, then the fingerprint of the altered message will not match the fingerprint of the original. If the message and its fingerprint are delivered separately, then the recipient can check whether the message has been tampered with. However, if both the message and the fingerprint were intercepted, it is an easy matter to modify the message and then recompute the fingerprint. After all, the message digest algorithms are publicly known, and they don't require secret keys. In that case, the recipient of the forged message and the recomputed fingerprint would never know that the message has been altered. Digital signatures solve this problem.To help you understand how digital signatures work, we explain a few concepts from the field called public key cryptography. Public key cryptography is based on the notion of a public key and private key. The idea is that you tell everyone in the world your public key. However, only you hold the private key, and it is important that you safeguard it and don't release it to anyone else. The keys are matched by mathematical relationships, but the exact nature of these relationships is not important for us.The keys are quite long and complex. For example, here is a matching pair of public and private Digital Signature Algorithm (DSA) keys.Public key:Code View:p:fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a47e6df 63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17q: 962eddcc369cba8ebb260ee6b6a126d9346e38c5g:678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71fd7 3da179069b32e2935630e1c2062354d0da20a6c416e50be794ca4y:c0b6e67b4ac098eb1a32c5f8c4c1f0e7e6fb9d832532e27d0bdab9ca2d2a8123ce5a8018b8161 a760480fadd040b927281ddb22cb9bc4df596d7de4d1b977d50Private key:Code View:p:fca682ce8e12caba26efccf7110e526db078b05edecbcd1eb4a208f3ae1617ae01f35b91a47e6df 63413c5e12ed0899bcd132acd50d99151bdc43ee737592e17q: 962eddcc369cba8ebb260ee6b6a126d9346e38c5g:678471b27a9cf44ee91a49c5147db1a9aaf244f05a434d6486931d2d14271b9e35030b71fd73 da179069b32e2935630e1c2062354d0da20a6c416e50be794ca4x: 146c09f881656cc6c51f27ea6c3a91b85ed1d70aIt is believed to be practically impossible to compute one key from the other. That is, even though everyone knows your public key, they can't compute your private key in your lifetime, no matter how many computing resources they have available.It might seem difficult to believe that nobody can compute the private key from the public keys, but nobody has ever found an algorithm to do this for the encryption algorithms that are in common use today. If the keys are sufficiently long, brute force—simply trying all possible keys—would require more computers than can be built from all the atoms in the solar system, crunching away for thousands of years. Of course, it is possible that someone could come up with algorithms for computing keys that are much more clever than brute force. For example, the RSA algorithm (the encryption algorithm invented by Rivest, Shamir, and Adleman) depends on the difficulty of factoring large numbers. For the last 20 years, many of the best mathematicians have tried to come up with good factoring algorithms, but so far with no success. For that reason, most cryptographers believe that keys with a "modulus" of 2,000 bits or more are currently completely safe from any attack. DSA is believed to be similarly secure.Figure 9-12 illustrates how the process works in practice.Suppose Alice wants to send Bob a message, and Bob wants to know this message came from Alice and not an impostor. Alice writes the message and then signs the message digest with her private key. Bob gets a copy of her public key. Bob then applies the public key to verify thesignature. If the verification passes, then Bob can be assured of two facts:•The original message has not been altered.•The message was signed by Alice, the holder of the private key that matches the public key that Bob used for verification.You can see why security for private keys is all-important. If someone steals Alice's private key or if a government can require her to turn it over, then she is in trouble. The thief or a government agent can impersonate her by sending messages, money transfer instructions, and so on, that others will believe came from Alice.The X.509 Certificate FormatTo take advantage of public key cryptography, the public keys must be distributed. One of the most common distribution formats is called X.509. Certificates in the X.509 format are widely used by VeriSign, Microsoft, Netscape, and many other companies, for signing e-mail messages, authenticating program code, and certifying many other kinds of data. The X.509 standard is part of the X.500 series of recommendations for a directory service by the international telephone standards body, the CCITT.The precise structure of X.509 certificates is described in a formal notation, called "abstract syntax notation #1" or ASN.1. Figure 9-13 shows the ASN.1 definition of version 3 of the X.509 format. The exact syntax is not important for us, but, as you can see, ASN.1 gives a precise definition of the structure of a certificate file. The basic encoding rules, or BER, and a variation, called distinguished encoding rules (DER) describe precisely how to save this structure in a binary file. That is, BER and DER describe how to encode integers, character strings, bit strings, and constructs such as SEQUENCE, CHOICE, and OPTIONAL.译文:Java核心技术卷Ⅱ高级特性当Java技术刚刚问世时,令人激动的并不是因为它是一个设计完美的编程语言,而是因为它能够安全地运行通过因特网传播的各种applet。
【计算机专业文献翻译】在 JDK 早期版本中使用 Java 5 的语言特性
Using Java 5 language features in earlier JDK Java 5 added a number of powerful language features: generics, enumerations, annotations, autoboxing, and the enhanced for loop. However, many shops are still tied to JDK 1.4 or earlier and may be for some time to come. But it's still be possible for those developers to take advantage of these powerful language features while continuing to deploy on earlier JVMs. Brian Goetz returns from his hiatus in this installment of Java theory and practice to demonstrate how.With Java 6.0 being newly released, you might think the Java 5 language features are "old news." But even now, when I ask developers which version of the Java platform they are using in development, typically only half are using Java 5 -- and the other half are jealous. They are eager to use the language features added in Java 5 such as generics and annotations, but a number of factors still prevent many from doing so.One category of developers unable to take advantage of Java 5 features are those who develop components, libraries, or application frameworks. Because their customers may still be using JDK 1.4 or earlier and classes compiled with Java 5 cannot be loaded by JDK 1.4 or previous JVMs, using Java 5 language features would limit their customer base to companies that have already transitioned to Java 5.Another group of developers often held back from using Java 5 are those working with Java EE. Many shops will not use Java 5 with Java EE 1.4 or earlier for fear that it will not be supported by their application server vendor. But it may be a while before those shops transition to Java EE 5. In addition to the lag time between the Java EE 5 and Java SE 5 specifications, commercial Java EE 5 containers are not necessarily available as soon as the ink is dry on the specification, businesses do not necessarily upgrade theirapplications servers as soon as the next version is available, and even after upgrading their application server, it may take some time to certify their applications on the new platform.Java 5 language feature implementationThe language features added in Java 5 -- generics, enumerations, annotations, autoboxing, and the enhanced for loop -- required no change to the JVM instruction set, and are almost entirely implemented in the static compiler (javac) and class libraries. When the compiler encounters the use of generics, it attempts to verify that type safety is preserved (emitting an "unchecked cast" warning if it cannot) and then emits bytecode that is identical to what would be produced from equivalent nongeneric code, casts and all. Similarly, autoboxing and the enhanced for loop are simply "syntactic sugar" for equivalent, but more verbose, idioms, and enumerations are compiled into ordinary classes.In theory, you could take the class files produced by javac and load them in earlier JVMs, which was, in fact, the intention when JSR 14 (the Java Community Process working group responsible for generics) was convened. However, other issues (such as retention of annotations) forced the class file version to be changed between Java 1.4 and Java 5, which prevents code compiled for Java 5 to be loaded by earlier JVMs. Further, some of the language features added in Java 5 have dependencies on the Java 5 libraries. If you compile a class with javac -target 1.5 and try to load it on an earlier JVM, you'll get an UnsupportedClassVersionError because the -target 1.5 option generates classes with a class file version of 49, and JDK 1.4 only supports class file versions through 48.The for-each loopThe enhanced for loop, sometimes called the for-each loop, is translated by the compiler as if the programmer had supplied the equivalent old-stylefor loop. The for-each loop can iterate over the elements of an array or of a collection. Listing 1 shows the syntax of iterating over a collection with the for-each loop:Listing 1. The for-each loopCollection<Foo> fooCollection = ...for (Foo f : fooCollection) {doSomething(f);}The compiler translates this code into the equivalent iterator-based loop, as shown in Listing 2:Listing 2. Iterator-based equivalent for Listing 1for (Iterator<Foo> iter=f.iterator(); f.hasNext();) {Foo f = (Foo)iter.next();doSomething(f);}How does the compiler know that the supplied argument has an iterator() method? The architects of the javac compiler could have built in understanding of the collections framework, but this approach would have been unnecessarily restrictive. Instead, a new interface was created, ng.Iterable (see Listing 3), and the collection classes were retrofitted to implement Iterable. This way, container classes that do not build on the core collections framework can still take advantage of the new for-each loop. But doing so creates a dependency on the Java 5 class library because Iterable is not present in the JDK 1.4 library.Listing 3. The Iterable interfacepublic interface Iterable<T> {Iterator<T> iterator();}Enumerations and autoboxingJust like the for-each loop, enumerations require support from the class library. When the compiler encounters an enumerated type, it generates a class that extends the library class ng.Enum. But, just like Iterable, the Enum class is not present in the JDK 1.4 class library.Similarly, autoboxing relies on the valueOf() methods being added to the primitive wrapper classes (such as Integer). When boxing requires conversion from int to Integer, rather than calling new Integer(int), the compiler generates a call to Integer.valueOf(int). The implementation of the valueOf() methods employs the flyweight pattern to cache the Integer objects for commonly used integer values (the Java 6 implementation caches integers from -128 to 127), which may improve performance by eliminating redundant instantiations. And, just like Iterable and Enum, the valueOf() methods are not present in the JDK 1.4 class library.VarargsWhen the compiler encounters a method defined with a variable-length argument list, it converts it into a method that takes an array of the appropriate component type; when the compiler encounters a call to a method with a variable-length argument list, it boxes the arguments into an array.AnnotationsWhen an annotation is defined, it can be annotated with @Retention, which determines what the compiler will do with classes, methods, or fields that possess that annotation. The defined retention policies are SOURCE (discard annotation data at compilation), CLASS (record annotations in the class file),or RUNTIME (record annotations in the class file and retain them at runtime so they can be accessed reflectively).Other library dependenciesPrior to Java 5, when the compiler encountered an attempt to concatenate two strings, it used the helper class StringBuffer to perform the concatenation. In Java 5 and later, it instead generates calls to the new StringBuilder class, which is not present in the JDK 1.4 and earlier class libraries.Accessing Java 5 featuresBecause of dependencies of language features on library support, even if the class files produced by the Java 5 compiler could be loaded by earlier JVM versions, execution would still fail because of class loading errors. However, it should be possible to solve these problems by suitably transforming the bytecode because these missing classes do not contain substantial new functionality.JSR 14During the development of the Java generics specification (and other language features added in Java 5), experimental support was added to the javac compiler to allow it to consume Java 5 language features and generate bytecode that could be run on a Java 1.4 JVM. While these features are not supported (or even documented), they are used by a number of open source projects to allow developers to code using Java 5 language features and produce JAR files that can be used on earlier JVMs. And, now that javac is open source, it is possible the features might be supported by a third party. To activate these features, you can invoke javac with the -source 1.5 and -target jsr14 options.The JSR 14 target mode of javac causes the compiler to emit JDK 1.4-compatible bytecode corresponding to Java 5 language features:∙Generics and varargs: The casts inserted by the compiler in the presence of generics have no dependency on the class library, and so they can execute equally well on a pre-5 JVM. Similarly, the code generated by the compiler in the presence of variable-length argument lists has no dependency on the class library.∙for-each loop: When iterating over an array, the compiler generates an induction variable and the standard array iteration idiom. When iterating over a Collection, the compiler generates the standard iterator-based idiom. When iterating over a non-Collection Iterable, the compiler produces an error.∙Autoboxing: Rather than generating calls to the valueOf() method in the wrapper class, the compiler generates calls to the constructor instead.∙String concatenation: The JSR 14 target mode of javac causes the compiler to generate calls to StringBuffer instead of StringBuilder.∙Enumerations: The JSR 14 target mode of javac has no special support for enumerations. Code that attempts to use enumerations will fail with a NoClassDefFoundError looking for the ng.Enum base class.Using the JSR 14 target mode allows you to write code that uses generics, autoboxing, and the for-each loop in the "easy" cases, which may suffice for many projects. It is convenient, if unsupported, and the compiler generates mostly compatible bytecode in a single pass.RetroweaverThere are certain Java 5 language features not supported by the JSR 14 target mode (such as Iterable and enumerations). An alternate approach, taken by open-source projects such as Retroweaver and Retrotranslator, is to generate bytecode using -target 1.5 and then mechanically transform the bytecode into something compatible with JDK 1.4.Retroweaver came first, and it handled all the cases handled by javac -target JSR 14, and a few more:∙The for-each loop: Retroweaver provides an implementation of the Iterable interface and rewrites classes that implement Iterable to implement its own version instead.∙Autoboxing: Retroweaver rewrites calls to the valueOf() methods to the corresponding constructors.∙String concatenation: Retroweaver replaces use of StringBuilder with StringBuffer.∙Enumerations: Retroweaver provides an implementation of the Enum base class and rewrites classes that implement Enum or invoke its methods to use its own version instead.RetrotranslatorAs often happens in the open source world, if a project stops moving forward, it is declared dead and a new project takes its place -- even if it is just resting. Such was the fate of Retroweaver; the primary maintainer took a break from the project and another similar project, Retrotranslator, took its place. Retrotranslator offers the same features as Retroweaver, plus many additional features aimed at supporting important class library additions in Java 5:∙Replaces calls to java.util.concurrent classes to corresponding classes in the open-source JDK 1.4 backport.∙Provides implementations for features added to the collections framework in Java 5, such as the new methods in Arrays and Collections. Similarly, provides implementations of other new methods and classes added to the class library in Java 5.∙Supports runtime reflection for annotations.Both Retroweaver and Retrotranslator can perform their bytecode transformation statically (at compile time) or dynamically (at class-load time).在 JDK 早期版本中使用 Java 5 的语言特性Java 5 添加了许多强大的语言特性:泛型、枚举、注释、自动装箱和增强的 for 循环。
毕业论文外文资料翻译-J2ME和Java领域
Java 2 Micro Edition and the World of Java1 、IntroductionThe computer revolution of the 1970s increased the demand for sophisticated computer software to take advantage of the ever-increasing capacity of computers to process data. The C programming language became the linchpin that enabled programmers to build software that was just as robust as the computer it ran on.As the 1980s approached, programmers were witnessing another spurt in the evolution of programming language. Computer technology advanced beyond the capabilities of the C programming language. The problem wasn’t new. It occurred previously and caused the demise of generations of programming languages. The problem was that programs were becoming too complicated to design, write, and manage to keep up with the capabilities of computers. It was around this time that a design concept based on Simula 67 and Smalltalk (from the late 1960s) moved programming to the next evolutionary step. This was the period when object-oriented programming (OOP), and with it a new programming language called C++, took programmers by storm.2、Enter JavaJust as C++ was becoming the language of choice for building industrial-strength applications, another growth spurt in the evolution of programming language was budding, fertilized by the latest disruptive technology—the World Wide Web. The Internet had been a well-kept secret for decades before the National Science Foundation (who oversaw the Internet) removed barriers that prevented commercialization. Until 1991 when it was opened to commerce, the Internet was the almost exclusive domain of government agencies and the academic community. Once the barrier to commercialization was lifted, the World Wide Web—one of several services offered on the Internet— became a virtual community center where visitors could get free information about practically anything and browse through thousands of virtual stores.The success of the Internet gave renewed focus to developing a machine-independent programming language. And the same year the Internet was commercialized, five technologists at Sun Microsystems set out to do just that. James Gosling, Patrick Naughton, ChrisWarth, Ed Frank, and Mike Sheridan spent 18 months developing the programming language they called Oak, which was renamed Java when this new language made its debut in 1995. Java went through numerous iterations between 1991 and 1995, during which time many other technologists at Sun made substantial contributions to the language. These included Bill Joy, Arthur van Hoff, Jonathan Payne, Frank Yelin, and Tim Lindholm.Although Java is closely associated with the Internet, it was developed as a language for programming software that could be embedded into electronic devices regardless of the type of CPU used by the device. This is known as the Embedded Java platform and is in continuous use today for closed systems.The Java team from Sun succeeded in creating a portable programming language, something that had eluded programmers since computers were first programmed. Their success, however, was far beyond their wildest dreams. The same concept used to make Java programs portable to electronic devices also could be used to make Java programs run on computers running Microsoft Windows, UNIX, and Macintosh. Timing was perfect. The Internet/intranet had whetted corporate America’s appetite for cost-effective, portable programs that could replace mission-critical applications within the corporation. And Java had proven itself as a programming language used to successfully develop machine-independent applications.3 、Java Virtual MachineWriting Java programs is similar to writing C++ programs in that the programmer writes source code that contains instructions into an editor, or in an integrated development environment, and then the source code is compiled. However, that’s where Java and C++ part ways. Th e compiling and linking process of a C++ program results in an executable that can be run on an appropriate machine. In contrast, the Java compiler converts Java source code into bytecode that is executed by the Java Virtual Machine (JVM).Machine-specific instructions are not included in bytecode. Instead, they already reside in the JVM, which is machine specific. This means that the bytecode might contain fewer instructions that need to be translated than a comparable C++ program.Although the Java compiler generates bytecode that must be interpreted by the JVM at run time, the number of instructions that need translation are usually minimal and have already been optimized by the Java compiler.4 、Back to the Future: J2MERemember that Java began as a programming language to create programs for embedded systems—microcomputers found in consumer and industrial products such as those used to control automobiles and appliances. The development team at Sun worked on Java in the early 1990s to address the programming needs of the fledgling embedded computer market, but that effort was sidetracked by more compelling opportunities presented by the Internet.As those opportunities were addressed, a new breed of portable communications devices opened other opportunities at the turn of the century. Cell phones expanded J 2 M E : The Complete Reference from voice communications devices to voice and text communications devices. Pocket electronic telephone directories evolved into personal digital assistants. Chipmakers were releasing new products at this time that were designed to transfer computing power from a desktop computer into mobile small computers that controlled gas pumps, cable television boxes, and an assortment of other appliances.5、J2ME and Wireless DevicesWith the dramatic increase and sophistication of mobile communications devices such as cell phones came demand for applications that can run on those devices.Consumers and corporations want to expand mobile communications devices from voice communications to applications traditionally found on laptops and PCs. They want to send and receive email, store and retrieve personal information, perform sophisticated calculations, and play games.Developers, mobile communications device manufacturers, and mobile network providers are anxious to fill this need, but there is a serious hurdle: mobile communications devices utilize a number of different application platforms and operating systems. Without tweaking the code, an application written for one device cannot run on another device.Mobile communications devices lack a standard application platform and operating system, which has made developing applications for mobile communications devices a risky economic venture for developers. The lack of standards is nothing new to computing or to any developing technology.Traditionally, manufacturers of hardware devices try to corner the market and enforce their own proprietary standard as the de facto standard for the industry. Usually one upstart succeeds, as in the case of Microsoft. Other times, industry leaders form a consortium, such as the Java Community Process Program, to collectively develop a standard.The Wireless Application Protocol (WAP) forum became the initial industry group that set out to create standards for wireless technology. Ericsson, Motorola, Nokia, and Unwired Planet formed the WAP forum in 1997, and it has since grown to include nearly all mobile device manufacturers, mobile network providers, and developers. The WAP forum created mobile communications device standards referred to as the WAP standard.The WAP standard is an enhancement of HTML, XML, and TCP/IP. One element of this standard is the Wireless Markup Language specification, which consists of a blend of HTML and XML and is used by developers to create documents that can be displayed by a microbrowser. A microbrowser is a diminutive web browser that operates on a mobile communications device.The WAP standard also includes specifications for a Wireless Telephony Application Interface (WTAI) specification and the WMLScript specification. WTAI is used to create an interface for applications that run on a mobile communications device. WMLScript is a stripped-down version of JavaScript.6、J2ME applicationsJ2ME applications referred to as a MIDlet can run on practically any mobile communications device that implements a JVM and MIDP. This encourages developers to invest time and money in building applications for mobile communications devices without the risk that the application is device dependent. However, J2ME isn’t seen as a replacement for the WAP specification because both are complementary technologies. Developers whose applications are light-client based continue to use WML and WMLScript. Developers turn to J2ME for heavier clients that require sophisticated processing on the mobile communications device.Author: Mike·JamesJ2ME和Java领域1.介绍20世纪70年代以来,随着计算机革命的开始,以及对计算机先进软件需求的大大增加,采取利用电脑日益增加的功能来处理数据。
Java编程语言外文翻译、英汉互译、中英对照
文档从互联网中收集,已重新修正排版,word格式支持编辑,如有帮助欢迎下载支持。
外文翻译原文及译文学院计算机学院专业计算机科学与技术班级学号姓名指导教师负责教师Java(programming language)Java is a general-purpose, concurrent, class-based, object-oriented computer program- -ming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java applications are typically compiled to byte code (class file) that can run on any Java virtual machine(JVM) regardless of computer architecture. Java is, as of 2012, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1991 and first released in 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.Java is a set of several computer software products and specifications from Sun Microsystems (which has since merged with Oracle Corporation), that together provide a system for developing application software and deploying it in across-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones on the low end, to enterprise servers and supercomputers on the high end. While less common, Java appletsare sometimes used to provide improved and secure functions while browsing the World Wide Web on desktop computers.Writing in the Java programming language is the primary way to produce code that will be deployed as Java bytecode. There are, however, byte code compilers available forother languages such as Ada, JavaScript, Python, and Ruby. Several new languages have been designed to run natively on the Java Virtual Machine (JVM), such as Scala, Clojure and Groovy.Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C. Java eliminates certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.An edition of the Java platform is the name for a bundle of related programs from Sun that allow for developing and running programs written in the Java programming language. The platform is not specific to any one processor or operating system, but rather an execution engine (called a virtual machine) and a compiler with a set of libraries that are implemented for various hardware and operating systems so that Java programs can run identically on all of them. The Java platform consists of several programs, each of which provides a portion of its overall capabilities. For example, the Java compiler, which converts Java source code into Java byte code (an intermediate language for the JVM), is provided as part of the Java Development Kit (JDK). The Java Runtime Environment(JRE), complementing the JVM with a just-in-time (JIT) compiler, converts intermediate byte code into native machine code on the fly. An extensive set of libraries are also part of the Java platform.The essential components in the platform are the Java language compiler, the libraries, and the runtime environment in which Java intermediate byte code "executes" according to the rules laid out in the virtual machine specification.In most modern operating systems (OSs), a large body of reusable code is provided to simplify the programmer's job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependent on any specific operating system, applications cannot rely on any of the pre-existing OS libraries. Instead, the Java platform provides a comprehensive set of its own standard class libraries containing much of the same reusable functions commonly found in modern operating systems. Most of the system library is also written in Java. For instance, Swing library paints the user interface and handles the events itself, eliminatingmany subtle differences between how different platforms handle even similar components.The Java class libraries serve three purposes within the Java platform. First, like other standard code libraries, the Java libraries provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. Second, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily intertwined with the distinctive implementations of each platform. The and java.io libraries implement an abstraction layer in native OS code, then provide a standard interface for the Java applications to perform those tasks. Finally, when some underlying platform does not support all of the features a Java application expects, the class libraries work to gracefully handle the absent components, either by emulation to provide a substitute, or at least by providing a consistent way to check for the presence of a specific feature.The success of Java and its write once, run anywhere concept has led to other similar efforts, notably the .NET Framework, appearing since 2002, which incorporates many of the successful aspects of Java. .NET in its complete form (Microsoft's implementation) is currently only fully available on Windows platforms, whereas Java is fully available on many platforms. .NET was built from the ground-up to support multiple programming languages, while the Java platform was initially built to support only the Java language, although many other languages have been made for JVM since..NET includes a Java-like language called Visual J# (formerly named J++) that is incompatible with the Java specification, and the associated class library mostly dates to the old JDK 1.1 version of the language. For these reasons, it is more a transitional language to switch from Java to the .NET platform, than a first class .NET language. Visual J# was discontinued with the release of Microsoft Visual Studio 2008. The existing version shipping with Visual Studio 2005will be supported until 2015 as per the product life-cycle strategy.In June and July 1994, after three days of brainstorming with John Gage, the Director of Science for Sun, Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt, the team re-targeted the platform for the World Wide Web. They felt that with the advent of graphical web browsers like Mosaic, the Internet was on its way to evolving into the samehighly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small browser, Web Runner (named after the movie Blade Runner), later renamed Hot Java.That year, the language was renamed Java after a trademark search revealed that Oak was used by Oak Technology. Although Java 1.0a was available for download in 1994, the first public release of Java was 1.0a2 with the Hot Java browser on May 23, 1995, announced by Gage at the Sun World conference. His announcement was accompanied by a surprise announcement by Marc Andreessen, Executive Vice President of Netscape Communications Corporation, that Netscape browsers would be including Java support. On January 9, 1996, the Java Soft group was formed by Sun Microsystems to develop the technology.Java编程语言Java是一种通用的,并发的,基于类的并且是面向对象的计算机编程语言,它是为实现尽可能地减少执行的依赖关系而特别设计的。
Guide to Documenting Cost and Performance for Remediation Projects
Guide to DocumentingCost and Performancefor Remediation ProjectsPrepared by Member Agencies of theFederal Remediation Technologies RoundtableU.S. Environmental Protection AgencyDepartment of DefenseU.S. Air ForceU.S. ArmyU.S. NavyDepartment of EnergyDepartment of InteriorMarch 1995NOTICEThis document has been subjected to administrative review by all Agencies participating in the Federal Remediation Technologies Roundtable, and has been approved for publication. Mention of trade names or commercial products does not constitute endorsement or recommendation for use.FOREWORDThe purpose of this Guide is to foster the use of consistentprocedures to document cost and performance information for projects involving treatment of contaminated media. In short, it provides site remediation project managers with a standardized set of parameters to document completed remediation projects. Standard reporting of data will broaden the utility of the information,increase confidence in the future effectiveness of remedial technologies, andenhance the organization, storage, and retrieval of relevant information.Through greater coordination, Federal Agencies hope to improve data collectionand dissemination, and thus to increase the effectiveness of hazardous waste cleanups.This Guide was developed by the Federal Remediation Technologies Roundtable (the Roundtable). The Roundtable was created to exchange informationon hazardous waste site remediation technologies, to consider cooperative effortsof mutual interest, and to develop strategies leading to a greater application of innovative technologies. Roundtable member Agencies, including the U.S. Environmental Protection Agency (EPA), the U.S. Department of Defense (DoD), the U.S. Department of Energy (DOE), and the U.S. Department of the Interior (DOI), expect to complete many site remediation projects in the near future. TheseAgencies recognize the importance of documenting the results from these cleanups,and the benefits to be realized from greater coordination of such efforts between Agencies.The Roundtable established an Ad Hoc Cost and Performance Work Group, formed with representatives from government Agencies, professional associations,and public interest groups, to improve the documentation of future remediation projects. A goal of the Work Group was to determine what information would be practical and useful to specify for inclusion in all reports. This Guide is theresult of several Work Group meetings held in 1993 and 1994. The primary contributors to this effort are listed at the end of this report.Walter W. Kovalick, Jr., Ph.D.ChairmanFederal Remediation Technologies RoundtableThis page intentionally left blank.TABLE OF CONTENTSPage 1.0INTRODUCTION (1)1.1Background (1)1.2Overview of the Guide (3)2.0RECOMMENDED PROCEDURES (5)2.1Standard Terminology (5)2.1.1Site Background (5)2.1.2Site Characteristics (6)2.1.3Treatment System (6)2.1.4Example (6)2.2Parameters Affecting Cost or Performance (7)2.3Measurement Procedures (8)2.3.1Example (8)2.4Standardized Cost Breakdown (9)2.4.1Example (12)2.5Performance (13)3.0IMPLEMENTATION AND FUTURE CONSIDERATIONS (19)BIBLIOGRAPHY (43)APPENDIX ASite Background: Historical Activity That Generated Contamination -Examples of SIC Codes Most Likely to Apply to Contaminated Sites (47)Work Breakdown Structure and Historical Cost Analysis System (51)Ad Hoc Work Group Members - Cost and Performance Information (53)Federal Remediation Technologies Roundtable Member Roster (55)LIST OF TABLESPage 1Site Background: Waste Management Practice ThatContributed to Contamination (21)2Media to be Treated (22)3Contaminant Groups (22)4Primary Treatment Systems (23)5Supplemental Treatment Systems (23)6Suggested Parameters to Document Full-ScaleTechnology Applications: Matrix CharacteristicsAffecting Treatment Cost or Performance (24)7Suggested Parameters to Document Full-ScaleTechnology Applications: Operating ParametersAffecting Treatment Cost or Performance (26)8Matrix Characteristics: Measurement Proceduresand Potential Effects on Treatment Cost orPerformance (28)9Operating Parameters: Measurement Procedures andPotential Effects on Treatment Cost or Performance (33)10Interagency Work Breakdown Structure CostElements - Second Level (38)LIST OF EXHIBITSPage 1Example for Reporting Standard Terminology (7)2Example for Reporting Matrix CharacteristicsAffecting Treatment Cost or Performance andAssociated Measurement Procedures (9)3Example for Reporting Operating ParametersAffecting Treatment Cost or Performance (9)4Second Level Work Breakdown Structure CostElements (10)5Fifth Level Work Breakdown Structure Cost Elements (11)6Example for Reporting Site Remediation ProjectCosts (12)7Types of Treatment Technology Performance-RelatedInformation (13)8Example for Reporting Performance Information foran Ex Situ Project (15)9Example for Reporting Untreated and TreatedContaminant Concentrations (16)10Example for Reporting Residuals Data (16)11Example for Reporting Performance Information foran In Situ Project (17)12Example for Reporting Untreated and TreatedContaminant Concentrations and ContaminantRemovals (18)This page intentionally left blank.1.0INTRODUCTIONThis Guide provides the recommended procedures for documenting results from completed full-scale hazardous waste site remediation projects. The Guide was developed by the Federal Remediation Technologies Roundtable (the Roundtable) to more effectively coordinate the activities of its member Agenciesand to assist in capturing their experience from these projects. Roundtablemember Agencies include the U.S. Environmental Protection Agency (EPA), the U.S. Department of Defense (DoD), the U.S. Department of Energy (DOE), and the U.S. Department of the Interior (DOI).1.1BackgroundFederal Agencies are involved in a variety of activities to improvethe efficiency of their remediation efforts. These activities include theevaluation of new and improved treatment technologies through field demonstration projects. For example, Federal and State Agencies are participating in sevendifferent demonstration programs to test new processes with the hope of expediting their acceptance in the marketplace. These demonstration projects are designed as technical evaluations of treatment technologies and involve extensive datacollection and documentation.In addition, Federal and State Agencies are now participating in the remediation of hazardous waste sites using both conventional and innovative technologies. These full-scale cleanups also present an important opportunity to gather data. The projects may entail documenting the achievement of prescribed cleanup goals or other contract objectives. Currently, the contents of project documentation vary widely and much of the first-hand experience of project personnel is not routinely documented.The Roundtable Agencies recognize the value of the data and experience gained from these full-scale cleanups and agree that gathering cost and performance information for remedial technologies should be a priority. At a Roundtable meeting in May 1993, an Ad Hoc Work Group was established to assess the potential for coordinating efforts of the separate Agencies in this area. ThisWork Group has met four times to review relevant ongoing Federal efforts, toidentify information needs, and to develop a strategy for coordinating the documentation of cost and performance information. During these meetings, which were open to the public, the Work Group participants discussed issues concerning documentation of cost and performance data and reviewed preliminary draftreporting formats. In addition, the Work Group reviewed draft agency reports to identify areas for potential standardization.DoD, DOE, and EPA have efforts underway to document full-scale remediation projects. Their reports provide a primary source of cost andperformance data and include information on matrix characteristics, treatment system design and operation, and observations and lessons learned in cost and performance. EPA prepared summary reports using a standardized reporting format for 17 remediation projects completed at Superfund sites. EPA's reports document cost and performance for innovative technologies such as bioremediation, soilvapor extraction, thermal desorption, and soil washing. DoD and DOE prepared cost and performance summaries for 21 remediation projects. Although DoD's and DOE's reports have a consistent set of topics, the content of each topic is structured ona site-specific basis. The emphasis of these reports is to produce a document with signed certifications from the Remedial Project Manager(s) representing EPA,State Agencies, and other pertinent organizations, and also to provideinformation to facilitate future permitting and the development of presumptive remedies.The Work Group concluded that a coordinated and consistent approach to the collection of data across all Agencies would broaden the utility of the information, increase confidence in the future effectiveness of remedial technologies, and enhance the organization, storage, and retrieval of relevant information. The Work Group also concluded that each Agency should be free to determine the overall format for their reports on completed projects, as iscurrently being done. As a result, the Work Group identified specific subjectareas with the greatest potential for use in a standardized report format, and thatare most relevant to technology analysts. Specific benefits of the interagencyeffort to coordinate information collection and documentation include:Establishing a baseline for future data gathering and reportpreparation;Assisting in remedy selection by allowing a project manager toconsider previous technology applications on sites withsimilar characteristics;Allowing a more meaningful comparison of technologyperformance, including assessments of potential presumptiveremedies, by providing consistent soil characteristics andoperating conditions;Supporting improved cost comparisons and projections throughthe use of a standard work breakdown structure; andEnsuring a minimum level of reporting quality by specifyingdocumentation objectives for test and measurement procedures.1.2Overview of the GuideThis Guide presents recommended procedures for documenting cost and performance information by Roundtable Agencies. In addition to standard terminology, the basic information types include waste characteristics andoperating parameters that affect the cost or performance of different technologies, measurement procedures, standardized cost breakdown, and treatment technology performance. These topics are discussed in Section 2.0. Following the discussion of each topic, an example is provided as a practical illustration ofreport format.The recommended documentation procedures are relatively simple and straight-forward. The parameters were chosen because they are practical and useful, and the requested information will be relevant to future projects duringthe remedy selection process. The procedures were developed especially for full-scale projects to help realize the benefits associated with consistent and uniformdata collection and documentation.This Guide addresses both conventional and innovative treatment technologies, but does not include capping or other containment processes. Conventional technologies are included in this Guide because there is still muchto learn from the application of these processes at hazardous waste sites. In addition, information on conventional technologies serves as a useful baseline against which the data from innovative technologies can be compared.While developing this Guide, the notion of "minimum data sets" caused some confusion. To clarify, it is preferable to consider the recommended procedures as constituting desirable data sets. The information should not beviewed as minimum requirements for adequate documentation or, for that matter, for responsible remedy selection. Further, collection of only the data recommended in Section 2.0 may not be adequate to satisfy all project-specific data requirements.For example, most project reports will include narrative site descriptions,lessons learned, and timelines; however, the format for these presentations isleft to the individual Agencies.Section 3.0 of this Guide provides implementation considerations anda description of future work group activities.This page intentionally left blank.2.0RECOMMENDED PROCEDURESThis section contains recommended procedures for documenting the following cost and performance information for completed site remediation projects:Standard terminology;Waste characteristics and operating parameters affectingtreatment cost or performance;Measurement procedures;Standardized cost breakdown; andPerformance.Tables noted in the text may be found at the end of this Guide.2.1Standard TerminologyThe use of standard terminology to describe site background, site characteristics, and treatment systems will facilitate the storage and retrievalof information, including the future use of electronic search routines. The parameters were chosen to highlight important features of the remediation projects, so that they can be used in the future as keywords for site screening.For each parameter, the Guide proposes corresponding terms as possible descriptors.2.1.1Site BackgroundSite background information is necessary to describe the historical activity that generated the contamination and the waste management practices that contributed to the contamination. Historical activities that generated contamination may be described using the 4-digit Standard Industrial Classification (SIC) Code that best represents the historical activityresponsible for the contamination at a site. Appendix A shows examples of SIC codes most likely to apply to contaminated sites. These examples were derived from the SIC Codes identified by the Superfund program to be most closely associated with contaminated sites. For the purpose of this Guide, some additional codes have been created to address activities not described by current SIC codes. Four-digit SIC codes are described in the Standard Industrial Classification Manual, published by the Office of Management and Budget, and available for sale from the National Technical Information Service, order no. PB87-100012. Common terminology for waste management practices that contribute to contamination areshown in Table 1, which was derived from the Vendor Information System for Innovative Treatment Technologies (VISITT) and DoD's Installation Restoration Program (IRP).2.1.2Site CharacteristicsSite characteristic information is necessary to describe the type of media (matrix) processed by the treatment system, the types of contaminants treated, and the characteristics of the matrix (described in Section 2.2).Terms that describe the type of media treated are presented in Table 2. These terms were derived from information in EPA's VISITT database and the interagency Work Breakdown Structure (WBS).Contaminant groups that were treated may be described using the terminology presented in Table 3. The terminology was derived from information in EPA's VISITT database, EPA's Superfund Land Disposal Restrictions (LDR) 6A/6B Guides, and the WBS. Specific contaminants treated within each contaminant group should also be identified (as well as the concentrations of those contaminants inthe untreated matrix). The groups shown in Table 3 were selected because they are widely recognized terms. However, the groupings are not an exhaustive list for all contaminants.2.1.3Treatment SystemTreatment technology information is necessary to identify theprimary and supplemental systems (i.e., pretreatment, post-treatment, andprocess augmentation) used in a site remediation project. Tables 4 and 5 list common terminology for treatment technologies, which were derived from EPA's VISITT database and from the Remediation Technologies Screening Matrix and Reference Guide, July 1993, prepared jointly by EPA and the Air Force.2.1.4ExampleAn example application of the recommended procedures for standard terminology to a specific project (cleanup of the T H Agriculture & Nutrition (THAN) Company Superfund Site in Albany, Georgia) is presented below in Exhibit 1:Exhibit 1: Example for Reporting Standard Terminology Site Background:Historical Activity that Generated ContaminationSIC Code: 2879 (Pesticides and Agricultural Chemicals, Not Elsewhere Classified)Management Practices that Contributed to ContaminationStorage - Drums/Containers (storage, formulation, and distribution of pesticides)Site Characteristics:Media TreatedSoil (ex situ)Contaminants TreatedHalogenated Organic Pesticides/Herbicides (including the following constituents:4,4'-DDT, toxaphene, BHC-alpha, and BHC-beta)Treatment System:Primary Treatment TechnologyThermal DesorptionSupplemental Treatment TechnologyPretreatment (Solids) - ScreeningPost-Treatment (Air) - Baghouse, Quench, Air Cooler, Induced Draft Fan, Carbon Adsorption, CondenserPost-Treatment (Solids) - QuenchPost-Treatment (Water) - Carbon Adsorption2.2Parameters Affecting Cost or PerformanceTechnology cost or performance is affected by waste characteristics and treatment technology operating conditions. Tables 6 and 7 list, on a technology-specific basis, the waste characteristics and operating conditionsthat should be documented for several of the most common site remediation technologies. These parameters define desirable information which may help to guide formulation of future field sampling programs during site remediation. These parameters were selected because they affect a technology's cost and performance and also because they are commonly measured in practice. The parameters represent standard data sets which will allow a consistent comparisonof various applications of a particular technology.Other items besides matrix characteristics and operating conditions are important to document because of their potential impact on cost or performance, as shown on Table 6. These include the type and concentration of contaminants, quantity of material treated, cleanup goals or requirements, and environmental setting. For example, for in situ technologies, geologic and hydrogeologic characterizations should be included in project documentation.The parameters listed in Tables 6 and 7 represent the key factors which would be of most value to project managers who are trying to apply results from a completed cleanup to their own particular site. The collection ofadditional parameters will be decided on a site-specific basis and should be included in the project documentation. Tables 8 and 9 provide additional information on the methods used to measure each parameter shown in Tables 6 and 7, and on each parameter's potential effect on cost or performance (i.e., the reasonswhy the parameters affecting cost or performance are important).In addition, because costs are typically reported in terms of dollarsper cubic yard or per ton of soil treated, the Work Group recommends that the bulk density of soil be included in documentation for ex situ soil remediation projects (e.g., as shown on Table 6 for thermal desorption). This information will allowfor comparisons of project costs in terms of costs per cubic yard and per ton ofsoil treated.2.3Measurement ProceduresDocumentation of measurement procedures for many of the matrix characteristics and operating parameters is important to allow a more meaningful comparison of results among projects. It is especially important to document measurement procedures when there are different methods available or when less standardized procedures are used for measuring an individual parameter (e.g., for clay content). The use of different methods or less standardized procedures may lead to variability in results and, therefore, should be considered in cross-project comparisons. Tables 8 and 9 identify which measurement procedures are recommended for documentation.2.3.1ExampleAn application of the recommended procedures for reporting parameters affecting cost or performance to a specific project (cleanup of theRocky Mountain Arsenal, Operable Unit 18, in Commerce City, Colorado using soil vapor extraction) is presented in Exhibits 2 and 3. In Exhibits 2 and 3, measurement procedures are shown for some parameters but not others. As shown on Tables 8 and 9 of the Guide, measurement procedures should be documented for those parameters whose results may vary due to method variability (e.g., for permeability).Exhibit 2: Example for Reporting Matrix Characteristics Affecting Treatment Cost or Performance and Associated Measurement Procedures Parameter Value Measurement ProcedureSoil Types0-35 ft. below ground surface (BGS): Particle Size Analysis: ASTM Method (Soil poorly graded sand (SP), poorly D422-63classificati graded sand with gravel (SP), andon and clay poorly graded sand with silt (SP-content)SM).35.5 ft. BGS: lean clay with sand(CL).55 ft. BGS: poorly graded sand (SP)Moisture 4.7 to 30.9%Gravimetric Analysis: ASTM Method Content D2216-90Air0 to 38 ft. BGS: 167 darcys Vacuum readings were taken at five-Permeability 55 ft. BGS: 2,860 darcys minute intervals from P-7B and VES-4during the system start-up until steadystate conditions were observed. Vacuumreadings at each location were plottedagainst the natural log of time. Theslope and y-intercept of each plot wereused in a Johnson et al., 1990, equationto predict soil permeability to air flow. Porosity Not Measured---Total Organic Not Measured---CarbonNon-Aqueous No evidence of NAPLs within operable Not ReportedPhase Liquids unit.(NAPLs)Exhibit 3: Example for Reporting Operating Parameters AffectingTreatment Cost or PerformanceParameter Value Measurement Procedure Air Flow Rate145 to 335 cfm (total for two extraction N/A*wells)Operating Vacuum0 to 30 inches of water N/A**N/A - Not applicable. See Table 9. Standard measurement procedures for air flow rate and operatingvacuum are available.2.4Standardized Cost BreakdownAn interagency group has developed a standardized work breakdown structure (WBS), which includes five levels of detail for the types of cost elements. Project cost documentation should follow the interagency WBS to the extent possible; documentation of treatment costs to the fifth level of detail is desirable and should be provided whenever possible. In addition, the documentation should identify unit costs and number of units for each cost element, as appropriate. The use of the WBS format will facilitate comparison of costs across projects, and the detailed breakout will help support extrapolationof costs to future applications. The second level WBS cost elements, which relateto the treatment processes, are shown in Exhibit 4, and further described in Table 10. The cost elements are grouped by when the activity occurs--before, during, or after treatment.Exhibit 4: Second Level Work Breakdown Structure Cost Elements Interagency WBS #Cost ElementBefore Treatment Cost Elements33 01Mobilization and Preparatory Work33 02Monitoring, Sampling, Testing, and Analysis33 03Site Work33 05Surface Water Collection and Control33 06Groundwater Collection and Control33 07Air Pollution/Gas Collection and Control33 08Solids Collection and Containment33 09Liquids/Sediments/Sludges Collection and Containment33 10Drums/Tanks/Structures/Miscellaneous Demolition and RemovalTreatment Cost Elements33 11Biological Treatment33 12Chemical Treatment33 13Physical Treatment33 14Thermal Treatment33 15Stabilization/Fixation/EncapsulationAfter Treatment Cost Elements33 17Decontamination and Decommissioning (D&D)33 18Disposal (other than Commercial)33 19Disposal (Commercial)33 20Site Restoration33 21Demobilization33 9X Other (use numbers 90-99)The third level of the WBS identifies 68 specific types of treatment processes. The fourth level of the WBS is used to distinguish between portable and permanent treatment units. For portable treatment units, the fifth level of theWBS identifies 12 specific cost elements directly associated with treatment, as shown in Exhibit 5.Exhibit 5: Fifth Level Work Breakdown Structure Cost Elements Interagency WBS #33 XX XX 01-Portable Unit Treatment Cost Element01Solids Preparation and Handling - Includes loading/unloading,screening, grinding, pulverizing, mixing, moisture control, andplacement/disposal.02Liquid Preparation and Handling - Includes collection/storage(equalization), separation, treatment, and release/disposal (POTW,surface discharge).03Vapor/Gas Preparation and Handling - Includes collection/storage,separation, treatment, and release/disposal.04Pads/Foundations/Spill Control - May include materials andconstruction of facilities.05Mobilization/Setup - May include activities needed to prepare forstartup.06Startup/Testing/Permits - May include activities needed to beginoperation.07Training - May include training needed to operate equipment.08Operation (Short Term - Up to 3 Years) - Includes bulk chemicals/rawmaterials, fuel and utility usage, and maintenance and repair.09Operation (Long Term - Over 3 Years) - Includes bulk chemicals/rawmaterials, fuel and utility usage, and maintenance and repair.10Cost of Ownership - May include amortization, leasing, profit, andother fees not addressed elsewhere.11Dismantling - May include activities needed prior to demobilization.12Demobilization - May include removal of unit.For permanent treatment units, the fifth level of the WBS identifies 10 specific cost elements, 8 of which are identical to the cost elements described above for portable units. For permanent units, item 05 (Mobilization/Setup) is replaced by Construction of Plant, which includes architectural, structural, mechanical, electrical, equipment fabrication/purchase, and equipmenterection/installation. Items 10 through 12 are replaced with a new item 10, Mothballing, which may include costs for deactivating the treatment unit.For Before Treatment and After Treatment Cost Elements, documentation to the second level of detail is adequate, while actual TreatmentCost Elements should be provided to the fifth level if possible.The WBS format will be used in the future as part of federalprocurements for site remediation services. Data collected through use of the WBSwill be stored electronically in a Historical Cost Analysis System (HCAS). The documentation of projects using the WBS and the storage of this data in HCASprovides a mechanism for comparison of costs among documented remediationprojects and also between other projects in the HCAS system. Additionalinformation on the WBS and HCAS is presented at the end of this Guide.2.4.1ExampleAn application of the recommended procedures for a land treatment application at the Brown Wood Preserving Superfund site is presented in Exhibit 6.This example shows before and after treatment costs at the second level of the WBS,and costs directly associated with treatment at the fifth level of the WBS. It alsoshows unit costs for appropriate cost elements.Exhibit 6: Example for Reporting Site Remediation Project CostsCost Element($)No. of Units Cost ($)Unit CostBefore Treatment Costs Mobilization and Preparatory Work- mobilization of equipment,9,827lump sum9,827 material,and personnelSite Work- site preparation4,781.16/ac 5 acres23,906re- fence22,610lump sum22,610 Solids Collection and Containment- stockpile soil0.53/cu. yd3,200 cu.1,696ydsTreatmentCost Elements Solids Preparation and Handling- spread contaminated soil 2.77/cu. yd3,200 cu.8,864ydsMobilization/Setup- installation of clay liner 3.23/cu. yd7,000 cu.22,610yds- installation of subsurface68,062lump sum68,062 drainagenetwork- construction of perimeter 3.29/ft2,000 ft6,580 containment berms- shape retention pond3,293lump sum3,293。
【毕业论文】JAVA相关毕业论文外文翻译
【毕业论文】JAVA相关毕业论文外文翻译在当今的计算机科学领域,Java 语言一直占据着重要的地位。
随着技术的不断发展,越来越多的研究成果以英文文献的形式呈现,这使得外文翻译在 Java 相关的毕业论文中变得至关重要。
Java 作为一种面向对象的编程语言,具有许多独特的特性和优势。
例如,它的跨平台性使得开发者能够在不同的操作系统上运行相同的代码,大大提高了程序的可移植性。
在外文文献中,对于 Java 跨平台性的实现原理和技术细节有着深入的探讨。
一篇典型的 Java 相关外文文献可能会涉及到 Java 虚拟机(JVM)的工作机制。
JVM 是 Java 实现跨平台的核心组件,它将 Java 字节码解释或编译为特定平台的机器码。
通过翻译这类文献,我们能够更清晰地理解JVM 如何在内存管理、垃圾回收以及优化执行等方面发挥作用。
在面向对象编程的概念中,Java 的类、对象、继承、多态等特性是研究的重点。
外文文献可能会从更深入的角度分析这些特性的实现方式,以及它们如何影响程序的设计和性能。
例如,关于继承和多态在大型项目中的应用案例和最佳实践,能够为我们提供宝贵的参考。
另外,Java 的并发编程也是一个热门的研究方向。
外文文献中可能包含先进的并发模型、线程同步机制以及并发工具类的详细介绍。
这对于开发高并发、高性能的 Java 应用程序具有重要的指导意义。
在进行外文翻译时,准确理解专业术语是关键。
例如,“synchronization”(同步)、“concurrency”(并发)、“thread pool”(线程池)等术语需要准确无误地翻译,并在上下文中保持一致。
同时,对于复杂的句子结构和长段落,需要仔细分析语法和逻辑关系,以确保翻译的准确性和流畅性。
翻译不仅仅是语言的转换,更是对知识的传递和理解。
对于一些具有特定文化背景或特定行业约定的表述,需要进行适当的解释和说明,以便读者能够更好地理解。
此外,不同类型的 Java 相关外文文献在翻译时也有不同的侧重点。
JAVA外文文献+翻译
Java and the InternetIf Java is, in fact, yet another computer programming language, you may question why it is so important and why it is being promoted as a revolutionary step in computer programming、The answer isn’t immediately obvious if you’re comin g from a traditional programming perspective、Although Java is very useful for solving traditional stand-alone programming problems, it is also important because it will solve programming problems on the World Wide Web、1.Client-side programmingThe Web’s in itial server-browser design provided for interactive content, but the interactivity was completely provided by the server、The server produced static pages for the client browser, which would simply interpret and display them、Basic HTML contains simple mechanisms for data gathering: text-entry boxes, check boxes, radio boxes, lists and drop-down lists, as well as a button that can only be programmed to reset the data on the form or “submit” the data on the form back to the server、This submission passes through the Common Gateway Interface (CGI) provided on all Web servers、The text within the submission tells CGI what to do with it、The most common action is to run a program located on the server in a directory that’s typically called “cgi-bin、” (If you watch the address window at the top of your browser when you push a button on a Web page, you can sometimes see “cgi-bin” within all the gobbledygook there、) These programs can be written in most languages、Perl is a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardless of processor or operating system、Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with it、However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is also the problem ofresponse time、The response of a CGI program depends on how much data must be sent, as well as the load on both the server and the Internet、(On top of this, starting a CGI program tends to be slow、) The initial designers of the Web did not foresee how rapidly this bandwidth would be exhausted for the kinds of applications people developed、For example, any sort of dynamic graphing is nearly impossible to perform with consistency because a GIF be created and moved from the server to the client for each version of the graph、And you’ve no doubt had direct experience with something as simple as validating the data on an input form、You press the submit button on a page; the data is shipped back to the server; the server starts a CGI program that discovers an error, formats an HTML page informing you of the error, and then sends the page back to you; you must then back up a page and try again、Not only is this slow, it’s inelegant、The solution is client-side programming、Most machines that run Web browsers are powerful engines capable of doing vast work, and with the original static HTML approach they are sitting there, just idly waiting for the server to dish up the next page、Client-side programming means that the Web browser is harnessed to do whatever work it can, and the result for the user is a much speedier and more interactive experience at your Web site、The problem with discussions of client-side programming i s that they aren’t very different from discussions of programming in general、The parameters are almost the same, but the platform is different: a Web browser is like a limited operating system、In the end, you must still program, and this accounts for the dizzying array of problems and solutions produced by client-side programming、The rest of this section provides an overview of the issues and approaches in client-side programming、2、Plug-insOne of the most significant steps forward in client-side programming is the development of the plug-in、This is a way for a programmer to add new functionality to the browser by downloading a piece of code that plugs itself intothe appropriate spot in the browser、It tells the browser “from now on you can perform this new activity、” (You need to download the plug-in only once、) Some fast and powerful behavior is added to browsers via plug-ins, but writing a plug-in is not a trivial task, and isn’t something you’d want to do as part of the process of building a particular site、The value of the plug-in for client-side programming is that it allows an expert programmer to develop a new language and add that language to a browser without the permission of the browser manufacturer、Thus, plug-ins provide a “back door” that allows the creation of new client-side programming languages (although not all languages are implemented as plug-ins)、3、Scripting languagesPlug-ins resulted in an explosion of scripting languages、With a scripting language you embed the source code for your client-side program directly into the HTML page, and the plug-in that interprets that language is automatically activated while the HTML page is being displayed、Scripting languages tend to be reasonably easy to understand and, because they are simply text that is part of an HTML page, they load very quickly as part of the single server hit required to procure that page、The trade-off is that your code is exposed for everyone to see (and steal)、Generally, however, you aren’t doing amazingly sophistica ted things with scripting languages so this is not too much of a hardship、This points out that the scripting languages used inside Web browsers are really intended to solve specific types of problems, primarily the creation of richer and more interactive graphical user interfaces (GUIs)、However, a scripting language might solve 80 percent of the problems encountered in client-side programming、Your problems might very well fit completely within that 80 percent, and since scripting languages can allow easier and faster development, you should probably consider a scripting language before looking at a more involved solution such as Java or ActiveX programming、The most commonly discussed browser scripting languages are JavaScript (which has nothing to do wit h Java; it’s named that way just to grab some ofJava’s marketing momentum), VBScript (which looks like Visual Basic), and Tcl/Tk, which comes from the popular cross-platform GUI-building language、There are others out there, and no doubt more in development、JavaScript is probably the most commonly supported、It comes built into both Netscape Navigator and the Microsoft Internet Explorer (IE)、In addition, there are probably more JavaScript books available than there are for the other browser languages, and some tools automatically create pages using JavaScript、However, if you’re already fluent in Visual Basic or Tcl/Tk, you’ll be more productive using those scripting languages rather than learning a new one、(You’ll have your hands full dealing with the W eb issues already、)4、JavaIf a scripting language can solve 80 percent of the client-side programming problems, what about the other 20 percent—the “really hard stuff?” The most popular solution today is Java、Not only is it a powerful programming language built to be secure, cross-platform, and international, but Java is being continually extended to provide language features and libraries that elegantly handle problems that are difficult in traditional programming languages, such as multithreading, database access, network programming, and distributed computing、Java allows client-side programming via the applet、An applet is a mini-program that will run only under a Web browser、The applet is downloaded automatically as part of a Web page (just as, for example, a graphic is automatically downloaded)、When the applet is activated it executes a program、This is part of its beauty—it provides you with a way to automatically distribute the client software from the server at the time the user needs the client software, and no sooner、The user gets the latest version of the client software without fail and without difficult reinstallation、Because of the way Java is designed, the programmer needs to create only a single program, and that program automatically works with all computers that have browsers with built-in Java interpreters、(This safely includes the vast majority of machines、) Since Java is a full-fledged programming language, you can do asmuch work as possible on the client before and after making requests of the server、For example, you won’t need to send a request form across the Internet to discover that you’ve gotten a date or some other parameter wrong, and your client computer can quickly do the work of plotting data instead of waiting for the server to make a plot and ship a graphic image back to you、Not only do you get the immediate win of speed and responsiveness, but the general network traffic and load on servers can be reduced, preventing the entire Internet from slowing down、One advanta ge a Java applet has over a scripted program is that it’s in compiled form, so the source code isn’t available to the client、On the other hand, a Java applet can be decompiled without too much trouble, but hiding your code is often not an important issue、Two other factors can be important、As you will see later in this book, a compiled Java applet can comprise many modules and take multiple server “hits” (accesses) to download、(In Java 1、1 and higher this is minimized by Java archives, called JAR files, that allow all the required modules to be packaged together and compressed for a single download、) A scripted program will just be integrated into the Web page as part of its text (and will generally be smaller and reduce server hits)、This could be important to the responsiveness of your Web site、Another factor is the all-important learning curve、Regardless of what you’ve heard, Java is not a trivial language to learn、If you’re a Visual Basic programmer, moving to VBScript will be your fastest solution, and since it will probably solve most typical client/server problems you might be hard pressed to justify learning Java、If you’re experienced with a scripting language you will certainly benefit from looking at JavaScript or VBScript before committing to Java, since they might fit your needs handily and you’ll be more productive sooner、to run its applets withi5、ActiveXTo some degree, the competitor to Java is Microsoft’s ActiveX, although it takes a completely different approach、ActiveX was originally a Windows-onlysolution, although it is now being developed via an independent consortium to become cross-platform、Effectively, ActiveX says “if your program connects to its environment just so, it can be dropped into a Web page and run under a browser that supports ActiveX、” (IE directly supports ActiveX and Netscape does so using a plug-in、) Thus, ActiveX does not constrain you to a particular language、If, for example, you’re already an experienced Windows programmer using a language such as C++, Visual Basic, or Borland’s Delphi, you can create ActiveX components with almost no changes to your programming knowledge、ActiveX also provides a path for the use of legacy code in your Web pages、6、SecurityAutomatically downloading and running programs across the Internet can sound like a virus-builder’s dream、ActiveX especially brings up the thorny issue of security in client-side programming、If you click on a Web site, you might automatically download any number of things along with the HTML page: GIF files, script code, compiled Java code, and ActiveX components、Some of these are benign; GIF files can’t do any harm, and scripting languages are generally limited in what they can do、Java was also designed to run its applets within a “sandbox” of safety, wh ich prevents it from writing to disk or accessing memory outside the sandbox、ActiveX is at the opposite end of the spectrum、Programming with ActiveX is like programming Windows—you can do anything you want、So if you click on a page that downloads an ActiveX component, that component might cause damage to the files on your disk、Of course, programs that you load onto your computer that are not restricted to running inside a Web browser can do the same thing、Viruses downloaded from Bulletin-Board Systems (BBSs) have long been a problem, but the speed of the Internet amplifies the difficulty、The solution seems to be “digital signatures,” whereby code is verified to show who the author is、This is based on the idea that a virus works because its creator can be anonymous, so if you remove the anonymity individuals will beforced to be responsible for their actions、This seems like a good plan because it allows programs to be much more functional, and I suspect it will eliminate malicious mischief、If, however, a program has an unintentional destructive bug it will still cause problems、The Java approach is to prevent these problems from occurring, via the sandbox、The Java interpreter that lives on your local Web browser examines the applet for any untoward instructions as the applet is being loaded、In particular, the applet cannot write files to disk or erase files (one of the mainstays of viruses)、Applets are generally considered to be safe, and since this is essential for reliable client/server systems, any bugs in the Java language that allow viruses are rapidly repaired、(It’s worth noting that the browser software actually enforces these security restrictions, and some browsers allow you to select different security levels to provide varying degrees of access to your system、)You might be skeptical of this rather draconian restriction against writing files to your local disk、For example, you may want to build a local database or save data for later use offline、The initial vision seemed to be that eventually everyone would get online to do anything important, but that was soon seen to be impractical (although low-cost “Internet appliances” might someday satisfy the needs of a significant segment of users)、The solution is the “signed applet” that uses public-key encryption to verify that an applet does indeed come from where it claims it does、A signed applet can still trash your disk, but the theory is that since you can now hold the applet creator accountable they won’t do vicious things、Java provides a framework for digital signatures so that you will eventually be able to allow an applet to step outside the sandbox if necessary、Digital signatures have missed an important issue, which is the speed that people move around on the Internet、If you download a buggy program and it does something untoward, how long will it be before you discover the damage? It could be days or even weeks、By then, how will you track down the program that’s done it? And what good will it do you at that point?7、Internet vs、intranetThe Web is the most general solution to the client/server problem, so it makes sense that you can use the same technology to solve a subset of the problem, in particular the classic client/server problem within a company、With traditional client/server approaches you have the problem of multiple types of client computers, as well as the difficulty of installing new client software, both of which are handily solved with Web browsers and client-side programming、When Web technology is used for an information network that is restricted to a particular company, it is referred to as an intranet、Intranets provide much greater security than the Internet, since you can physically control access to the servers within your company、In terms of training, it seems that once people understand the general concept of a browser it’s much easier for them to deal with differences in the way pages and applets look, so the learning curve for new kinds of systems seems to be reduced、The security problem brings us to one of the divisions that seems to be automatically forming in the world of client-side programming、If your program is running on the Internet, you don’t know what platform it will be working under, and you want to be extra careful that you don’t disseminate buggy code、You need something cross-platform and secure, like a scripting language or Java、If you’re running on an intranet, you might have a different set of constraints、It’s not uncommon that your machines could all be Intel/Windows platforms、On an intranet, you’re responsible for the quality of your own code and can repair bugs when they’re discovered、In addition, you might already have a body of legacy code that you’ve been using in a more traditional client/server approach, whereby you must physically install client programs every time you do an upgrade、The time wasted in installing upgrades is the most compelling reason to move to browsers, because upgrades are invisible and automatic、If you are involved in such an intranet, the most sensible approach to take is the shortest path that allows you to use your existing code base, rather than trying to recode your programs in a new language、When faced with this bewildering array of solutions to the client-side programming problem, the best plan of attack is a cost-benefit analysis、Consider the constraints of your problem and what would be the shortest path to your solution、Since client-side programming is still programming, it’s always a good idea to take the fastest development approach for your particular situation、This is an aggressive stance to prepare for inevitable encounters with the problems of program development、8、Server-side programmingThis whole discussion has ignored the issue of server-side programming、What happens when you make a request of a server? Most of the time the request is simply “send me this file、” Your browser then interprets the some appropriate fashion: as an HTML page, a graphic image, a Java applet, a script program, etc、A more complicated request to a server generally involves a database transaction、A common scenario involves a request for a complex database search, which the server then formats into an HTML page and sends to you as the result、(Of course, if the client has more intelligence via Java or a scripting language, the raw data can be sent and formatted at the client end, which will be faster and less load on the server、) Or you might want to register your name in a database when you join a group or place an order, which will involve changes to that database、These database requests must be processed via some code on the server side, which is generally referred to as server-side programming、Traditionally, server-side programming has been performed using Perl and CGI scripts, but more sophisticated systems have been appearing、These include Java-based Web servers that allow you to perform all your server-side programming in Java by writing what are called servlets、Servlets and their offspring, JSPs, are two of the most compelling reasons that companies who develop Web sites are moving to Java, especially because they eliminate the problems of dealing with differently abled browsers、9、separate arena: applicationsMuch of the brouhaha over Java has been over applets、Java is actually a general-purpose programming language that can solve any type of problem—at least in theory、And as pointed out previously, there might be more effective ways to solve most client/server problems、When you move out of the applet arena (and simultaneously release the restrictions, such as the one against writing to disk) you enter the world of general-purpose applications that run standalone, without a Web browser, just like any ordinary program does、Here, Java’s strength is not only in its portability, but also its programm ability、As you’ll see throughout this book, Java has many features that allow you to create robust programs in a shorter period than with previous programming languages、Be aware that this is a mixed blessing、You pay for the improvements through slower execution speed (although there is significant work going on in this area—JDK 1、3, in particular, introduces the so-called “hotspot” performance improvements)、Like any language, Java has built-in limitations that might make it inappropriate to solve certain types of programming problems、Java is a rapidly evolving language, however, and as each new release comes out it becomes more and more attractive for solving larger sets of problems、Java与因特网既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它就是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不就是很明显。
Java程序设计教程英文版第五版课程设计
Java Programming Tutorial, 5th Edition Course Design IntroductionJava is a widely used programming language which is known for its ability to run on a variety of platforms. In this course design, we will go through the essentials of Java programming. The course is designed based on the 5th edition of the Java Programming Tutorial, which is an introductory text for Java programming. The course will cover the basics of Java programming and introduce you to some advanced concepts. By the end of the course, you should be able to write basic Java programs.ObjectivesThe objectives of the course are to:•Introduce students to Java programming language.•Teach basic programming concepts.•Teach students to write, test, and debug Java programs.•Introduce students to more advanced Java concepts such as object-oriented programming.Course OverviewThe course is divided into several sections which cover various topics such as:•Introduction to Java programming language.•Variables and data types.•Control statements.•Methods.•Arrays.•Classes and Objects.•Inheritance.•Polymorphism.•Exceptions and IO.Each chapter will have a set of exercises to test your understanding of the content covered. At the end of each chapter, you will work on a practical project. The project will test your skills and enable you to put into practice what you have learned in the chapter.PrerequisitesThe course assumes that you have some basic knowledge of programming. You should have prior experience with any programming language such as C or C++. You should also be familiar with fundamental programming concepts such as variables, loops, condition statements, and functions.Course DesignCourse DurationThe course is designed to be completed in 4 weeks. You are expectedto spend at least 2 hours per day studying the course.Course MaterialsThe course materials consist of:•The Java Programming Tutorial, 5th Edition.•Eclipse, an Integrated Development Environment (IDE) used for coding in Java programming language.•Java Documentation, which includes the API reference for Java.Course StructureThe course will be delivered through the following methods: •Online lectures: You will be provided with online video lectures that expln the content of each chapter.•Textbook reading: You will be required to read the relevant chapters from the Java Programming Tutorial before starting each week’s lesson.•Workshops: There will be workshops where you will practice writing Java code and work on projects based on the contentcovered in each chapter.•Assessment: You will be assessed through an online quiz and the completion of a project for each chapter.Course AssessmentYour progress in the course will be assessed through online quizzes and projects. The quizzes will test your knowledge and understanding of the course content. The projects will give you the opportunity to apply what you have learned.Course OutcomesBy the end of the course, you will be able to:•Understand the basics of Java programming language.•Develop simple Java programs.•Debug and test Java programs.•Understand and use Object-Oriented Programming concepts in Java.ConclusionIn conclusion, this course on Java programming provides a comprehensive course material that will enable learners to write basic Java programs. The course is designed based on the 5th edition of the Java Programming Tutorial, and students will be required to work through a set of exercises and a project to test their understanding of the topics covered. At the end of the course, the students will have the basic knowledge required to write simple Java programs and be able to apply Object-Oriented Programming concepts in Java.。
ABSTRACT Shared-State Sampling
Shared-State Sampling∗Frederic Raspall,Sebastia Sallent and Josep YuferaDept.of T elematics,T echnical University of Catalonia(UPC)fredi@entel.upc.es,sallent@entel.upc.es,yufera@entel.upc.esABSTRACTWe present an algorithm,Shared-State Sampling(S3),forthe problem of detecting largeflows in high-speed networks.While devised with different principles in mind,S3turns outto be a generalization of two existing algorithms tackling thesame problem:Sample-and-Hold and Multistage Filters.S3is found to outperform its predecessors,with the advantageof smoothly adapting to the memory technology available,tothe extent of allowing a partial implementation in DRAM.S3exhibits mild tradeoffs between the different metrics of in-terest,which greatly benefits the scalability of the approach.The problem of detecting frequent items in streams appearsin other areas.We also compare our algorithm with pro-posals appearing in the context of databases and regardedsuperior to the aforementioned.Our analysis and experi-mental results show that,among those evaluated,S3is themost attractive and scalable solution to the problem in thecontext of high-speed network measurements.Categories and Subject Descriptors:C.2.3[Computer-Communication Networks]:Network Operations—traffic mea-surement,identifying largeflowsGeneral Terms:Algorithms,MeasurementKeywords:Per-flow measurements,scalability1.INTRODUCTIONNetwork measurements are essential for a number of net-work management tasks like traffic engineering[5],the de-tection of hot-spots or DoS attacks[11]or accounting.Withintraffic measurements,the per-flow approach provides a rea-sonable tradeoffbetween the amount of information acquiredand its usefulness[16].Unfortunately,the major drawbackof the per-flow approach is its lack of scalability:link speedsimprove100%per year,while the speed of memory devicesimproves at a much slower pace(7−9%)[2].The onlymemory technology that can keep up with the increasingand Muthukrishnan[1]propose algorithms able to iden-tify hot items in databases in a single pass while allowing for deletions.To the best of our knowledge,Sample-and-Hold(S&H)and Multistage Filters(MF)[2],while show-ing some similarities with previous work in the context of databases[6],were thefirst algorithms proposed in the con-text of network measurements.[10][8][9]address related problems,but their focus is not on detecting largeflows.In what follows,we summarize the ideas behind the proposals that we compare with,while reviewing the problem at hand. S&H and MF aim at identifying,within the total traffic present in some measurement interval1,largeflows,defined as those with size above some threshold(such as T bytes) or above some fraction of the total(e.g.z=1%).Flows are understood as sets of packets with common properties. The specific properties considered,the so-calledflow defini-tion or pattern,is application-specific2.Given aflow defini-tion,eachflow is uniquely identified by the specific values the properties within the definition take,what is called the flow identifier(FID)or key.The idea in S&H and MF is the following:there can be at most1/z largeflows in a mea-surement interval.Thus,if these can be identified,small but fast memories can be used to individually track suchflows by keeping a dedicated entry in the so-calledflow memory: not only small but fast memories suffice but also,accuracy is improved since bytes arriving after detection are exactly counted.Further,the amount of measurement data to report is drastically reduced.This is a paradigm shift compared to previous techniques(e.g.Sampled NetFlow),that use large (but slow)DRAM memories and alleviate the gap between link and memory bandwidth through sampling.In both al-gorithms,flows are challenged to instantiate entries in the flow memory according to their size.S&H does this by means of sampling and is memoryless and random:flows must be sampled once to get detected.On the contrary,MF is deterministic and stateful:flows must increase some coun-ters beyond some threshold before entering theflow memory. S2and LC in[7]resemble S&H and MF in that,once item types(i.e.flows)are identified,dedicated entries are supported,which get updated with subsequent occurrences of such types.LC splits the stream intofixed-length buckets where items either update or instantiate entries.In addition, entries for infrequent items are pruned at bucket boundaries. S2prunes entries at the end of variable-length buckets and only sampled items instantiate entries,where the sampling rate varies over the length of the stream.LC and S2relax the challenge put onflows to enter theflow memory so as to improve accuracy and compensate the increased number of enries occupied by means of pruning.Hence,the challenge put onflows is not only entering but also remaining at the synopsis structure.While both algorithms have been sug-gested to outperform S&H and MF,no evaluation with real traffic traces has,to our knowledge,ever been conducted. An ideal algorithm should report,at the end of a mea-surement interval,the FID and size of only thoseflows above the threshold.Less ideal algorithms may fail in three ways: i)missing to report some largeflows(false negatives)ii)samples altogether and an entry for this flow is created in the flow memory;otherwise,the counters get incremented to remember the number of samples taken so far.That is,our algorithm counts the number of times flows get sampled and entries in the flow memory should only be created for flows sampled d times.We refer to d as the sample threshold .The way in which samples are obtained and counted is explained in what follows,together with the supporting analysis.4.ANALYSIS OF OUR ALGORITHM4.1The "single-flow"caseLet us start analyzing what happens in case there were only one flow.Suppose that the algorithm sampled every byte with probability p and that samples from a flow incre-mented ”some”counter until d samples were taken.Sam-pling each byte with probability p ,the first d −1samples will increment the counter and the d th sample (if there)will get to the flow memory.Clearly,the flow will not be detected if fewer than d samples from it are taken.Hence,the detectionprobability for a flow of size v bytes,P ∞det (v ),is the proba-bility that we take at least d samples had we sampled all of its bytes (the ∞superindex shall later become clear).Since each byte is independently sampled,the number of samples that we would take,N v ,is a binomial r.v.and we can writeP ∞det (v )=P {N v ≥d }=v X j =dv j!p j (1−p )v −j (1)Alternatively:the number of bytes that pass before we get the first sample is a geometric (p )r.v.Thus,the number of bytes that go before the d th sample is taken,S d ,is the sum of d i.i.d geometric r.v.,which has a negative binomial distribution.Therefore,the probability that a flow of size v ≥d gets detected is the probability that the number of bytes required to take d samples be no larger than v .Think of bytes as attempts to get a sample:a flow is detected if fewer attempts than the available,v ,suffice to get d samples.The probability that it takes exactly j attempts until the d thsample is obtained is P {S d =j }=`j −1d −1´p d (1−p )j −d ,where j ≥d .Thus,if v <d ,the detection probability for a flow is 0andP ∞det (v )=P {S d ≤v }=v X j =dj −1d −1!p d (1−p )j −d (2)if v ≥d .Let us see what the role of the sample thresholdis.The first observation is that,for d =1,only one sam-ple is needed to capture a flow.Further,no counters are required (no previous sample needs to be ”remebered ”)and P ∞det (v )in (1)and (2)become 1−(1−p )v ,which is the de-tection probability with S &H since,then,both algorithms are identical.Clearly,the detection probability for a flow decreases when we increase d for the same p ,since more samples from the flow are required.This is shown in fig.1(bottom-right)which plots P ∞det (v )for different values of d .The key ob-servation is that,as d increases,P ∞det(v )has an inflection point as compared to the curve of S &H ,which does not have it regardless of p .Let us see what happens if p is cho-sen depending on d .If each byte is sampled with probability p and d samples from a flow are required,the flow will be detected,on the average,after d 1p=1˜p .The detection probability for a flow of V cutbytes is approximately 0.63for ”small”values of d .In these terms,(3)can be written as p =dV cut)d will always be smaller than d .Thus,the probabil-ity of the most likely values of N v shall not be included in P {N v ≥d },thereby yielding a low detection probability.Conversely,if v >V cut ,vp =(vaverage number of samples that would be taken from a flow of size V cut .4.2The inflection point,the ideal algorithmWe shall now justify why V cut is an inflection point .Specif-ically,the following discussion shows that,if p =d/V cut ,selectivity in S 3improves as we increase d ,in that the de-tection probability for a flow increases if v >V cut ,decreases if v <V cut and remains approximately constant if v =V cut .Let N v,d be the number of bytes sampled from a flow with v bytes when each is sampled with probability p =dσN v,d<d −E {N v,d }V cutin the expectationand variance of N v,d ,P ∞det (v )can be approximated by1−ΦsV cut −d“V cut −v v”!(5)The square root in (5)monotonically increases in d .If v <V cut ,the term in parentheses is positive.Hence,increasing d ,the argument of Φ(x )increases.Since Φ(x )monotonically increases with x ,1−Φ(x )≈P det (v,d )decreases.Conversely,if v >V cut ,the argument of Φ(x )is negative and increasing in absolute value with d ,meaning that 1−Φ(x )will increase in d .When v =V cut ,the argument in Φ(x )is 0,and the detection probability slightly varies around 0.5.Lemma 1.In the single-flow case,S 3approximates an ideal algorithm as d approaches V cut =1d −k.Thus,the probability that a flowsampled k times hashes to one of these counters when S =ris bounded above by r b≤r(d −k )b´mwhen exactly S =r samples from the rest of the traffic are taken.Thus,in general we have that:P {all ≥d −k }≤C −v Xr =d −k“r(d −k )zb”m ,1”.Notethat this suggests taking b >1/z for this probability to bebelow1.Considering this approximation,(6)and uncondi-tioning from N v,the detection probability for aflow with v bytes is bounded above byP det(v)≤P∞det(v)+1d−k”m(8)whereµ=min(d−1,v).That is,by the detection prob-ability in case of unlimited memory,P∞det(v),plus a term,∆P det(v,d,z,C,b,m)representing the increase in the de-tection probability caused by other traffic incrementing our flow’s counters.Note that,unlike in the unlimited memory case,flows smaller than d may get detected if sampled.The observation is that selectivity may no longer depend solely on d:it shall also depend on the degree of interference be-tweenflows,which depends on the amount of memory sup-ported.Note the following tradeoff:on one hand,increasing the sample threshold,the term P∞det(v)diminishes forflows below V cut,thereby improving the selectivity.On the other, the byte sampling probability also increases,which translates into more samples from otherflows increasing stage counters (∆P det),thereby potentially increasing the detection proba-bility for smallflows.This suggests the existence of an op-timum value for d.In addition,for P det(v)to be close to P∞det(v),the term1/(zb)m should be small.In particular, note that if b→∞the rightmost term in(8)vanishes.In-creasing m,the same factor also vanishes if b>1/z.Let us now see the role of m and b.Let S be the number of samples taken from the rest of flows and i,i=1..m the amount by which the counters (one at each of m stages)where ourflow hashes to get in-cremented by otherflows.We omit,for clarity,the subindex d but recall that the distribution of the above depend on d. The detection probability for ourflow is maximum if it is the last one to arrive and the rest of traffic enters the sam-pler,in which case S is binomial(C−v,p).The probability that aflow gets detected is no larger than the probabil-ity that,at all stages, i+N v≥d.Considering that,for any k,E{ i|S=k}=k b= (C−v)pσN v+i ,thedetection probability for aflow arriving last can be written as P{Z i≥d−vd/V cut−(C−v)d/(V cut b)bz ),re-gardless of m.This suggests the need to support a number of counters per stage at least several times1/z for the de-tection curve to be selective throughout the measurement interval.The product zb can be written as zCzb).That is,flows at the end of the measurement interval appear as V cut−V inf l=V cut/bz=C/b bytes larger.Pdet(v)Pdet(v)(logscale)vFigure3:Effect of the number of stages,m,in(8)for the same setup when stages are of b=1000counters.4.6On the number of capturedflowsIn S3,flows must be sampled at least once to get detected. Therefore,an upper bound for the detection probability for aflow of v bytes is the probability that it gets sampled at least once,i.e.P det(v)≤1−(1−dLemma 2.For the same byte sampling probability,S3de-tects,on the average,fewerflows than S&H.The next theorem(also proven in[15])bounds above the expected number of detectedflows in S3when the number of counters supported at each stage is large enough.While tighter bounds for specificflow size distributions may be found,our bound is independent of theflow size distribution.Theorem 1.With m stages of b counters each,if b> 1z`1+1(1+m)((bz)m−1)´can be un-derstood as the factor by which we need to inflate theflow memory beyond the minimum so that,on the average,all capturedflowsfind an entry available.The bound in theo-rem1shows that,regardless of the traffic mix(e.g.number offlows),theflow memory does not need to be overdimen-sioned if the amount of memory supported at the stages is sufficiently large.In this regard,if b is several times1/z then,(bz)m−1≈(bz)m,and the excess memory required decreases exponentially in m.4.7S3related to S&H and MFWhile the discussion so far has focused on d∈[1,V cut], the complete analysis could have been formulated in terms of p∈[1/V cut,1]since,in S3,p=dzV1/mcutcounterseach is bounded above by1(1+m)(V cut−1)´regardless of theflow size distribution,number offlows and amount of traffic in a measurement interval.Proof.Since S3→MF when d→V cut and theorem(1) applies for any value of d>1,condition b>1z(V cut−1)1/m,which is always met if(bz)m=V cut.Thus,1V cut−1,which yields the result when substituted in the bound in theorem1.4.8Accuracy of S3There are two sources of inaccuracy in S3:the uncertainty due to sampling and the effect of interference resulting from limited memory.With unlimited memory,the number of bytes that go before aflow gets detected,S d,has a negative binomial(d,p)distribution.The best estimate for the size of a largeflow,v,isˆv=E{S d}+R=d/p+R=V cut+R,with R the number of bytes accounted once theflow is detected. The absolute error isˆv−v=V cut−S d for a mean square error MSE=E{(ˆv−v)2}=V ar(S d).Since S d is the sum of d i.i.d geometric(p)r.v.,X,we have that V ar(S d)=dσ2x. Since p=dV cut)V2cut/d. Defining the relative error, rel,as the square root of the MSE over the size of aflow,the relative error is(for aflow at the threshold and unlimited memory)given by ∞= q d−1√d)V cutand E{S2d−cmin}=V2cutV cut)+E{(d−c min)2}´.Substituting in the expression for the MSE,taking the square root and dividing by V cut,the worst-case relative error is found to berel=r d” 2∞+E{c2min}Note that,as d→V cut, ∞vanishes and the relative error is given by pd) 2∞+E{c2min}d≥E{c min}V cut.Since c min is integer-valued,E{c2min}≥E{c min},and the above is always true.The observation in lemma4has important practical and the-oretical implications:for a certain d,the relative error may decrease with the amount of memory,but this improvement shall,at some point,become negligible since the relative error is bounded below by ∞.However, ∞can be made arbitrar-ily as close to0as we wish3.The following two lemmas shall be used in section6to study the scalability of S3. Lemma 5.It suffices that E{c2min}2∞+E{c2min}/d2.Thus,for rel to be below p it suffices that 2∞+E{c2min}/d2≤ 2p.Since c min,d and 2∞are non-negative,this is possible only if p≥ ∞. Lemma 6.If P{c min≥ d}≤δfor some ,δ<1then,the relative error for a largeflow is bounded above bypd2≤ 2(1−δ)+(1−13This is true,since,while in the discussion we have assumed integer values for d,nothing prevents us really from using real-valued sample thresholds.fact that,unlike in other per-packet processing tasks(like classification infirewalls or route lookups),the actions out of accounting do not apply to the packets but to counters, which allows”early”releasing packets before such actions are taken.In the following,we assume that several process-ing engines(µP for short)are available for the execution of measurement algorithms as well as two types of memory de-vices,fast but small ones(e.g.SRAM)and larger but slower ones(e.g.DRAM)4.While we shall refer to these memories as SRAM or DRAM,what we shall really be studying is the fact that S3smoothly relaxes the time requirements of the memories involved,no matter their technology:i.e.,with SRAM we shall mean memories able to count at line rates, whereas DRAM shall refer to slower memories. Reference design:Whenever a packet arrives(e.g.at a line card),S3performs a lookup in theflow memory,as S&H and MF.This can involve lookups as often as pack-ets arrive.Thus,theflow memory needs to be implemented in high-speed memory.However,unlike in MF,only pack-ets with sampled bytes cause read/write operations at the stages.Let us assume that,on reception of packets,an in-putµP,created some sample handler,S h,and released the packet from the measurement process5.This would min-imise the delay that the measurement might add since cre-ating a S h involves retrieving a small amount of packet data, which may already be gathered for other purposes.These S h s could contain the information relevant to our algorithm: the F ID(S F ID),a timestamp(S tstamp),the packet length (S len)and the number of bytes sampled from the packet (S bytes).Finally,this inputµP could put this handler aside in a”queue”at some memory device,until anotherµP read it and took over.Clearly,this queue should also be in fast memory since consecutive packets could be sampled and queueing a S h shouldfinish before any other S h”en-tered”.Some other processor(serverµP)could be used to to read these S h s from the queue,schedule the computa-tion of the hash functions on the S F ID and increment the respective stage counters,held in a larger but slower mem-ory device.Let us assume that the write operations on the counters could be pipelined,and that after such operations the serverµP could know if all counters reached d−1so that entries could be created in theflow memory when ap-propriate.Fig.4shows the idea.In what follows,we study the feasibility of such a design using fewer fast memory and the limitations that this may put on the performance of S3.5.1Analysis of our reference designA packet causes memory operations at the stages if one or more of its bytes get sampled.It can be easily proven that,the case with the worst time constraints is when traf-fic is composed of packets of minimum size,l min,the link is permanently busy and all the traffic goes to the sampler. Let∆t=l min4These assumptions are very reasonable in case of network processors,where we find a core processor performing control functions and a set of RISC processors optimized for packet-processing functions,which typically run several hardware-assisted threads.Further,NPs(for instance Intel’s IXP12xx)are typically de-signed to interface with DRAM as well as SRAM devices.5A similar concept is used in N P s,where packet handlers,typically held in SRAM, are created for packets.Such handlers are data structures containing control information and are typically used as pointers for tasks like queueing.Figure4:Reference designworst-case inter-sample time is∆t/p s.Let us approximate this”geometric”arrival process by assuming that the inter-sample times are exponentially distributed(the continuous counterpart of a geometric process)with the same mean, that is,by a Poisson process with rateλ=p s/∆t.With this approximation,we are considering a worse case since, as Poisson,more than one sample could arrive within∆t. In order to queue a S h in the buffer,the access time of the fast device should be no larger than∆t.Let T a be the time spent by the serverµP in reading S h s from the buffer,com-puting the hash functions and updating the corresponding stage counters.Since comparisons and hash functions can be efficiently implemented in hardware,T a will be on the order of the access time of the large memory device.Let us define α=T a∆t =1T awhich can be understood as the ratio link versus memory bandwidth,for the slower memory.Since it is reasonable to consider T a constant,we can model our design as an M/D/1/k system,as shown infig.4. With such model,the load of the”buffer+serverµP”sys-tem is given byρ=λT a=p sα.Thus,using memoriesαtimes slower may limit p,which shall in turn limit the selectivity(for the same z or V cut) or the granularity for afixed selectivity.To easily see this, let us approximate p s≈p l min=dz<C l Dd. Now,since T a>∆t,some S h s mayfind the serverµP ”busy”updating counters at the slow memory6or previously created S h s in the queue.Since this buffer will in practice have limited space,it could happen that some S h found it full and had to be discarded.Losing S h s would reduce the detection probability offlows,since the algorithm would think thatflows were sampled fewer times.Let us see how large should this buffer be for this to rarely happen.5.1.1Dimensioning the buffer in fast memoryIn order to dimension the size of the buffer,we can use the relations for the M/G/1for constant service times.In case of an infinite queue(i.e.M/D/1instead of M/D/1/k), the average waiting time for a S h would be E{W}=ρT a6In reality,the case might be thatµP support several threads and that the accesses to memory are”queued”at some memory interface.This is the case with Intel’s IXP12xx where the so-called micro-engines issue memory operations to the memory controllers.Nevertheless,we model the situation as a server being busy with a sample handler for some time T a.E{Q}=λE{W}=ρ2(1−ρ)2`4−ρ3(1−ρ)2and its standard deviationσW≈T a√(1−ρ)√ρ3.Now,since the arrival of samples is approximately Poisson,the PASTA property holds.Thus,the probability that some S hfinds exactly k samples in the buffer is P{Q= k}and the probability of a S hfinding more than k samples in the queue is P{Q≥k}.By virtue of Chebyshev’s inequality, P{Q>E{Q}+nσQ}<1√2(1−ρ)+√(1−ρ)√3 oρ2+2√2√ρand B can be bounded above as B≤√3o+2)3 o(1−ρ)≈√(1−ρ)√ρ3 o(10) then,the overflow probability will be smaller than o.5.1.2Impact of update delay on accuracyThe following impairment due to this buffering should be noted.Whenever a S h is”queued”,it takes some time until stage counters for thatflow get updated.If one of these S h turns out to be the onefinding all counters at d−1,the creation of an entry for thisflow will be delayed the time it took that S h to get to the counters.If subsequent packets of thatflow arrive within this time interval,they willfind no entry and will be either sampled or ignored.Thus,while los-ing S h s affects the detection probability,delaying them may affect accuracy.Again,the worst case is when the link is al-ways busy and all packets arriving after theflow just detected belong to it.If it takes,on the average,τfor a S h to get serviced then,the maximum number of bytes that the algo-rithm shall miss is,on the average,τC l.The average time it takes for a S h to get serviced isτ=E{W}+T a=(2−ρ)T a2(1−ρ)C l=“1+12.Note that this er-ror tends to infinity asρtends to unity.Thus,if either the disparity of speeds or the byte-sampling probability is high, this error will be considerable.However,for e.g.ρ<0.75, the error will be bounded above by≤2.5αl min,which is 2.5αminimum-sized packets.For the same load,B=2000 ensures an overflow probability below10−6.Thus,for mod-erate loads(achieved reducing p),this error should not be a concern.In case the load were high,our design can be easily upgraded so as to estimate this error and bound it above as shown in[15],where we also show some numerical example showing the potential of the solution.Final remark and section summary:At very high speeds theflow memory may have to be implemented with CAMs[2](currently1ns).In our design,bothµP s(in-put and server)access the buffer of S h s.Memories simul-taneously supporting read/write operations do actually ex-ist[13].For the same amount of memory,S3can supportmore stage counters than MF.Further,stages in S3can be implemented in memories slower than link bandwidths.This allows implementing S3at speeds where an implementation of MF would be either difficult,costly or not possible.Fur-ther,the use of DRAM translates into considerable savings in terms of space and power ing memo-riesαtimes slower limits above the sampling probability, thereby theoretically limiting selectivity and the worst-case accuracy.Both can be compensated in case of DRAM using more and larger stages.Further,even for high(pessimistic) values ofα,S3can be very selective for values of d(or p) much below the limit due toα.Thus,small buffers may already ensure no overflow and the impact on accuracy due to the delay may be negligible.Finally,schemes combining both memory types have been proposed in related contexts7.6.SCALABILITY OF S3We shall now see how S3scales and compare it to the other approaches mentioned in this paper.The problem at hand gets harder whenfiner granularities are targeted,when higher accuracy is required or when the amount of traffic in a measurement interval increases.As a consequence,the error relative to the smallest size of interest(rather than the absolute error,or the error relative to the total)is the natural metric of interest.Hence,the focus in this section is on the amount of memory(and number of accesses)required by algorithms to detectflows above a fraction z of the total traffic C while incurring a relative error no larger than some prescribed p.For the sake of comparison,we shall assume that stage counters in S3are offixed size.For its practical relevance, we shall distinguish between entries and stage counters not only because stages could be held in DRAM,but also since, even if implemented in SRAM,entries may be significantly larger than stage counters(a10:1relationship is suggested in[2]).This suggests the convenience of minimising the size of theflow memory.S3requires three parameters to be set:the stage size(b),number of stages(m)and the sample threshold(d).This gives three degrees of freedom.For what accuracy concerns,the worst case is for a largeflow arriving last as discussed in section4.8.Let c min be the smallest of the m counters,c1..c m,that thisflow shallfind and let us start dimensioning m and b so thatP{c min≥ d}≤δ(11) for some <1,δ<1.Assuming c1..c m i.i.d(which is rea-sonable since hash functions tend to uniformly spreadflows at each stage),(11)is equivalent to P{c i≥ d}m≤δ.Now, the average number of samples taken altogether is bounded above by Cp=db).Since we shall require b>1/z and d 1,we have that E{c i}≤d/zd´m≤δfor(11) to hold.Considering the bound for E{c i},the inequalityabove is satisfied if`1z `17For instance[14]propose a counter management algorithm(CMA)for a general-purpose counting architecture previously proposed in which DRAM is used to store statistics counted at line rates using counters in SRAM.We directly count samples in DRAM instead of using small SRAM to update a large number of counters in DRAM and thus we do not use a CMA.number of stage counters for(11)to hold is given byM=bm=1δ”1/m m(12) regardless of the value of d>1.As a function of m,(12) renders a minimum at m=log(1/δ)for anyδ>0, >0. Taking m=log(1/δ)stages means supporting stages with b=ezlog(1/δ)counters. Now,by virtue of lemma6,for the worst-case relative error to be no larger than some p it suffices that2∞+ 2(1−δ)+δ= 2p(13)where 2∞=1V cut≤ 2p.This last condition requires d≥( 2p+1/V cut)−1,or p≥( 2p V cut+1)−1,which can always be satisfied.Solving for in(13),the number of required stage counters is given byM=e1−δδ)(14)Observations:i)(14)decreases in r d=( 2p− 2∞),where 2∞< 2p.As a function ofδ,(14)exhibits a minimum in(0,r d).For values of p of practical significance(say between10−8and10−2),δ≈r d10/ p)and d>1/ 2p, condition b>1。
Java处理器的评估-外文文献及翻译
文献翻译中文翻译稿Java处理器的评估1.引言在本文中,我们将提出Java处理器关于尺寸和性能的评价结果。
此Java处理器被称为JOP -主张优化的Java处理器- ,基于这样的假设,一个全面的本地执行所有Java虚拟机(JVM),字节码指令不是一个有用的办法。
JOP是Java处理器的嵌入式实时系统,特别是一个小的处理器资源受限设备的时间可预测的执行Java程序。
表1列出了相关的可用Java处理器。
Sun公司于1997年推出picoJava的第一个版本。
在研究性论文中,Sun公司的picoJava是经常提到的Java处理器。
它是用作新Java处理器的参考,并且作为提高Java处理器各方面研究的基础。
具有讽刺意义的是,该处理器从未被Sun作为产品释放过。
1999年被重新设计,被称为picoJava - 2是目前免费提供了一套丰富的文件。
picoJava的结构是一种基于堆栈的CISC处理器,可执行341种不同的指令,是最复杂的Java处理器,该处理器可以执行在约440K盖茨。
AJile的JEMCore是一种直接执行Java处理器,可作为一个IP核心和独立的处理器。
它是基于32位JEM2 Java芯片开发的罗克韦尔-科林斯。
该处理器包含零等待状态48KB RAM和外围元件。
16KB的内存用于存储写入控制。
其余的32KB用于存储处理器堆栈。
月亮火神处理器是JVM运行在一个FPGA芯片的一个执行。
执行模型是常用的各种直接,微码和被困执行。
一个简单的堆栈折叠的实施,以减少记忆体周期5至三年的指令序列像按压式添加。
该Moon2处理器可作为一个加密的高密度脂蛋白来源为Altera的FPGA或VHDL或Verilog源代码。
该32位核心是一种基于哈佛结构的混合式8/32-位处理器。
程序存储器是8位宽,数据存储器是32位宽。
核心包含一个3级流水线的整数运算单元,一个桶式移位器和一个2位乘法单元。
根据DCT变换,在同一时钟速度下,该性能通常是RISC运行速度的8倍。
计算机 java 外文翻译 外文文献 英文文献
英文原文:Title: Business Applications of Java. Author: Erbschloe, Michael, Business Applications of Java -- Research Starters Business, 2008DataBase: Research Starters - BusinessBusiness Applications of JavaThis article examines the growing use of Java technology in business applications. The history of Java is briefly reviewed along with the impact of open standards on the growth of the World Wide Web. Key components and concepts of the Java programming language are explained including the Java Virtual Machine. Examples of how Java is being used bye-commerce leaders is provided along with an explanation of how Java is used to develop data warehousing, data mining, and industrial automation applications. The concept of metadata modeling and the use of Extendable Markup Language (XML) are also explained.Keywords Application Programming Interfaces (API's); Enterprise JavaBeans (EJB); Extendable Markup Language (XML); HyperText Markup Language (HTML); HyperText Transfer Protocol (HTTP); Java Authentication and Authorization Service (JAAS); Java Cryptography Architecture (JCA); Java Cryptography Extension (JCE); Java Programming Language; Java Virtual Machine (JVM); Java2 Platform, Enterprise Edition (J2EE); Metadata Business Information Systems > Business Applications of JavaOverviewOpen standards have driven the e-business revolution. Networking protocol standards, such as Transmission Control Protocol/Internet Protocol (TCP/IP), HyperText Transfer Protocol (HTTP), and the HyperText Markup Language (HTML) Web standards have enabled universal communication via the Internet and the World Wide Web. As e-business continues to develop, various computing technologies help to drive its evolution.The Java programming language and platform have emerged as major technologies for performing e-business functions. Java programming standards have enabled portability of applications and the reuse of application components across computing platforms. Sun Microsystems' Java Community Process continues to be a strong base for the growth of the Java infrastructure and language standards. This growth of open standards creates new opportunities for designers and developers of applications and services (Smith, 2001).Creation of Java TechnologyJava technology was created as a computer programming tool in a small, secret effort called "the Green Project" at Sun Microsystems in 1991. The Green Team, fully staffed at 13 people and led by James Gosling, locked themselves away in an anonymous office on Sand Hill Road in Menlo Park, cut off from all regular communications with Sun, and worked around the clock for18 months. Their initial conclusion was that at least one significant trend would be the convergence of digitally controlled consumer devices and computers. A device-independent programming language code-named "Oak" was the result.To demonstrate how this new language could power the future of digital devices, the Green Team developed an interactive, handheld home-entertainment device controller targeted at the digital cable television industry. But the idea was too far ahead of its time, and the digital cable television industry wasn't ready for the leap forward that Java technology offered them. As it turns out, the Internet was ready for Java technology, and just in time for its initial public introduction in 1995, the team was able to announce that the Netscape Navigator Internet browser would incorporate Java technology ("Learn about Java," 2007).Applications of JavaJava uses many familiar programming concepts and constructs and allows portability by providing a common interface through an external Java Virtual Machine (JVM). A virtual machine is a self-contained operating environment, created by a software layer that behaves as if it were a separate computer. Benefits of creating virtual machines include better exploitation of powerful computing resources and isolation of applications to prevent cross-corruption and improve security (Matlis, 2006).The JVM allows computing devices with limited processors or memory to handle more advanced applications by calling up software instructions inside the JVM to perform most of the work. This also reduces the size and complexity of Java applications because many of the core functions and processing instructions were built into the JVM. As a result, software developers no longer need to re-create the same application for every operating system. Java also provides security by instructing the application to interact with the virtual machine, which served as a barrier between applications and the core system, effectively protecting systems from malicious code.Among other things, Java is tailor-made for the growing Internet because it makes it easy to develop new, dynamic applications that could make the most of the Internet's power and capabilities. Java is now an open standard, meaning that no single entity controls its development and the tools for writing programs in the language are available to everyone. The power of open standards like Java is the ability to break down barriers and speed up progress.Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards. There are over 3 million Java developers and now there are several versions of the code. Most large corporations have in-house Java developers. In addition, the majority of key software vendors use Java in their commercial applications (Lazaridis, 2003).ApplicationsJava on the World Wide WebJava has found a place on some of the most popular websites in the world and the uses of Java continues to grow. Java applications not only provide unique user interfaces, they also help to power the backend of websites. Two e-commerce giants that everybody is probably familiar with (eBay and Amazon) have been Java pioneers on the World Wide Web.eBayFounded in 1995, eBay enables e-commerce on a local, national and international basis with an array of Web sites-including the eBay marketplaces, PayPal, Skype, and -that bring together millions of buyers and sellers every day. You can find it on eBay, even if you didn't know it existed. On a typical day, more than 100 million items are listed on eBay in tens of thousands of categories. Recent listings have included a tunnel boring machine from the Chunnel project, a cup of water that once belonged to Elvis, and theV olkswagen that Pope Benedict XVI owned before he moved up to the Popemobile. More than one hundred million items are available at any given time, from the massive to the miniature, the magical to the mundane, on eBay; the world's largest online marketplace.eBay uses Java almost everywhere. To address some security issues, eBay chose Sun Microsystems' Java System Identity Manager as the platform for revamping its identity management system. The task at hand was to provide identity management for more than 12,000 eBay employees and contractors.Now more than a thousand eBay software developers work daily with Java applications. Java's inherent portability allows eBay to move to new hardware to take advantage of new technology, packaging, or pricing, without having to rewrite Java code ("eBay drives explosive growth," 2007).Amazon (a large seller of books, CDs, and other products) has created a Web Service application that enables users to browse their product catalog and place orders. uses a Java application that searches the Amazon catalog for books whose subject matches a user-selected topic. The application displays ten books that match the chosen topic, and shows the author name, book title, list price, Amazon discount price, and the cover icon. The user may optionally view one review per displayed title and make a buying decision (Stearns & Garishakurthi, 2003).Java in Data Warehousing & MiningAlthough many companies currently benefit from data warehousing to support corporate decision making, new business intelligence approaches continue to emerge that can be powered by Java technology. Applications such as data warehousing, data mining, Enterprise Information Portals (EIP's), and Knowledge Management Systems (which can all comprise a businessintelligence application) are able to provide insight into customer retention, purchasing patterns, and even future buying behavior.These applications can not only tell what has happened but why and what may happen given certain business conditions; allowing for "what if" scenarios to be explored. As a result of this information growth, people at all levels inside the enterprise, as well as suppliers, customers, and others in the value chain, are clamoring for subsets of the vast stores of information such as billing, shipping, and inventory information, to help them make business decisions. While collecting and storing vast amounts of data is one thing, utilizing and deploying that data throughout the organization is another.The technical challenges inherent in integrating disparate data formats, platforms, and applications are significant. However, emerging standards such as the Application Programming Interfaces (API's) that comprise the Java platform, as well as Extendable Markup Language (XML) technologies can facilitate the interchange of data and the development of next generation data warehousing and business intelligence applications. While Java technology has been used extensively for client side access and to presentation layer challenges, it is rapidly emerging as a significant tool for developing scaleable server side programs. The Java2 Platform, Enterprise Edition (J2EE) provides the object, transaction, and security support for building such systems.Metadata IssuesOne of the key issues that business intelligence developers must solve is that of incompatible metadata formats. Metadata can be defined as information about data or simply "data about data." In practice, metadata is what most tools, databases, applications, and other information processes use to define, relate, and manipulate data objects within their own environments. It defines the structure and meaning of data objects managed by an application so that the application knows how to process requests or jobs involving those data objects. Developers can use this schema to create views for users. Also, users can browse the schema to better understand the structure and function of the database tables before launching a query.To address the metadata issue, a group of companies (including Unisys, Oracle, IBM, SAS Institute, Hyperion, Inline Software and Sun) have joined to develop the Java Metadata Interface (JMI) API. The JMI API permits the access and manipulation of metadata in Java with standard metadata services. JMI is based on the Meta Object Facility (MOF) specification from the Object Management Group (OMG). The MOF provides a model and a set of interfaces for the creation, storage, access, and interchange of metadata and metamodels (higher-level abstractions of metadata). Metamodel and metadata interchange is done via XML and uses the XML Metadata Interchange (XMI) specification, also from the OMG. JMI leverages Java technology to create an end-to-end data warehousing and business intelligence solutions framework.Enterprise JavaBeansA key tool provided by J2EE is Enterprise JavaBeans (EJB), an architecture for the development of component-based distributed business applications. Applications written using the EJB architecture are scalable, transactional, secure, and multi-user aware. These applications may be written once and then deployed on any server platform that supports J2EE. The EJB architecture makes it easy for developers to write components, since they do not need to understand or deal with complex, system-level details such as thread management, resource pooling, and transaction and security management. This allows for role-based development where component assemblers, platform providers and application assemblers can focus on their area of responsibility further simplifying application development.EJB's in the Travel IndustryA case study from the travel industry helps to illustrate how such applications could function. A travel company amasses a great deal of information about its operations in various applications distributed throughout multiple departments. Flight, hotel, and automobile reservation information is located in a database being accessed by travel agents worldwide. Another application contains information that must be updated with credit and billing history from a financial services company. Data is periodically extracted from the travel reservation system databases to spreadsheets for use in future sales and marketing analysis.Utilizing J2EE, the company could consolidate application development within an EJB container, which can run on a variety of hardware and software platforms allowing existing databases and applications to coexist with newly developed ones. EJBs can be developed to model various data sets important to the travel reservation business including information about customer, hotel, car rental agency, and other attributes.Data Storage & AccessData stored in existing applications can be accessed with specialized connectors. Integration and interoperability of these data sources is further enabled by the metadata repository that contains metamodels of the data contained in the sources, which then can be accessed and interchanged uniformly via the JMI API. These metamodels capture the essential structure and semantics of business components, allowing them to be accessed and queried via the JMI API or to be interchanged via XML. Through all of these processes, the J2EE infrastructure ensures the security and integrity of the data through transaction management and propagation and the underlying security architecture.To consolidate historical information for analysis of sales and marketing trends, a data warehouse is often the best solution. In this example, data can be extracted from the operational systems with a variety of Extract, Transform and Load tools (ETL). The metamodels allow EJBsdesigned for filtering, transformation, and consolidation of data to operate uniformly on data from diverse data sources as the bean is able to query the metamodel to identify and extract the pertinent fields. Queries and reports can be run against the data warehouse that contains information from numerous sources in a consistent, enterprise-wide fashion through the use of the JMI API (Mosher & Oh, 2007).Java in Industrial SettingsMany people know Java only as a tool on the World Wide Web that enables sites to perform some of their fancier functions such as interactivity and animation. However, the actual uses for Java are much more widespread. Since Java is an object-oriented language like C++, the time needed for application development is minimal. Java also encourages good software engineering practices with clear separation of interfaces and implementations as well as easy exception handling.In addition, Java's automatic memory management and lack of pointers remove some leading causes of programming errors. Most importantly, application developers do not need to create different versions of the software for different platforms. The advantages available through Java have even found their way into hardware. The emerging new Java devices are streamlined systems that exploit network servers for much of their processing power, storage, content, and administration.Benefits of JavaThe benefits of Java translate across many industries, and some are specific to the control and automation environment. For example, many plant-floor applications use relatively simple equipment; upgrading to PCs would be expensive and undesirable. Java's ability to run on any platform enables the organization to make use of the existing equipment while enhancing the application.IntegrationWith few exceptions, applications running on the factory floor were never intended to exchange information with systems in the executive office, but managers have recently discovered the need for that type of information. Before Java, that often meant bringing together data from systems written on different platforms in different languages at different times. Integration was usually done on a piecemeal basis, resulting in a system that, once it worked, was unique to the two applications it was tying together. Additional integration required developing a brand new system from scratch, raising the cost of integration.Java makes system integration relatively easy. Foxboro Controls Inc., for example, used Java to make its dynamic-performance-monitor software package Internet-ready. This software provides senior executives with strategic information about a plant's operation. The dynamic performance monitor takes data from instruments throughout the plant and performs variousmathematical and statistical calculations on them, resulting in information (usually financial) that a manager can more readily absorb and use.ScalabilityAnother benefit of Java in the industrial environment is its scalability. In a plant, embedded applications such as automated data collection and machine diagnostics provide critical data regarding production-line readiness or operation efficiency. These data form a critical ingredient for applications that examine the health of a production line or run. Users of these devices can take advantage of the benefits of Java without changing or upgrading hardware. For example, operations and maintenance personnel could carry a handheld, wireless, embedded-Java device anywhere in the plant to monitor production status or problems.Even when internal compatibility is not an issue, companies often face difficulties when suppliers with whom they share information have incompatible systems. This becomes more of a problem as supply-chain management takes on a more critical role which requires manufacturers to interact more with offshore suppliers and clients. The greatest efficiency comes when all systems can communicate with each other and share information seamlessly. Since Java is so ubiquitous, it often solves these problems (Paula, 1997).Dynamic Web Page DevelopmentJava has been used by both large and small organizations for a wide variety of applications beyond consumer oriented websites. Sandia, a multiprogram laboratory of the U.S. Department of Energy's National Nuclear Security Administration, has developed a unique Java application. The lab was tasked with developing an enterprise-wide inventory tracking and equipment maintenance system that provides dynamic Web pages. The developers selected Java Studio Enterprise 7 for the project because of its Application Framework technology and Web Graphical User Interface (GUI) components, which allow the system to be indexed by an expandable catalog. The flexibility, scalability, and portability of Java helped to reduce development time and costs (Garcia, 2004)IssueJava Security for E-Business ApplicationsTo support the expansion of their computing boundaries, businesses have deployed Web application servers (WAS). A WAS differs from a traditional Web server because it provides a more flexible foundation for dynamic transactions and objects, partly through the exploitation of Java technology. Traditional Web servers remain constrained to servicing standard HTTP requests, returning the contents of static HTML pages and images or the output from executed Common Gateway Interface (CGI ) scripts.An administrator can configure a WAS with policies based on security specifications for Java servlets and manage authentication and authorization with Java Authentication andAuthorization Service (JAAS) modules. An authentication and authorization service can be written in Java code or interface to an existing authentication or authorization infrastructure. For a cryptography-based security infrastructure, the security server may exploit the Java Cryptography Architecture (JCA) and Java Cryptography Extension (JCE). To present the user with a usable interaction with the WAS environment, the Web server can readily employ a form of "single sign-on" to avoid redundant authentication requests. A single sign-on preserves user authentication across multiple HTTP requests so that the user is not prompted many times for authentication data (i.e., user ID and password).Based on the security policies, JAAS can be employed to handle the authentication process with the identity of the Java client. After successful authentication, the WAS security collaborator consults with the security server. The WAS environment authentication requirements can be fairly complex. In a given deployment environment, all applications or solutions may not originate from the same vendor. In addition, these applications may be running on different operating systems. Although Java is often the language of choice for portability between platforms, it needs to marry its security features with those of the containing environment.Authentication & AuthorizationAuthentication and authorization are key elements in any secure information handling system. Since the inception of Java technology, much of the authentication and authorization issues have been with respect to downloadable code running in Web browsers. In many ways, this had been the correct set of issues to address, since the client's system needs to be protected from mobile code obtained from arbitrary sites on the Internet. As Java technology moved from a client-centric Web technology to a server-side scripting and integration technology, it required additional authentication and authorization technologies.The kind of proof required for authentication may depend on the security requirements of a particular computing resource or specific enterprise security policies. To provide such flexibility, the JAAS authentication framework is based on the concept of configurable authenticators. This architecture allows system administrators to configure, or plug in, the appropriate authenticators to meet the security requirements of the deployed application. The JAAS architecture also allows applications to remain independent from underlying authentication mechanisms. So, as new authenticators become available or as current authentication services are updated, system administrators can easily replace authenticators without having to modify or recompile existing applications.At the end of a successful authentication, a request is associated with a user in the WAS user registry. After a successful authentication, the WAS consults security policies to determine if the user has the required permissions to complete the requested action on the servlet. This policy canbe enforced using the WAS configuration (declarative security) or by the servlet itself (programmatic security), or a combination of both.The WAS environment pulls together many different technologies to service the enterprise. Because of the heterogeneous nature of the client and server entities, Java technology is a good choice for both administrators and developers. However, to service the diverse security needs of these entities and their tasks, many Java security technologies must be used, not only at a primary level between client and server entities, but also at a secondary level, from served objects. By using a synergistic mix of the various Java security technologies, administrators and developers can make not only their Web application servers secure, but their WAS environments secure as well (Koved, 2001).ConclusionOpen standards have driven the e-business revolution. As e-business continues to develop, various computing technologies help to drive its evolution. The Java programming language and platform have emerged as major technologies for performing e-business functions. Java programming standards have enabled portability of applications and the reuse of application components. Java uses many familiar concepts and constructs and allows portability by providing a common interface through an external Java Virtual Machine (JVM). Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards.Java has found a place on some of the most popular websites in the world. Java applications not only provide unique user interfaces, they also help to power the backend of websites. While Java technology has been used extensively for client side access and in the presentation layer, it is also emerging as a significant tool for developing scaleable server side programs.Since Java is an object-oriented language like C++, the time needed for application development is minimal. Java also encourages good software engineering practices with clear separation of interfaces and implementations as well as easy exception handling. Java's automatic memory management and lack of pointers remove some leading causes of programming errors. The advantages available through Java have also found their way into hardware. The emerging new Java devices are streamlined systems that exploit network servers for much of their processing power, storage, content, and administration.中文翻译:标题:Java的商业应用。
计算机专业计算机英语第二版第五单元毕业论文外文文献翻译及原文
毕业设计(论文)外文文献翻译文献、资料中文题目:《计算机英语》(第二版)机械工业出版社出版的第五单元文献、资料英文题目:文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期: 2017.02.14本文摘自《计算机英语》(第二版)机械工业出版社出版的第五单元Unit 5 Software DevelopmentSection AComputer Program1>IntroductionA computer program is a set of instructions that directs a computer to perform some processing function or combination of functions. For the instructions to be carried out ,a computer must execute a program , that is , the computer reads the program , and then follows the steps encoded in the program in a precise order until completion . A program can be executed many different times , with each execution yielding a potentially different result depending upon the options and data that the user gives the computer .Programs fall into two major classes : application programs and operating systems . An application program is one that carries out some function directly for a user , such as word processing or game playing . An operating system is program that manages the computer and the various resources and devices connected to it , such as RAM ( random access memory ) , hard drives , monitors , keyboards , printers , and modems , so that they may be used by other programs . Examples of operating systems are DOS , Windows 95 , OS/2 , and UNIX.2>Program DevelopmentSoftware designers create new programs by using special applications programs , often called utility programs or development programs . A programmer uses another type of program called a text editor to write the new program in a special notation called a programmer creates a text file , which is an ordered list of instructions , also called the program source file . The individual instructions that make up the program source file are calledsource code . At this point , a special applications program translates the source code into machine language , or object code---a format that the operating system will recognize as a proper program and be able to execute .Three types of applications programs translate from source code to object code : compilers , interpreters , and assemblers . The three operate differently and on different types of programming languages , but they serve the same purpose of translating from a programming language into machine language .A compiler translates text files written in a high-level programming language---such as FORTRAN , C, or Pascal---from the source code to the object code all at once . This differs from the approach taken by interpreted languages such as BASIC , in which a program is translated into object code statement by statement as each instruction is executed . The advantage to interpreted languages is that they can begin executing the program immediately instead of having to wait for all of the source code to be compiled . Changes can also be made to the program fairly quickly without having to wait for it to be compiled again . The disadvantage of interpreted languages is that they are slow to execute , since the entire program must be translated one instruction at a time , each time the program is run . On the other hand , compiled languages are compiled only once and thus can be executed by the computer much more quickly than interpreted languages . For this reason , compiled languages are more common and are almost always used in professional and scientific applications .Another type of translator is the assembler , which is used for programs or parts of programs written in assembly language . Assembly language is another programming language , but it is much more similar to machine language than other types of high-level languages . In assembly language , a single statement can usually be translated into a single instruction of。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
原文:Java EE 5:Power and productivity with less complexityAn overview of Java EE 5 features and developer-productivity enhancements Momentum for organizations to adopt Java Platform, Enterprise Edition 5 (Java EE 5) is steadily increasing as the platform's container support, developer tools, educational resources, and developer-community experience all improve. Get a high-level view of the new productivity features and API enhancements in Java EE 5 and work through a Web service example that demonstrates its simplified development models.IntroductionJava EE technology is an extension to the Java language platform that enables you to create scalable, powerful, and portable enterprise applications. It defines four types of containers for application components: Web, Enterprise JavaBean (EJB), application client, and applet. These containers, and the Java APIs each must support, are detailed in an application-server specification that encourages a competitive marketplace for Java EE products while guaranteeing server portability for applications that adhere to the specification .The latest version of the platform, Java EE 5, was released in May 2006. Primarily focused on developer productivity, Java EE 5 brings simpler programming models without sacrificing any of the platform's power and richness. Two mechanisms — Java annotations and better defaults — are responsible for most of its simpler development models. Major functional improvements include enhanced Web services support and incorporation of JavaServer Faces (JSF) and the Java Standard Tag Library (JSTL) into the platform.Web services technologiesThe introduction of annotations into Java EE 5 makes it simple to create sophisticated Web service endpoints and clients with less code and a shorter learning curve than was possible with earlier Java EE versions. Annotations — first introduced in Java SE 5 — are modifiers you can add to your code as metadata. They don't affect program semantics directly, but the compiler, development tools, and runtime libraries can process them to produce additional Java language source files, XML documents, or other artifacts and behavior that augment the code containing the annotations . Later in the article, you'll see how you can easily turn a regular Java class into a Web service by adding simple annotations.A leap forward in Web services supportThe cornerstone of Web services support in Java EE 5 is JAX-WS 2.0, which is a follow-on to JAX-RPC 1.1. Both of these technologies let you create RESTful and SOAP-based Web services without dealing directly with the tedium of XML processing and data binding inherent to Web services. Developers are free to continue using JAX-RPC (which is still required of Java EE 5 containers), but migrating to JAX-WS is strongly recommended. Newcomers to Java Web services might as well skip JAX-RPC and head right for JAX-WS. That said, it's good to know that both of them support SOAP 1.1 over HTTP 1.1 and so are fully compatible: a JAX-WS Web services client can access a JAX-RPC Web services endpoint, and vice versa.The advantages of JAX-WS over JAX-RPC are compelling. JAX-WS:Supports the SOAP 1.2 standard (in addition to SOAP 1.1).Supports XML over HTTP. You can bypass SOAP if you wish.Uses the Java Architecture for XML Binding (JAXB) for its data-mapping model. JAXB has complete support for XML schema and better performance (more on that in a moment).Introduces a dynamic programming model for both server and client. The client model supports both a message-oriented and an asynchronous approach.Supports Message Transmission Optimization Mechanism (MTOM), a W3C recommendation for optimizing the transmission and format of a SOAP message.Upgrades Web services interoperability (WS-I) support. (It supports Basic Profile 1.1; JAX-WS supports only Basic Profile 1.0.)Upgrades SOAP attachment support. (It uses the SOAP with Attachments API for Java [SAAJ] 1.3; JAX-WS supports only SAAJ 1.2.)The wsimport tool in JAX-WS automatically handles many of the mundane details of Web service development and integrates easily into a build processes in a cross-platform manner, freeing you to focus on the application logic that implements or uses a service. It generates artifacts such as services, service endpoint interfaces (SEIs), asynchronous response code, exceptions based on WSDL faults, and Java classes bound to schema types by JAXB.JAX-WS also enables high-performing Web services. See resource for a link to an article ("Implementing High Performance Web Services Using JAX-WS 2.0") presenting a benchmark study of equivalent Web service implementations based on the new JAX-WS stack (which uses two other Web services features in Java EE 5 — JAXB and StAX) and a JAX-RPC stack available in J2EE 1.4. The study found 40% to 1000% performance increases with JAX-WS in various functional areas under different loads.Web application technologiesJava EE 5 welcomes two major pieces of front-end technology — JSF and JSTL— into the specification to join the existing JavaServer Pages and Servlet specifications. JSF is a set of APIs that enable a component-based approach to user-interface development. JSTL is a set of tag libraries that support embedding procedural logic, access to JavaBeans, SQL commands, localized formatting instructions, and XML processing in JSPs. The most recent releases of JSF, JSTL, and JSP support a unified expression language (EL) that allows these technologies to integrate more easily.JSF 1.2JSF has built-in support for common UI concerns such as component state management, event handling, navigation, user-input validation, and internationalization. Expert developers can create customized, powerful, reusable components or create custom renderers for client devices other than a Web browser. Less-technical users can reuse custom components, including the default JSF tag library for HTML interfaces, in visual programming environments such as Sun Java Studio Creator. This puts the creation of sophisticated Web presentation layers within reach of novice programmers.A growing landscape of third-party JSF components exists in both the open source community and the licensed-software realm. You'll turn up dozens of options by searching for "JSF components" or "JSF component libraries" on the Web. Many of these components rely on Asynchronous JavaScript + XML (Ajax) techniques, which are a driving force behind the "Web 2.0" experience. Web programmers can use them to create applications that offer a better user experience than traditional Web applications, without needing to fuss with the details of writing Ajax components from scratch.JSP 2.1JSP technology has been around since J2EE 2.1. It leverages the Java Servlet specification to enable declarative programming of a UI. It supports programming UIs as documents that are translated into Java servlets, compiled, and invoked by the Web application container to service requests. These documents typically mix JSP directives and scriptlets with a presentation markup language such as HTML. JSPs can use an older syntax that relies on special tags that start with <% and end with %>, or on a newer syntax that is well-formed XML. They typically serve as the "View" part of a Model-View-Controller (MVC) UI framework.JSP 2.1 and JSF 1.2 are more mutually compatible than prior releases, primarily because of the integration of their EL syntax into the unified EL. EL enables operations such as:Accessing properties of JavaBeans in the request, session, and applicationcontexts.Performing logical tests that determine such choices as whether to hide or show a particular element.Performing calculations that affect numbers and strings that appear in the UI.In the past, there were differences in the JSP and JSF EL syntax and how the container evaluated them. The unified EL resolves these differences while also adding features such as:A pluggable framework to enable customization of EL interpretation.Support for deferred expressions that can be executed as needed by a JSP tag handler.Support for assignment operations that can, for example, use an EL expression to set a property on a JavaBean from within JSP code.A boon for JSP tag-library developers is that tag handlers now support resource injection using annotations, so tags that once required resource configuration and code to perform Java Naming and Directory Interface (JNDI) lookups can now be greatly simplified.JSTL 1.2JSTL has been around for years, but until Java EE 5, it existed outside of the Java EE umbrella. JSTL tags provide support for embedding the following types of elements in JSPs:Procedural logic, such as loops and if/else switches.Access to JavaBeans that can provide dynamic data to the UI or be modified by UI code.SQL commands to perform database access.Formatting instructions that format UI output according to specific locales.XML processing, such as Document Object Model (DOM) parsing or Extensible Stylesheet Language (XSL) transformations.JSTL 1.2 is a maintenance release that supports the unified EL and resolves issues that used to arise from trying to mix JSF tags and JSTL iteration tags in the same JSP page.Java Servlet 2.5The Java Servlet specification — the backbone of Java Web-tier technology — is as old as Java EE technology itself. The specification is designed to provide a high-performing, component-based approach to building Web applications that are portable across any servers that implement the specification.The Servlet 2.5 specification required by Java EE 5 is a maintenance release that includes minor improvements over the 2.4 release. It introduces a dependency on theJava 5 platform along with some annotations that reduce the need for configuration in the Web application deployment descriptor (web.xml) configuration file. Additional configuration conveniences have been added, such as more-flexible servlet configuration with wildcarding and multiple url-pattern elements.Java Persistence API (JPA 1.0)JPA introduces an object-relational mapping (ORM) framework for persisting Java objects. It was developed with EJBs in mind, but it can be used for any Java objects. Using annotations, you indicate which objects and fields are persistent and which database tables and columns they map to. JPA supports a rich query language that resembles SQL. The query language enables:Definition of parameterized queries that can take parameters as an ordered list, referred to by index numbers, or as named parameters referred to by name.Queries that traverse the relationships between persistent entities without requiring JOIN statements (though you can use JOIN statements if you prefer).Typical SQL-like features to form search criteria (comparison operators, LIKE statements, BETWEEN statements, and so on) and define how to treat the result set (using operators such as DISTINCT, ORDER BY, GROUP BY, and so on.)JPA brings new functionality to the Java EE platform, relieving many of the past headaches of roll-your-own or container-specific persistence approaches.Management and securityJava EE 5 requires the same three management and security specifications that are available in prior versions:Application Deployment provides an API for deploying components and applications to a Java EE container. Tools can access this API to deploy code to a Java EE 5 container without restarting the container. IDEs often use this API to enable rapid code/test/fix cycles during development.Application Management specifies required attributes and operations of objects managed by the container. It's compatible with various industry-standard management protocols.Authorization Contract for Containers(Java ACC) defines the semantics of security-policy providers and how to authorize access to operations managed within this contract. It requires that containers implement interfaces that enable deployment tools to manage authorization roles.Each of these specifications in Java EE 5 is a maintenance release (each advances from version 1.0, introduced in J2EE 1.4, to version 1.1), with minor enhancements that are too detailed for this article's scope. Follow the Java EE Management and Security Technologies link in resources for more information.Java EE 5 is backward-compatible with prior EJB deployment descriptors. You can even mix approaches if you wish, allowing legacy code to specify EJBs using descriptors while new EJBs are declared with annotations.Aside from the reduction in the amount of code it takes to get the job done, annotations enable a maintenance benefit from what Sun architect Graham Hamilton refers to as "truth-in-source-code" (see Resources): With a properly annotated class, you don't need to look at both source code and configuration files to understand what is going on because the annotations that define special behavior are right there in the source code.For a code-intensive review of many other examples of how annotations ease application development in Java EE 5, see Roland Barcia's article "Get to know Java EE 5."Reasonable defaultsThe fact that RideStatistics can become a Web service just by the addition of a single annotation also shows another Java EE 5 design principle in action: providing reasonable defaults to enable simpler programming models.In this case, JAX-WS assumes that any public method in a class annotated with @WebService should be turned into a Web service operation that bears the same name as the method. Similar assumptions are made when the input and output parameters for these methods are processed. If you don't want the default behavior, you can always modify it by annotations on the methods. But in many cases, you'll probably want the terms used in the Web service to match terms used in the class that implements the Web service, and JAX-WS makes this easy to accomplish by providing reasonable defaults.ConclusionIn the past, the benefits of Java EE technology have come only to those willing to wrestle with its complexity or tame it using development tools. It has earned a reputation as overly burdensome, a platform to consider only when a large, enterprise-grade system needs its powerful features and has the resources to deal with the development difficulty.Java EE 5 seeks to shatter this reputation by leveraging new language features such as annotations, design goals such as reasonable defaults, and an emphasis on simpler programming models to provide an accessible, powerful platform for enterprise application development. Simpler programming models also make development shops less reliant on third-party tools to manage unnecessary complexity. The net result for people footing the bill is that it's now significantly less expensive to develop ever-more powerful enterprise applications. The net result for developers isthat you can spend less time wrestling with the platform and more time impressing your managers with rapidly developed features built upon it.Development shops that have shied away from Java EE technology in the past should give it a fresh look, and developers and maintainers of existing J2EE applications should explore Java EE 5 to discover the many ways it can make their lives easier.译文:JavaEE5:强大的功能、高生产率和低复杂性概述Java EE 5 特性和提高开发人员生产率的改进随着平台的容器支持、开发人员工具、培训资源和开发人员社区体验等方面的改善,推动组织采用Java™ Platform, Enterprise Edition 5(Java EE 5)的动力正在稳定增长。