JAVA方面 计算机专业开题报告外文文献及中文翻译
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是一种通用的,并发的,基于类的并且是面向对象的计算机编程语言,它是为实现尽可能地减少执行的依赖关系而特别设计的。
java毕业设计中英文翻译

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 coming 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 initial 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 thedata 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 of response time. The response of a CGI program depends on how much data mustbe sent, as well as the load on both the server andthe 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 file must 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-sideprogramming 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 is 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 into the appropriate spot in the browser. It tells the browser “from now on you canperform 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 aresimply 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 sophisticated 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 withJava; it’s named that way just to grab some of Java’s marketing momentum), VBScript (which looks like Visual Basic), andTcl/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 Web 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 powerfulprogramming 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 havebrowsers with built-in Java interpreters. (This safely includes the vast majority of machines.) Since Java is a full-fledged programming language, you can do as much work as possible on the client before and after making requests of theserver. 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 advantage 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 seelater 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-only solution, although it is now being developed via an independent consortium to become cross-platform. Effectively, ActiveX says “if your program connects to篇二:JAVA思想外文翻译毕业设计文献来源:Bruce Eckel. Thinking in Java [J]. Pearson Higher Isia Education,XX-2-20.Java编程思想 (Java和因特网)既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。
java英文参考文献

三一文库()〔java英文参考文献〕*篇一:外文参考文献译文及原文本科毕业设计(论文)外文参考文献译文及原文学院_____计算机学院______专业___计算机科学与技术___年级班别____2009级(1)班__学号学生姓名_______________指导教师______________2013年5月目录译文:C#.NET开发者指南前言................................................. ................................................... . (1)第一章微软.NET平台的介绍................................................. (3)1.1简介................................................. ................................................... . (3)平台简介................................................. .. (3)1.1.2微软的.NET和WINDOWS的基因................................................. . (4)1.1.3微软.NET体系结构................................................. (4)平台的特点................................................. . (4)1.1.5多国语言的发展................................................. .. (5)1.1.6平台和处理器独立性................................................. .. (6)1.1.7自动内存管理................................................. (7)1.1.8支持的版本................................................. ................................................... ..71.1.9支持的开放标准................................................. .. (8)1.1.10配置简单................................................. ................................................... . (8)1.1.11分布式体系结构................................................. (9)1.1.12与非托管代码的互用................................................. (9)原文:C#.NETWebDevelopersGuideForeword........................................... ................................................... ........................................11Chapter1I Platform.............. .. (13)1.1Introduction.................................... ................................................... (13)Platform................. . (13)andWindowsDNA.................... . (15)ArchitectureHierarchy............ (15)Platform..................... (16)1.1.5MultilanguageDevelopment...................... .. (17)1.1.6PlatformandProcessorIndependence.............. .. (18)1.1.7AutomaticMemoryManagement..................... . (19)1.1.8VersioningSupport............................. ................................................... ..201.1.9SupportforOpenStandards....................... .. (21)1.1.10EasyDeployment............................... ................................................... . (22)1.1.11DistributedArchitecture...................... .. (23)1.1.12InteroperabilitywithUnmanagedCode............ (23)译文:C#.NET开发者指南前言在电脑软件的历史上,很少有一种技术能够得到开发者和业界如此强烈的正面响应。
java JDBC 外文翻译 外文文献 英文文献

java JDBC 外文翻译外文文献英文文献原文一:Java Programming with Oracle JDBC:PerformancePerformance is usually considered an issue at the end of a development cycle when it should really be considered from thestart.Often, a task called "performance tuning" is done after the coding is complete, and the end user of a program complains about how long it takes the program to complete a particular task.The net result of waiting until the end of the development cycle to consider performance includes the expense of the additional time required to recode a program to improve its performance.It's my opinion that performance is something that is best considered at the start of a project.When it comes to performance issues concerning JDBC programmingthere are two major factors to consider. The first is the performance of the database structure and the SQL statements used against it. The second is the relative efficiency of the different ways you can use the JDBC interfaces to manipulate a database.In terms of the database's efficiency, you can use the EXPLAIN PLAN facility to explain how the database's optimizer plans to execute your SQL statements. Armed with this knowledge, you may determine that additional indexes are needed, or that you require an alternative means of selecting the data you desire.On the other hand, when it comes to using JDBC, you need to know ahead of time the relative strengths and weaknesses of using auto-commit, SQL92 syntax, and a Statement versus a PreparedStatement versus a CallableStatement object. In this chapter, we'll examine the relative performance of various JDBC objects using example programs that report the amount of time it takes to accomplish a given task. We'll first look at auto-commit. Next, we'll look at the impact of the SQL92 syntax parser. Then we'll start a series of comparisons of the Statement object versus the PreparedStatement object versus the CallableStatement object. At the same time we'll also examine the performance of the OCI versusthe Thin driver in each situation to see if, as Oracle's claims, thereis a significant enough performance gain with the OCI driver that you should use it instead of the Thin driver. For the most part, our discussions will be based on timing data for 1,000 inserts into the test performance table TESTXXXPERF. There are separate programs forperforming these 1,000 inserts using the OCI driver and the Thin driver.The performance test programs themselves are very simple and are available online with the rest of the examples in this book. However,for brevity, I'll not show the code for the examples in this chapter.I'll only talk about them. Although the actual timing values change from system to system, their relative values, or ratios from one system to another, remain consistent. The timings used in this chapter were gathered using Windows 2000. Using objective data fromthese programs allows us to come to factual conclusions on which factors improve performance, rather than relying on hearsay.I'm sure you'll be surprised at the reality of performance for these objects, and I hope you'll use this knowledge to your advantage. Let's get started with a look at the testing framework used in this chapter.A Testing FrameworkFor the most part, the test programs in this chapter report the timings for inserting data into a table. I picked an INSERT statement because it eliminates the performance gain of the database block buffers that may skew timings for an UPDATE, DELETE, or SELECT .The test table used in the example programs in this chapter is a simple relational table. I wanted it to have a NUMBER, a small VARCHAR2, a large VARCHAR2, and a DATE column. Table TESTXXXPERF is defined as:create table TestXXXPerf (id number,code varchar2(30),descr varchar2(80),insert_user varchar2(30),insert_date date )tablespace users pctfree 20storage( initial 1 M next 1 M pctincrease 0 );alter table TestXXXPerfadd constraint TestXXXPerf_Pkprimary key ( id )using indextablespace users pctfree 20storage( initial 1 M next 1 M pctincrease 0 );The initial extent size used for the table makes it unlikely thatthe database will need to take the time to allocate another extentduring the execution of one of the test programs. Therefore, extent allocation will not impact the timings. Given this background, youshould have a context to understand what is done in each section by each test program. Auto-CommitBy default, JDBC's auto-commit feature is on, which means that each SQL statement is committed as it is executed. If more than one SQL statement is executed by yourprogram, then a small performance increase can be achieved byturning off auto-commit.Let's take a look at some numbers. Table 19-1 shows the average time, in milliseconds, needed to insert 1,000 rows into the TESTXXXPERF table using a Statement object. The timings represent the average from three runs of the program. Both drivers experience approximately a one-second loss as overhead for committing between each SQL statement. When you divide that one second by 1,000 inserts, you can see that turning off auto-commit saves approximately 0.001 seconds (1 millisecond) per SQL statement. While that's not interesting enough to write home about, it does demonstrate how auto-commit can impact performance.Table 19-1: Auto-commit timings (in milliseconds)Auto-commit OCI ThinOn 3,712 3,675Off 2,613 2,594Clearly, it's more important to turn off auto-commit for managing multistep transactions than for gaining performance. But on a heavily loaded system where many users are committing transactions, the amountof time it takes to perform commits can become quite significant. So my recommendation is to turn off auto-commit and manage your transactions manually. The rest of the tests in this chapter are performed with auto-commit turned off.SQL92 Token ParsingLike auto-commit, SQL92 escape syntax token parsing is on by default. In case you don't recall, SQL92 token parsing allows you to embed SQL92 escape syntax in your SQL statements (see "Oracle and SQL92 Escape Syntax" in Chapter 9). These standards-based snippets of syntax are parsed by a JDBC driver transforming the SQL statement into its native syntax for the target database. SQL92 escape syntax allows you to make your code more portable--but does this portability come with a cost in terms of performance?Table 19-2 shows the number of milliseconds needed to insert 1,000 rows into the TESTXXXPERF table. Timings are shown with the SQL92 escape syntax parser on and off for both the OCI and Thin drivers. As before, these timings represent the result of three program runs averaged together.Table 19-2: SQL92 token parser timings (in milliseconds)SQL92 parser OCI ThinOn 2,567 2,514Off 2,744 2,550Notice from Table 19-2 that with the OCI driver we lose 177 milliseconds when escape syntax parsing is turned off, and we lose only 37 milliseconds when the parser is turned off with the Thin driver. These results are the opposite of what you might intuitively expect. It appears that both drivers have been optimized for SQL92 parsing, so you should leave it on for best performance.Now that you know you never have to worry about turning the SQL92 parser off, let's move on to something that has some potential for providing a substantial performance improvement.Statement Versus PreparedStatementThere's a popular belief that using a PreparedStatement object is faster than using a Statement object. After all, a prepared statement has to verify its metadata against the database only once, while a statement has to do it every time. So how could it be any other way? Well, the truth of the matter is that it takes about 65 iterations of a prepared statement before its total time for execution catches up with a statement. When it comes to which SQL statement object performs better under typical use, a Statement or aPreparedStatement, the truth is that the Statement object yields the best performance. When you consider how SQL statements are typicallyused in an application--1 or 2 here, maybe 10-20 (rarely more) per transaction--you realize that a Statement object will perform them in less time than a PreparedStatement object. In the next two sections,we'll look at this performance issue with respect to both the OCI driver and the Thin driver. The OCI DriverTable 19-3 shows the timings in milliseconds for 1 insert and 1,000 inserts in the TESTXXXPERF table. The inserts are done first using a Statement object and then a PreparedStatement object. If you look at the results for 1,000 inserts, you may think that a prepared statement performs better. After all, at 1,000 inserts, the PreparedStatement object is almost twice as fast as the Statement object, but if you examine Figure 19-1, you'll see a different story.Table 19-3: OCI driver timings (in milliseconds)Inserts Statement PreparedStatement1 10 1131,000 2,804 1,412Figure 19-1 is a graph of the timings needed to insert varying numbers of rows using both a Statement object and a PreparedStatement object. The number of inserts begins at 1 and climbs in intervals of 10 up to a maximum of 150 inserts. For this graph and for those that follow, the lines themselves are polynomial trend lines with a factor of 2. I chose polynomial lines instead of straight trend lines so you can better see a change in the performance as the number of inserts increases. I chose a factor of 2 so the lines have only one curve inthem. The important thing to notice about the graph is that it's not until about 65 inserts that the PreparedStatement object outperforms the Statement object. 65 inserts! Clearly, the Statement object is more efficient under typical use when using the OCI driver.Figure 19-1The Thin DriverIf you examine Table 19-4 (which shows the same timings as for Table 19-3, but for the Thin driver) and Figure 19-2 (which shows the data incrementally), you'll see that the Thin driver follows the same behavior as the OCI driver. However, since the Statement object starts out performing better than the PreparedStatement object, it takes about 125 inserts for the PreparedStatement to outperform Statement.Table 19-4: Thin driver timings (in milliseconds)Inserts Statement PreparedStatement1 10 1131,000 2,583 1,739Figure 19-2When you consider typical SQL statement usage, even with the Thin driver, you'll get better performance if you execute your SQL statements using a Statement object instead of a PreparedStatement object. Given that, you may ask: why use a PreparedStatement at all? It turns out that there are some reasons why you might use a PreparedStatement object to execute SQL statements. First, there are several types of operationsthat you simply can't perform without PreparedStatement object.For example,you must use a PreparedStatement object if you want to use large objects like BLOBs or CLOBs or if you wish to use object SQL. Essentially, you trade some loss of performance for the added functionality ofusing these object technologies.A second reason to use a PreparedStatement is its support for batching.BatchingAs you saw in the previous section, PreparedStatement objects eventually become more efficient than their Statement counterparts after 65-125 executions of the same statement. If you're going to execute a given SQL statement a large number of times, it makes sense from aperformance standpoint to use a PreparedStatement object. But if you're really going to do that many executions of a statement, or perhaps more than 50, you should consider batching. Batching is more efficient because it sends multiple SQL statements to the server at one time. Although JDBC defines batching capability for Statement objects, Oracle supports batching only when Prepared-Statement objects are used. This makes some sense. A SQL statement in a PreparedStatement object is parsed once and can be reused many times. This naturally lends itself to batching. The OCI DriverTable 19-5 lists Statement and batched PreparedStatement timings, in milliseconds, for 1 insert and for 1,000 inserts. At the low end, one insert, you take a small performance hit for supporting batching. At the high end, 1,000 inserts, you've gained 75% throughput.Table 19-5: OCI driver timings (in milliseconds)Inserts Statement Batched1 10 1171,000 2,804 691If you examine Figure 19-3, a trend line analysis of the Statement object versus the batched PreparedStatement object, you'll see that this time, the batched Prepared-Statement object becomes more efficient than the Statement object at about 50 inserts. This is an improvement over the prepared statement without batching.Figure 19-3WARNING: There's a catch here. The 8.1.6 OCI driver has a defect by which it does not support standard Java batching, so the numbers reported here were derived using Oracle's proprietary batching.Now, let's take a look at batching in conjunction with the Thin driver. The Thin DriverThe Thin driver is even more efficient than the OCI driver when it comes to using batched prepared statements. Table 19-6 shows the timings for the Thin driver using a Statement object versus a batched PreparedStatement object in milliseconds for the specified number of inserts.Table 19-6: Thin driver timings (in milliseconds)Inserts Statement Batched1 10 1171,000 2,583 367The Thin driver takes the same performance hit on the low end, one insert, but gains a whopping 86% improvement on the high end. Yes, 1,000 inserts in less than a second! If you examine Figure 19-4, you'll see that with the Thin driver, the use of a batched PreparedStatement objectbecomes more efficient than a Statement object more quickly than with the OCI driver--at about 40 inserts.Figure 19-4If you intend to perform many iterations of the same SQL statement against a database, you should consider batching with a PreparedStatement object.We've finished looking at improving the performance of inserts, updates, and deletes. Now let's see what we can do to squeak out alittle performance while selecting data. Predefined SELECT Statements Every time you execute a SELECT statement, the JDBC driver makes two round trips to the database. On the first round trip, it retrieves the metadata for the columns you are selecting. On the second round trip, it retrieves the actual data you selected. With this in mind, you can improve the performance of a SELECT statement by 50% if you predefine the Selecstatement by using Oracle's defineColumnType()method with an OracleStatement object (see "Defining Columns" in Chapter 9). When you predefine a SELECT statement, you provide the JDBC driver with the column metadata using the defineColumnType() method, obviating the needfor the driver to make a round trip to the database for that information. Hence, for a singleton SELECT, you eliminate half the work when you predefine the statement.Table 19-7 shows the timings in milliseconds required to select a single row from the TESTXXXPERF table. Timings are shown for when the column type has been predefined and when it has not been predefined. Timings are shown for both the OCI and Thin drivers. Although the defineColumnType() method shows little improvement with either driver in my test, on a loaded network, you'll see a differentiation in thetimings of about 50%. Given a situation in which you need to makeseveral tight calls to the database using a Statement, a predefined SELECT statement can save you a significant amount of time.Table 19-7: Select timings (in milliseconds)Driver Statement defineColumnType( )OCI 13 10Thin 13 10Now that we've looked at auto-commit, SQL92 parsing, prepared statements, and a predefined SELECT, let's take a look at the performance of callable statements. CallableStatementsAs you may recall, CallableStatement objects are used to execute database stored procedures. I've saved CallableStatement objects until last, because they are the slowest performers of all the JDBC SQL execution interfaces. This may sound counterintuitive, because it's commonly believed that calling stored procedures is faster than usingSQL, but that's simply not true. Given a simple SQL statement, and a stored procedure call thataccomplishes the same task, the simple SQL statement will always execute faster. Why? Because with the stored procedure, you not only have the time needed to execute the SQL statement but also the time needed to deal with the overhead of the procedure call itself.Table 19-8 lists the relative time, in milliseconds, needed to call the stored procedure TESTXXXPERF$.SETTESTXXXPERF(). This stored procedure inserts one row into thetable TESTXXXPERF. Timings are provided for both the OCI and Thin drivers. Notice that both drivers are slower when inserting a row this way than when using either a statement or a batched prepared statement (refer to Tables 19-3 through 19-6). Common sense will tell you why. The SETTESTXXXPERF()procedure inserts a row into thedatabase. It does exactly the same thing that the other JDBC objects did but with the added overhead of a round trip for executing the remote procedure call.Table 19-8: Stored procedure call timings (in milliseconds)Inserts OCI Thin1 113 1171,000 1,723 1,752Stored procedures do have their uses. If you have a complex taskthat requires several SQL statements to complete, and you encapsulate those SQL statements into a stored procedure that you then call onlyonce, you'll get better performance than if you executed each SQL statement separately from your program. This performance gain is the result of your program not having to move all the related data back and forth over the network, which is often the slowest part of the data manipulation process. This is how stored procedures are supposed to be used with Oracle--not as a substitute for SQL, but as a means to perform work where it can be done most efficiently.OCI Versus Thin DriversOracle's documentation states that you should use the OCI driver for maximum performance and the Thin driver for maximum portability. However, I recommend using the Thin driver all the time. Let's take a look at some numbers from Windows 2000. Table 19-9 lists all the statisticswe've covered in this chapter.Table 19-9: OCI versus Thin driver timings (in milliseconds)Metric OCI Thin1,000 inserts with auto-commit 3,712 3,6751,000 inserts with manual commit 2,613 2,5941 insert with Statement 10 101,000 inserts with Statement 2,804 2,5831 insert with PreparedStatement 113 1131,000 inserts batched 1,482 367SELECT 10 10Predefined SELECT 10 101 insert with CallableStatement 113 1171,000 inserts with CallableStatement 1,723 1,752Totals 12,590 11,231As you can see from Table 19-9, the Thin driver clearly outperforms the OCI driver for every type of operation except executions of CallableStatement objects. On a Unix platform, my experience has been that the CallableStatement numbers are tilted even more in favor of the OCI driver. Nonetheless, you can feel completely comfortable using the Thin driver in almost any setting. The Thin driver has been well-tuned by Oracle's JDBC development team to perform better than its OCI counterpart.原文二:Extending StrutsIntroductionI have seen lot of projects where the developers implemented a proprietary MVC framework, not because they wanted to do something fundamentally different from Struts, but because they were not aware of how to extend Struts. You can get total control by developing your own MVC framework, but it also means you have to commit a lot of resources to it, something that may not be possible in projects with tight schedules.Struts is not only a very powerful framework, but also very extensible. You can extend Struts in three ways.PlugIn: Create your own PlugIn class if you want to execute some business logic at application startup or shutdown.RequestProcessor: Create your own RequestProcessor if you want to execute some business logic at a particular point during the request-processing phase. For example, you might extend RequestProcessor tocheck that the user is logged in and he has one of the roles to executea particular action before executing every request.ActionServlet: You can extend the ActionServlet class if you want to execute your business logic at either application startup or shutdown,or during request processing. But you should use it only in cases where neither PlugIn nor RequestProcessor is able to fulfill your requirement.In this article, we will use a sample Struts application to demonstrate how to extend Struts using each of these three approaches. Downloadable sample code for each is available below in the Resources section at the end of this article. Two of the most successful examples of Struts extensions are the Struts Validation framework and the Tiles framework.I assume that you are already familiar with the Struts framework and know how to create simple applications using it. Please see the Resources section if you want to know more about Struts.PlugInAccording to the Struts documentation "A plugin is a configuration wrapper for a module-specific resource or service that needs to be notified about application startup and shutdown events." What this means is that you can create a class implementing the PlugIn interface to do something at application startup or shutdown.Say I am creating a web application where I am using Hibernate asthe persistencemechanism, and I want to initialize Hibernate as soon as the application starts up, so that by the time my web application receives the first request, Hibernate is already configured and ready to use. We also want to close down Hibernate when the application is shutting down. We can implement this requirement with a Hibernate PlugIn by following two simple steps.Create a class implementing the PlugIn interface, like this:public class HibernatePlugIn implements PlugIn{private String configFile;// This method will be called at application shutdown timepublic void destroy() {System.out.println("Entering HibernatePlugIn.destroy()");//Put hibernate cleanup code hereSystem.out.println("Exiting HibernatePlugIn.destroy()");}//This method will be called at application startup timepublic void init(ActionServlet actionServlet, ModuleConfig config) throws ServletException {System.out.println("Entering HibernatePlugIn.init()");System.out.println("Value of init parameter " +getConfigFile());System.out.println("Exiting HibernatePlugIn.init()");}public String getConfigFile() {return name;}public void setConfigFile(String string) {configFile = string;}}The class implementing PlugIn interface must implement two methods: init() and destroy(). init() is called when the application starts up, and destroy() is called at shutdown. Struts allows you to pass init parameters to your PlugIn class. For passing parameters, you have to create JavaBean-type setter methods in your PlugIn class for every parameter. In our HibernatePlugIn class, I wanted to pass the name of the configFile instead of hard-coding it in the application.Inform Struts about the new PlugIn by adding these lines to struts-config.xml:<struts-config><!-- Message Resources --><message-resources parameter="sample1.resources.ApplicationResources"/><plug-in className="com.sample.util.HibernatePlugIn"><set-property property="configFile"value="/hibernate.cfg.xml"/></plug-in></struts-config>The className attribute is the fully qualified name of the class implementing the PlugIn interface. Add a <set-property> element for every initialization parameter which you want to pass to your PlugIn class. In our example, I wanted to pass the name of the config file, so I added the <set-property> element with the value of config file path.Both the Tiles and Validator frameworks use PlugIns forinitialization by reading configuration files. Two more things which you can do in your PlugIn class are:If your application depends on some configuration files, then youcan check their availability in the PlugIn class and throw a ServletException if the configuration file is not available. This will result in ActionServlet becoming unavailable.The PlugIn interface's init() method is your last chance if you want to change something in ModuleConfig, which is a collection of static configuration information that describes a Struts-based module. Struts will freeze ModuleConfig once all PlugIns are processed.How a Request is ProcessedActionServlet is the only servlet in Struts framework, and is responsible for handling all of the requests. Whenever it receives a request, it first tries to find a sub-application for the current request. Once a sub-application is found, it creates a RequestProcessorobject for that sub-application and calls its process() method bypassing it HttpServletRequest and HttpServletResponse objects.The RequestProcessor.process() is where most of the request processing takes place. The process() method is implemented using the Template Method design pattern, in which there is a separate method for performing each step of request processing, and all of those methods are called in sequence from the process() method. For example, there are separate methods for finding the ActionForm class associated with the current request, and checking if the current user has one of therequired roles to execute action mapping. This gives ustremendous flexibility. The RequestProcessor class in the Struts distribution provides a default implementation for each of the request-processing steps. That means you can override only the methods that interest you, and use default implementations for rest of the methods. For example, by default Struts calls request.isUserInRole() to find out if the user has one of the roles required to execute the current ActionMapping, but if you want to query a database for this, then thenall you have to do is override the processRoles() method and return true or false, based whether the user has the required role or not.First we will see how the process() method is implemented by default, and then I will explain what each method in the default RequestProcessor class does, so that you can decide what parts of request processing you want to change.public void process(HttpServletRequest request,HttpServletResponse response)throws IOException, ServletException {// Wrap multipart requests with a special wrapper request = processMultipart(request);// Identify the path component we will// use to select a mappingString path = processPath(request, response);if (path == null) {return;}if (log.isDebugEnabled()) {log.debug("Processing a '" + request.getMethod() + "' for path '" + path + "'");}// Select a Locale for the current user if requested processLocale(request, response);// Set the content type and no-caching headers// if requestedprocessContent(request, response);processNoCache(request, response);// General purpose preprocessing hookif (!processPreprocess(request, response)) {return;}。
JAVA外文资料翻译

doc文ห้องสมุดไป่ตู้可能在WAP端浏览体验不佳。建议您优先选择TXT,或下载源文件到本机查看。
外文文献原文及翻译 作 者:辛明 生物医学工程学院影像工程专业 生物医学工程学院信息技术系 指导老师:杨谊
Parsing Java Abstraction of the Difference Between Classes and Interfaces In Java language, abstract scale-up and with support class abstraction definition of two mechanisms. Because of these two kinds of mechanism of existence, just gives Java powerful object-oriented skills. Abstract scale-up and with between class abstraction definition for support has great similarities, even interchangeable, so many developers into line nonabstract class definition for abstract scale-up and it is becoming more casual with choice. In fact, both between still has the very big difference, for their choice even reflected in problem domain essence of understanding, to design the intentions of the understand correctly and reasonable. This paper will for the difference analysis, trying to give a developer with a choice between them are based. Understand class abstraction Abstract class and interface in Java language is used for abstract classes (in this article nonabstract class not from abstract scale-up translation, it represents an abstract body, and abstract scale-up for Java language used to define class abstraction in one way, please readers distinguish) defined, then what are the abstract classes, use abstract classes for us any good? In object-oriented concept, we know all objects is through class to describe, but in turn not such. Not all classes are used to describe object, if a class does not contain enough information to portray a concrete object, this class is abstract classes. Abstract classes are often used to characterization of problem field in our analysis, design that the abstract concepts, is to the series will look different, but essentially the same exact conception of abstraction. For example: if we carry out a graphical editing software development, will find problem domain exists round, triangle so some specific concept, they are different, but they all belong to shape such a concept, shape this concept in problem domain is not exist, it is an abstract concept. Precisely because the abstract concepts in problem field no corresponding specific concept, so to characterization abstract concepts nonabstract class cannot be instantiated. In an object-oriented field, mainly used for class abstraction types hidden. We can construct a fixed a group of behavior of abstract description, but this group of behavior but can have any a possible concrete implementation. This abstract describe is abstract classes, and this an arbitrary a possible concrete realization is behaved for all possible derived class. Modules can be operating an abstract body. Due to the module dependent on a fixed abstraction body, so it can are not allowed to modify, Meanwhile, through the abstract derived from the body, also can expand the behavior of this module function. Familiar with OCP readers must know, object-oriented design to be able to achieve a core principles OCP (Open - Closed flying), class abstraction is one of the key. From the perspectives of grammar definition abstract class and interface
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 coming 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 initial 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 acommon 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 of response 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 file must 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 is 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 into the appropriate spot in the browser. It tells the browser “from now on you can perform this new activity.” (You ne ed 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 sophisticated 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 withinthat 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 with Java; it’s named that way just to grab some of Java’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 Web 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 theway 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 as much work as possible on the client before and after making requests of the server. F or 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 advantage a Java applet has ove r 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-only solution, 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.” (I E 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 Del phi, 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, which prevents it from wri ting 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 be forced 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 und erstand 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 respon sible 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 file in 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 programmability. As you’l l 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不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。
--计算机专业开题报告外文文献及中文翻译

--计算机专业开题报告外文文献及中文翻译DEVELOPMENT HISTORY OF JSPBy:Kathy Sierra and Bert BatesSource: Servlet&JSPThe Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the scape pany of server- side JavaScript( SSJS)and the Active Server Pages(ASP)of the Microsoft、 JSP pares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web、 Though the norm of JSP is to be draw up by the Sun pany of, any factory can carry out the JSP on own system、 The After Sun release the JS P( the Java Server Pages)formally, the this kind of new Web application development technique very quickly caused the peoples concern、 JSP provided a special development environment for the Web application that establishes the high dynamic state、 According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4、0 on the market at inside of85% server product、This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP、1、1 GENER ALIZEThe JSP(Java Server Pages)is from the pany of Sun Microsystems initiate, the many panies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function、JSP and the technique of ASP of the Microsoft is very alike、 Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of 、Underneath we are simple of carry on the introduction to it、JSP pages are translated into servlets、 So, fundamentally, any task JSP pages can perform could also be acplished by servlets、 However, this underlyingequivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios、 The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other、After all, anything you can do on a particular puter platform in the Java programming language you could also do in assembly language、 But it still matters which you choose、JSP provides the following benefits over servlets alone: • It is easier to write and maintain the 、 Your static code is ordinary : no extra backslashes, no double es, and no lurking Java syntax、• You can use standard Web-site development tools、 Even tools that know nothing about JSP can be used because they simply ignore the JSP tags、• You can divide up your development team、 The Java programmers can work on the dynamic code、 The Web developers can concentrate on the presentation layer、 On large projects, this division is very important、 Depending on the size of your team and the plexity of your project, you can enforce a weaker or stronger separation between the static and the dynamic content、Now, this discussion is not to say that you should stop using servlets and use only JSP instead、 Byno means、 Almost all projects will use both、 For some requests in your project, you will use servlets、 For others, you will use JSP、 For still others, you will bine them with the MVC architecture 、 You want the apGFDGpropriate tool for the job, and servlets, by themselves, do not plete your toolkit、1、2 SOURCE OF JSPThe technique of JSP of the pany of Sun, making the page of Web develop the personnel can use the perhaps marking of XML to design to turn the end page with format、 Use the perhaps small script future life of marking of JSP bees the dynamic state on the page contents、( the contents changes according to the claim of)The Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can plete, this name of Servlet es from the Applet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but dont do any translation, if reader would like to, can call it as" small service procedure"、 The Servlet is similar to traditional CGI, ISAPI, NSAPI etc、Web procedure development the function of the tool infact, at use the Java Servlet hereafter, the customer need not use again the lowly method of CGI of efficiency, also need not use only the ability e to born page of Web of dynamic state in the method of API that a certainfixed Web server terrace circulate、 Many servers of Web all support the Servlet, even not support the Servlet server of Web directly and can also pass the additional applied server and the mold pieces to support the Servlet、 Receive benefit in the characteristic of the Java cross-platform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is plete to have nothing to do with terrace and is to have nothing to do with server of Web、Because the Java Servlet is internal to provide the service by the line distance, need not start a progress to the each claimses, and make use of the multi-threading mechanism can at the same time for several claim service, therefore the efficiency of Java Servlet is very high、But the Java Servlet also is not to has no weakness, similar to traditional CGI, ISAPI, the NSAPI method, the Java Servlet is to make use of to output the language sentence to carry out the dynamic state web page of, ifdevelop the whole website with the Java Servlet, the integration process of the dynamic state part and the static state page is an evil-foreboding dream simply、For solving this kind of weakness of the Java Servlet, the SUN released the JSP、A number of years ago, Marty was invited to attend a small20-person industry roundtable discussion on software technology、 Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language、 Sitting several seats away was a high-level manager from a very large software pany in Redmond, Washington、 During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology、 The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea、 He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his panys usual "embrace and extend" strategy、 At this point, Gosling lightheartedly interjected "You mean disgrace and distend、" Now, the grievance that Gosling was airing was that he felt that this pany would take technology from other panies andsuborn it for their own purposes、 But guess what? The shoe is on the other foot here、 The Java munity did not invent the idea of designing pages as a mixture of static and dynamic code marked with special tags、 For exle,Cold Fusion did it years earlier、 Even ASP (a product from the very software pany of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon、 In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did、The JSP is an establishment atthe model of Java servlets on of the expression layer technique, it makes the plait write the to bee more simple、Be like the SSJS, it also allows you carry the static state contents and servers the script mix to put together the born dynamic state exportation、 JSP thescript language that the Java is the tacit approval, however, be like the ASP and can use otherlanguages( such as JavaScript and VBScript), the norm of JSP also allows to use other languages、1、3JSP CHARACTERISTICSIs a service according to the script language in some one language of the statures system this kind of discuss, the JSP should be see make is a kind ofscript language、 However, be a kind of script language, the JSP seemed to be too strong again, almost can use all Javas in the JSP、Be a kind of according to textoriginally of, take manifestation as the central development technique, the JSP provided all advantages of the Java Servlet, and, when bine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate、Separate the contents and advantage of logical manifestations is, the personnel who renews the page external appearance need not know the code of Java, and renew the JavaBeans personnel also need not be design the web page of expert in hand, can use to take the page of JavaBeans JSP to define the template of Web, to build up a from have the alike external appearance of the website that page constitute、 JavaBeans pletes the data to provide, having no code of Java in the template thus,this means that these templates can be written the personnel by a plait to support、 Certainly, can also make use of the Java Servlet to control the logic of the website, adjust through the Java Servlet to use the way of the document of JSP to separate website of logic andcontents、Generally speaking, in actual engine of JSP, the page of JSP is the edit and translate type while carry out, not explain the type of、 Explain the dynamic state web page development tool of the type, such as ASP, PHP3 etc、, because speed etc、 reason, have already cant satisfy current the large electronic merce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+;PHP3 → PHP4、In the JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and must write with the Java definitely、 Actually, have some engines of JSP are adoptive other script languages such as the EMAC- Script, etc、, but actually this a few script languages also are to set up on the Java, edit and translate for the Servlet to carry out of、 Write according to the norm of JSP, have noScriptlet of relation with Java also is can of, however, mainly lie in the ability and JavaBeans, the Enterprise JavaBeanses because of the JSP strong function to work together, so even is the Scriptlet part not to use the Java, edit and translate of performance code also shouldis related with Java、1、4JSP MECHANISMTo prehend the JSP how unite the technical advantage that above various speak of, e to carry out various result easily, the customer must understand the differentiation of" the module develops for the web page of the center" and" the page develops for the web page of the center" first、 The SSJS and ASP are all in several year ago to release, the work of that time is still very young, no one knows to still have in addition to making all business, datas and the expression logic enter the original web page entirely heap what better solve the method、 This kind of model that take page as the center studies and gets the very fast development easily、 However, along with change of time, the people know that this kind of method is unwell in set up large, the Web that can upgrade applies the procedure、 The expression logic write in the script environment was lock in the page, only passing to shear to slice and glue to stick then can drive heavy use、Express the logic to usually mix together with business and the data logics, when this makes be the procedure member to try to change an external appearance that applies the procedure but do not want to break with itsllied business logic, apply the procedure of maintenance be like to walk the similar difficulty on the eggshell、In fact in the business enterprise, heavy use the application of the module already through very mature, no one would like to rewrite those logics for their applied procedure、 and sketch the designer handed over to the implement work of their design the Web plait the one who write, make they have to double work- Usually is the handicraft plait to write, because have no fit tool and can carry the script and the contents knot to the server to put together、 Chien but speech, apply the plexity of the procedure along with the Web to promote continuously, the development method that take page as the centerlimits sex to bee to get up obviously、 At the same time, the people always at look for the better method of build up the Web application procedure, the module spreads in customers machine/ server the realm、 JavaBeans and ActiveX were published the pany to expand to apply the procedure developer for Java and Windows to use to e to develop the plicated procedure quickly by" the fast application procedure development"( RAD)tool、 These techniques make the expert in the some realm be able to write the module for the perpendicular application plait in the skill area, but the developer can go fetch the usage directly but need not control the expertise of this realm、Be a kind of take module as the central development terrace, the JSP appeared、 It with the JavaBeans and Enterprise JavaBeans( EJB)module includes the model of the business and the data logic for foundation, provide a great deal of label and a script terraces to use to e to show in the page from the contents of JavaBeans creation or send a present in return、 Because of the property that regards the module as the center of the JSP, it can drive Java and not the developer of Java uses equally、 Not the developer of Java can pass the JSP label( Tags) to use the JavaBeans that the deluxe developer of Java establish、 The developer of Java not only can establish and use the JavaBeans, but also can use the language of Java to e to control more accurately in the JSP page according to the expression logic of the first floor JavaBeans、 See now how JSP is handle claim of 、In basic claim model, a claim directly was send to JSPpage in、 The code of JSP controls to carry on hour of the logic processing and module of JavaBeanses hand over with each other, and the manifestation result in dynamic state bornly, mixing with the page of the static state code、 The Beans can be JavaBeans or module of EJBs、Moreover, the more plicated claim model can see make from is request other JSP pages of the page call sign or Java Servlets、The engine of JSP wants to chase the code of Java that the label of JSP, code of Java in the JSP page even all converts into the big piece together with the static state contents actually、 These codes piece was organized the Java Servlet that customer can not see to go to by the engine of JSP, then the Servlet edits and translate them automatically byte。
java中英文文献

南京理工大学紫金学院毕业设计(论文) 外文资料翻译系:运算机系专业:运算机科学与技术姓名:学号:090601416外文出处:(用外文写) Ghosh,D..Java Object-oriented programming[J]. IEEE Transactions on Software Engineering,2020, 13(3):42-45. 附件:1.外文资料翻译译文;2.外文原文。
指导教师评语:签名:年月日注:请将该封面与附件装订成册。
附件1:外文资料翻译译文Java 的面向对象编程——面向对象编程和它的关键技术—继承和多态性软件的重用能够节省程序开发时刻。
它鼓舞重复利用已经调试好的高质量的软件,从而减少系统运行后可能显现的问题。
这些都是令人振奋的可能性。
多态性许诺咱们用统一的风格编写程序,来处置多种已存在的类和特定的相关类。
利用多态性咱们能够方便地向系统中添加新的功能。
继承和多态关于解决软件的复杂性是一种有效可行的技术。
当创建一个新的类时,而不用完整的写出新的实例变量和实例方式,程序员会指定新的类继承已概念的超类的实例变量和实例方式。
那个新的类被称为一个子类。
每一个子类本身以后亦可有新的子类,而其本身将成为父类。
一个类的直接父类确实是该类所直接继承的类(通过关键字extends 继承)。
一个间接超类是通过从两级或更多级以上的类继承而来的。
例如,从类JApplet (包javax. swing中)扩展来的类Applet (包java. applet)。
一个类单一的从一个父类继承而来。
Java不支持多重继承(而C++能够),但它支持接口的概念。
接口能够使Java 实现许多通过量重继承才能实现的优势而没有关联的问题。
咱们将在本章讨论的接口的详细内容。
咱们会给出创建和利用接口的一样规律和具体实例。
一个子类通常添加自己的实例变量和自己的实例方式,因此子类通常比父类大。
一个子类比它的父类更具体而且代表一组更小、更专业的对象。
计算机系 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毕业设计中英文翻译

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 coming 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 initial 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 backto 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 of response time. The response of a CGI program depends on how much data mustbe 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 didnot 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 file must 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 atyour Web site.The problem with discussions of client-side programming is 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 into the 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 wantto 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 sophisticatedthings 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 with Java; it’s named that way just to grab some of Java’s marketing momentum), VBScript (which looks like Visual Basic), andTcl/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 Web 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 allowsclient-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 as much work as possible on the client before and after making requests of theserver. 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 yourclient 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 advantage 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 Website. 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-only solution, although it is now being developed via an independent consortium to become cross-platform. Effectively, ActiveX says “if your program connects to篇二:JAVA思想外文翻译毕业设计文献来源:Bruce Eckel. Thinking in Java [J]. Pearson Higher Isia Education,XX-2-20.Java编程思想 (Java和因特网)既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。
Java外文文献翻译

Java外文文献翻译摘要Java是一种面向对象的高级程序设计语言,具有良好的跨平台性和可扩展性。
本文翻译了一篇英文文献,介绍了Java 语言的特点、历史背景以及它在计算机科学领域中的应用。
引言Java是由James Gosling和他的团队于上世纪90年代初开发的一种面向对象编程语言。
Java的设计初衷是为了解决嵌入式系统中的问题,但随着时间的推移,它渐渐被广泛应用于Web应用开发、移动应用开发以及大数据处理等领域。
特点Java具有以下几个主要特点:1.跨平台性:Java虚拟机(JVM)使得Java代码可以在不同的平台上运行,无需针对特定操作系统进行编译。
这一特点使得Java成为一种非常适合开发跨平台应用的语言。
2.可扩展性:Java的设计允许开发者通过编写自定义类库实现功能的扩展。
这种可扩展性使得Java成为一种非常灵活的语言,可以满足不同应用领域的需求。
3.面向对象:Java采用面向对象的编程范式,它支持封装、继承和多态等特性。
面向对象的编程范式使得Java 代码更易于组织、理解和维护。
4.良好的性能:Java虚拟机通过即时编译和垃圾回收等技术来提高运行时的性能。
这使得Java成为一种可靠且高效的编程语言。
历史背景Java的设计始于1991年,当时James Gosling和他的团队正在开发一种用于嵌入式系统的语言。
最初的设计称为Oak,后来在1995年更名为Java。
当时,互联网开始崭露头角,Sun Microsystems(Java的创始公司)意识到嵌入式系统的语言可能无法满足未来互联网应用的需求,于是将Oak重新设计为面向Web的语言。
Java的发布引起了广泛关注,并以其跨平台特性和安全性而闻名。
应用领域Java在计算机科学领域中有着广泛的应用。
以下是几个主要的应用领域:1.Web应用开发:Java支持开发基于Java Servlet和JavaServer Pages(JSP)的Web应用。
计算机专业毕业设计论文外文文献中英文翻译——java对象

1 . Introduction To Objects1.1The progress of abstractionAll programming languages provide abstractions. It can be argued that the complexity of the problems you’re able to solve is directly related to the kind and quality of abstraction。
By “kind” I mean,“What is it that you are abstracting?” Assembly language is a small abstraction of the underlying machine. Many so—called “imperative” languages that followed (such as FORTRAN,BASIC, and C) were abstractions of assembly language。
These languages are big improvements over assembly language,but their primary abstraction still requires you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve。
The programmer must establish the association between the machine model (in the “solution space,” which is the place where you’re modeling that problem, such as a computer) and the model of the problem that is actually being solved (in the “problem space,” which is the place where the problem exists). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language,produces programs that are difficult to write and expensive to maintain,and as a side effect created the entire “programming methods” industry.The alter native to modeling the machine is to model the problem you’re trying to solve。
Java编程思想(Java和因特网)毕业论文外文文献翻译及原文

毕业设计(论文)外文文献翻译文献、资料中文题目:Java编程思想 (Java和因特网)文献、资料英文题目:Thingking in Java(Java and the Internet)文献、资料来源:文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期: 2017.02.14文献来源:Bruce Eckel.Thinking in Java [J]. Pearson Higher Isia Education,2006-2-20.Java编程思想 (Java和因特网)既然Java不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。
Java除了可解决传统的程序设计问题以外,还能解决World Wide Web(万维网)上的编程问题。
1、客户端编程Web最初采用的“服务器-浏览器”方案可提供交互式内容,但这种交互能力完全由服务器提供,为服务器和因特网带来了不小的负担。
服务器一般为客户浏览器产生静态网页,由后者简单地解释并显示出来。
基本HTML语言提供了简单的数据收集机制:文字输入框、复选框、单选钮、列表以及下拉列表等,另外还有一个按钮,只能由程序规定重新设置表单中的数据,以便回传给服务器。
用户提交的信息通过所有Web服务器均能支持的“通用网关接口”(CGI)回传到服务器。
包含在提交数据中的文字指示CGI该如何操作。
最常见的行动是运行位于服务器的一个程序。
那个程序一般保存在一个名为“cgi-bin”的目录中(按下Web页内的一个按钮时,请注意一下浏览器顶部的地址窗,经常都能发现“cgi-bin”的字样)。
大多数语言都可用来编制这些程序,但其中最常见的是Perl。
这是由于Perl是专为文字的处理及解释而设计的,所以能在任何服务器上安装和使用,无论采用的处理器或操作系统是什么。
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。
(完整word版)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。
计算机专业外文文献论文翻译

本科毕业设计外文文献及译文文献、资料题目:Evolving Java Without Changingthe Language文献、资料来源:/articles/evolving-java-no-lang-change 文献、资料发表(出版)日期:院(部):专业:班级:姓名:学号:指导教师:翻译日期:外文文献:Evolving Java Without Changing the Language In "The Feel of Java" James Gosling stated that: Java is a blue collar language. It's not PhD thesis material but a language for a job. Java feels very familiar to many different programmers because I had a very strong tendency to prefer things that had been used a lot over things that just sounded like a good idea.The extraordinary success of Java offers weight to the notion that this was a sensible approach, and if it remains an important goal for Java today, then it makes sense that the language should continue to evolve relatively slowly. In addition to this, the fact that Java is a mature, widely used language causes its evolution to be fraught with difficulty. For one thing, each feature added to the language can change the way it feels in subtle and often unpredictable ways, risking alienating developers who have already adopted it as their language of choice. For another, a feature that makes perfect sense on its own may interact with other features of the language in awkward or unexpected ways. Worse, once a language feature has been added it is all but impossible to remove even if it turns out to be detrimental to the language as a whole. To justify adding a new feature, a language designer must be highly confident that it will be of long term benefit to the language rather than a short term or fashionable solution to a problem that rapidly becomes redundant. To mitigate the risk a language designer will typically experiment by creating a separate language or branch, such as the Pizza language used to experiment with Java's generics, prior to their implementation. The problem with this approach is that the audience for such experiments is both small and self-selecting; obviously they will all be interested in language features, and many may be academics or researchers. An idea which plays well to such an audience may still play badly when it is incorporated into the main language and general programmers start to work with it.To get a sense of this, consider the closures debate that became so heated for Java 7. Implementations for the main proposals (and some others) have been available for some time but no consensus has emerged. In consequence Sun decided that JDK 7 will not get full closures support. The core argument came down to whether Java had become as complex as it could afford to be when generics (and in particular the wildcard syntax) were added to Java 5; andwhether the addition of full support for closures was justified when Java already has a more limited form through anonymous inner classes. Two important use cases for adding full closures support were to simplify working with the fork/join API that is being added to JDK 7 to improve multi-core programming, and to help with resource clean-up. Josh Bloch's ARM block proposal, which is now expected to be in JDK 7 via Project Coin, offers an alternative solution to the latter problem. Dr. Cliff Click's research on a scalable, non-blocking programming style for Java offers an alternative approach to fork/join that may be more appropriate as the number of processor cores increases. If this were to happen, then the uses for closures in Java may arguably be too limited to justify their inclusion.It remains important though that a programming language continues to develop at some level. This article therefore examines three alternative techniques for adding new language features to Java that don't require changes to the language itself - using a custom Domain Specific Language, exploiting the Java 6 annotation processor to add optional language features via a library, and moving the syntactic sugar from the language to the IDE. Each offers the potential to allow a wide audience of mainstream developers to experiment with the new features over the medium term in a non-invasive manner, and the best ideas can then filter down for inclusion in the core language.Custom DSLsThe most widely discussed of the three is the Domain-Specific Language or DSL. There is some disagreement on exactly what the term means, but for the purposes of this discussion we'll refer to it simply as a language that has been created with a narrow focus to solve a particular problem, rather than as a general purpose language designed to solve every computing problem. As such we would expect a DSL to be non-Turing complete and for the most part this is the case. There are edge cases of course. Postscript, for example, is a Turing complete language but also qualifies as a DSL using our definition.As the above example also illustrates, the idea of a DSL is not new. Other familiar DSLs include Regular Expressions, XSLT, Ant, and JSP, all of which require some sort of custom parser to process them. Martin Fowler also suggests that fluent interfaces/APIs can be considered a second type of DSL, which he refers to as an internal DSL. His definition is that an internal DSL is developed directly within the host language. This was a common practice amongst bothLisp and Smalltalk programmers, and more recently the Ruby community has been popularising the technique.Whilst many well-known DSLs are commercially developed and maintained, some enterprise development teams have used the technique to create a language that allows them to rapidly explore aspects of their problem domain. It isn't however as common as it might be, perhaps because DSLs have a fairly intimidating barrier to entry. The team has to design the language, build the parser and possibly other tools to support the programming team, and train each new developer that joins the team on how the DSL works. Here the emergence of tools to specifically support DSL development could significantly change the landscape. Intentional Software's Intentional Domain Workbench, which has been in development longer than Java has been around, is the first significant implementation of such a tool. The project started life at Microsoft Research, and Dr. Charles Simonyi's 1995 paper "The Death of Computer Languages, the Birth of Intentional Programming" describes his vision. In 2002 Simonyi founded Intentional Software to continue working on his ideas and a hugely impressive video demo of the system is available. The product itself is at 1.0 status, but access is restricted to very limited partners.Other software houses are also exploring the concepts, amongst them JetBrains, well respected for their IntelliJ IDEA Java IDE, who have recently released the 1.0 version of their Meta Programming System (MPS). MPS doesn't use a parser, instead working with the Abstract Syntax Tree (AST) directly. It provides a text-like projectional editor which allows the programmer to manipulate the AST, and is used to write languages and programs. For each node in the tree a textual projection is created - as the programmer works with the projection, the change is reflected in the node. This approach allows you to extend and embed languages in any combination (often referred to as language composing) promoting language re-use. JetBrains are using the product internally and have recently released YouTrack, a bug tracking product developed using the system.The Java 6 Annotation ProcessorWhilst DSLs are less common in more mainstream languages such as Java than they are in Ruby, Smalltalk and Lisp, recent developments in the Java language, in particular the annotation processor which was added in Java 6, offer new possibilities for developers looking to use them in Java. The JPA 2.0 criteria API that will ship as part of Java EE 6, itself a DSL, offers anexample. Here the annotation processor builds up a metamodel type for each persistent class in the application. Whilst it would be perfectly possible for the developer to hand craft the metamodel in Java, it would be both tedious and error prone. The use of the annotation processor eliminates that pain and, since the annotation processor is built into Java 6, the approach requires no specific IDE support – an IDE delegates to the annotation processor triggered by the compiler, and the metadata model is generated on the fly.Using the annotation processor it is also possible for a library to add a new language feature. Bruce Chapman's prototype "no closures" proposal, for example, uses the technique to provide a mechanism for casting a method to a Single Abstract Method (SAM) type which compiles on top of Java 6. During our conversation Chapman pointed out that the SAM type also supports free variables, a key aspect of a closure:The method body can declare additional parameters beyond those required for the Single **********************************************.Theseparameterscanhavevaluesbound to them at the point where you obtain an instance of the SAM type, and are then passed to the method each time it is invoked.Chapman also set up the Rapt project to explore other uses of the technique, and has added implementations for two language changes - Multiline Strings and XML literals - that were considered for JDK 7 but won't now make it into the final release. Java could even get a form of closures support using this approach. When asked about this, Chapman said: We are just finishing a Swing project which we used it for. We have found a couple of minor bugs around generic types, one recently discovered remains to be fixed but other than that it seems quite nice to use, and nobody has been wanting to rush back to use conventional anonymous inner classes.Project Lombok, another project exploring the the annotation processor, pushes the technique still further. In effect Lombok uses annotation processing as a hook to run a Java agent that re-writes various javac internals based on the annotations. Since it is manipulating internal classes it is probably not suited to production use (internal classes can change even between minor releases of the JVM) but the project is an eye-opening example of just what can be done using the annotation processor, including:•Support for properties using a pair of @Getter and/or @Setter annotations with varying access levels, e.g. @Setter(AccessLevel.PROTECTED) private String name;•The @EqualsAndHashCode annotation, which generates hashCode() and equals() implementations from the fields of your object•The @ToString annotation, which generates an implementation of the toString() method •The @data method, which is equivalent to combining @ToString, @EqualsAndHashCode, @Getter on all fields, and @Setter on all non-final fields along with a constructor to initialize your final fieldsOther language experimentation, such as removing checked exceptions from Java, can also be done using this approach.Whilst the annotation processor technique opens up a welcome new route to language experimentation, care needs to be taken that the generated code can be easily read by developers, not just by the machine. Chapman made a number of suggestions during our conversation:Generate source code not bytecode, and pay attention to formatting (indenting especially) in the generated code. The compiler won't care whether it is all on one line or not, but your users will. I even sometimes add comments and javadoc in the source code generated by my annotation processors where appropriate.Hopefully if the technique becomes more prevalent IDEs will also make it easier to view the code that is to be generated at compile time.Syntactic Sugar in the IDEBruce Chapman also touches on our third technique - moving the syntactic sugar from the language to the IDE - in his blog and he elaborated on his ideas during our conversation. It is already routine for Java IDEs to create portions of boilerplate code for you such as the getters and setters of a class, but IDE developers are beginning to push the concept further. JetBrains' IntelliJ 9 offers a terse code block syntax for inner classes similar to a closure, which a developer can also type. Acting like code folds, these can then be expanded into the full anonymous inner classes which the compiler works with - this allows developers who prefer to stick with the standard anonymous inner class syntax to do so. A similar plug-in for Eclipse also exists. The key point here is that the "alternate" syntax is just a view of the actual code which the compiler and any source management tools continue to work with. Thus the developer should be able to switchviews between either form (like expanding or collapsing a code fold), and anyone without access to the definition of the sugar just sees the normal Java code. Chapman writes:There are many details to work out in order to make this easily accessible, but long term I see developers relatively easily defining a two way sugaring/desugaring transformation (jackpot is a good start for how this might be done), trying them out, evolving them and sharing the good ones with colleagues and the community. The advantages of this are almost the same as for a language change, without the disadvantages. The very best could become ubiquitous and then form the basis of an actual language change if necessary to get rid of any remaining "noise" not possible with this approach.Since syntactic sugar has to map to another (more verbose) language feature it cannot offer complete closure support; there are some features of BGGA closures for example that cannot be mapped to anonymous inner classes, and so they couldn't be implemented through this approach. Nevertheless the idea opens up the possibility of having various new syntaxes for representing anonymous inner classes, similar to BGGA syntax or FCM syntax, and allowing developers to pick the syntax they want to work with. Other language features, such as the null-safe Elvis operator, could certainly be done this way. To experiment further with the idea this NetBeans module also developed by Chapman, is what he describes as a "barely functional" prototype for Properties using this approach.ConclusionIn language development there is always a trade-off between stability and progress. The advantage that all of these techniques bring is that they don't affect the platform or the language. In consequence they are more tolerant to mistakes and are therefore more conducive to rapid and radical experimentation. With developers freely able to experiment we should begin to see more people separately tackling the poor signal to noise ratio of some common boilerplate such as the anonymous inner class syntax, mixing and evolving these ideas to some optimum form that adds the most value in the most cases. It will be fascinating to see how developers use these different approaches to push the Java platform in new directions.中文译文:不改变语言的前提下推进Java演进James Gosling在“The Feel of Java”中说过:Java是一种蓝领语言,它并不是博士的论文材料而是可以完成工作上的语言。
Java文献(格式标准并加翻译)

附录英文原文Java Server Programming:Principles and Technologies What is server-side programming?The terms server and server-side programming are very commonly used. But what is a server? Generally speaking, a server is an application hosted on a machine that provides some services to the other applications (clients) requesting the services. As is obvious from the definition, a server typically caters to several clients, often concurrently. The services offered by a server application can be very diverse—ranging from data, and other information, management to the execution of specialized business logic. Although several types of server applications are possible, you can quickly recognize the following two kinds of servers:1. Commercial Database Servers (or Database Management Systems): Servers that manage data, which come from vendors, such as Oracle, Sybase, and Microsoft. Client applications use standard APIs, such as Open Data Base Connectivity (ODBC) or Java Data Base Connectivity (JDBC), in combination with SQL (Structured Query Language) to access/manipulate the data. In addition to these standard APIs, you may use vendor-specific client access APIs to communicate with the database server. These servers are responsible for consistently managing data such that multiple clients can manipulate the data without loss of consistency.2. Web Servers: The other easily recognizable types of servers are Web servers. A Web server hosts content, such as HTML files. Clients (Web browsers) access this content by submitting requests using Hyper Text Transfer Protocol (HTTP). In its basic mode, a Web server maps a client request to a file in the file system, and then sends the content of the file to the client making the request. Similar to database servers, Web servers can deal with concurrent requests—often several thousands. Because we are accustomed to working with these types of servers, we often tend to overlook the fact that they are server-side applications, albeit standardized. However, when I use the term server-side programming, I do not mean developing suchdatabases or Web servers. Such applications were commodified years ago. These general-purpose server-side applications provide standard, predefined functionality. In the case of server-side programming, we are more interested in developing specialpurpose applications to implement specific business-use cases.Why is it important or relevant to consider server-side applications? Why is it necessary to build applications that can provide services to several client applications?Following are some common scenarios that illustrate the need for server-side applications:1. Execute some logic available with a different application. This is one of the reasons that prompted development of early distributed technologies, such as the RPC.17 Consider that you are developing an application implementing certain new business-use cases. Suppose that there is some business logic already implemented in a different application. In cases where such functionality is available as separate/isolated class or function libraries, you might consider reusing the same code in the new application. But, what if such logic (and code) depends heavily on some data being managed by the existing application? In such a case, the class/function library cannot be reused as these class/function libraries may fail to execute without the availability of such data. Alternatively, what if such code is dependent on several other parts of the existing application, making it difficult to reuse the code in the new application? One possible solution to deal with this is by executing this logic in the existing application; that is, instead of reusing the code from the existing application, the new application can send a request (with any required data) to the existing application to execute this logic and obtain any results.2. Access information/data maintained by another application.This is yet another scenario that mandates server-side applications and clients. Database servers and other applications maintain information in a persistent storage fall under this category; however, database servers, such as relational database management systems, typically manage raw data (rows of data in various tables). Such data may or may not be directly usable (in the business sense) by other applications that rely on the data. For instance, consider a database holding various accounts of all customers in a bank. A common requirement in such systems is toconsolidate all the accounts of a given customer and present a summarized view of all accounts. Depending on that customer’s account types, the process of generating the summarized view may involve performing some complex calculations including evaluating some business rules.Now consider several applications within the bank performing other bankingtasks some of which require a summarized view of all accounts of a customer. For instance, an application responsible for calculating monthly account charges may require the value of the consolidated account balance. When there are several such applications that require this data, it is appropriate to let one of the applications handle this calculation for all other applications.3. Integrate applications.In any given enterprise, it is not uncommon to find several applications developed over years that are used for executing different business tasks. You may even find that such stand-alone applications are maintained by different departments of enterprises and developed using different programming languages and technologies. To some extent, such applications were a result of the drive to decentralize businesses from mainframe-based applications. However, as we discussed earlier, one of the requirements encountered by almost all enterprises today is the ability to internetwork such applications so that business workflows can be established across the enterprise. To elaborate further, let us take the case of a traditional retail business collecting orders for products via a call center, surface mail, etc. Let us assume that an order-entry application is used to record all orders (in a database) captured via these channels. Let us also assume that the company has developed an in-houseorder-fulfillment application, which takes the orders recorded in the database and conducts whatever tasks are need to fulfill each order. These two applications are stovepiped because each of these applications addresses specific business tasks in a decoupled manner without any knowledge of the overall business flow. In this case, the overall business flow is to receive (and enter) orders, and then to fulfill each of the orders. Such stovepiped applications cannot, individually, implement the end-to-end business flow. In order to implement this, you need to integrate the applications suchthat the order-entry application can automatically trigger the fulfillment application, directly or indirectly. This is the enterprise application integration18 problem, but there are several ways to achieve such integration. One way is to make the order-entry application invoke (or notify) the fulfillment application directly after an order has been captured. The fulfillment application can then start the fulfillment activities thereby streamlining a business flow across these applications.The HTTPHTTP Programming NeedsHTTP does not specify how to implement the logic needed to respond to HTTP request. It is up to the HTTP server to honor the request in any manner deemed satisfactory to generate response. That is, it is up to the implementation of an HTTP server to implement the logic or provide a programming model and framework such that you can plug-in programs to process HTTP requests. Consider the following possible scenarios:1. Standard HTTP servers: By default, HTTP servers provide documents, such as HTML pages, to incoming requests. This HTTP application is document-centric and is the crucial element for the World Wide Web.2. Standard HTTP Servers with Additional Programming Capabilities: A Web server may provide programming capabilities such that you can write arbitrary programs to receive HTTP requests and generate HTTP responses. We will focus on this model later in this section.3. Custom HTTP Servers: In certain cases, you may consider building custom HTTP servers for specific application requirements. For instance, you may consider this route if your application needs to process special-purpose HTTPrequests (not necessarily generated by Web browsers).All three approaches can be used in document-centric (or content-centric) applications; however, the third approach may also be used for data-/service-centric applications in which the response need not be human-readable or browser-renderable content.Of these scenarios, standard Web servers, such as Apache Web server29, iPlanetWeb Server30, or Microsoft’s Internet In formation Services (IIS)31, provide the first and second capabilities, albeit in various forms. The following list summarizes these models:1. Common Gateway Interface (CGI): This is a very popular model for generating dynamic content. The basic idea behind CGI is to invoke programs registered with a Web server. For instance, you may specify that /bar/buy should invoke a buy.pl (a Perl program). When the server receives a request with this URI, it immediately invokes this Perl program using a Perl interpreter. This program will have access to whatever information is contained in the incoming HTTP request. The information includes query parameters and the POST data. The Perl program can implement any logic (database query, updates, etc.) and output HTML content.The Web server then sends this content as HTTP response.You can use programming languages, such as Perl, C, Tcl, and even shell scripts to develop CGI applications. Almost all Web servers support CGI. Refer to vendor specific documentation for more details. CGI was one of the earliest models to address the need for generating dynamic content. Although, this technology gave way to later technologies, such as Java servlets, JSP pages, and active server pages (ASP), there are still several very popular Web sites built using this technology.2. Web Server Extensions: There are two popular Web server extensions available from iPlanet’s Netscape Server Application Programming Interface (NSAPI)32, and Microsoft’s Internet Server Application Programming Interf ace (ISAPI).33Both of these APIs let you develop applications for processing HTTP requests. Although both technologies can be used for developing custom Web applications, in the context of Java, you will find that intermediate layers developed using NSAPI and ISAPI help glue Web servers with commercial J2EE platform implementations. (Note that both ISAPI and NSAPI predate server-side Java technologies.) Common to both models is the ability to specify some means of application logic while processing an HTTP request, as shown in the Figure 13. Upon mapping a URI to a program, the Web server executes the associated program and sends the program’s output—the response—to the client. Some of the CGI technologies execute the custom programsoutside the serverprocess with an external process launched for each HTTP request. However, such an approach may not scale well as it consumes too many server resources. Other CGI technologies, such as mod_perl34, execute the custom programs within the server process. Given the previous overview of these technologies, let’s identify the requirements for a programming model for HTTP-based applications, as follows:1. Custom Programming Logic: The first requirement is the ability to plug custom application logic during the HTTP request-response process. Depending on the type and contents of a request, the Web server should be able to identify the corresponding program and invoke it. For example, consider a customer selfregistration form in a Web site. When the user submits the form (with a POST request), the Web server can invoke a program that you registered for this purpose. In this program you can open a database connection and store the data in a database.2. Dynamic Content: The second requirement is the ability to allow creation of dynamic content. Without such a facility, you will be forced to custom generate HTML content (programmatically) using the program that was used to process the data. The easiest method of content generation, in terms of usability, is to rely on templates. A template is a sort of a placeholder for static and dynamic content.While the static content is fixed for all requests, the dynamic content may depend on the nature of the request. For instance, a welcome page in an Internet e-mail site shows the name of person logged in. This name is dynamic (as are the e-mail folders, etc.) while the rest of the page, including the structure, is static.The first set of requirements stem from the need to implement custom logic and to generate content dynamically for each request. Ultimately, what the client (the browser) is interested in is a response that can be rendered by a browser. For the developer, what is required is a technology that lets him or her prepare content without having to program (the second point above addressed this need).Note: Most of the time, HTTP is used for document-centric (or content-centric) applications. This is how most of the e-commerce sites are developed today.There is, however, another reason to use HTTP as the communication protocolbetween clients and servers that is not based on content. Consider a client—not a browser—application sending some data to be processed on the server side (not necessarily in a Web server) and receiving the response from the server. In the previous section, we discussed interface-driven technologies, such as RMI, however, there are certain situations in which you may prefer HTTP to RMI. For example, you may not have access the naming service from the client side due to security restrictions. This could happen if, for instance, your servers (including the naming service) were within the secure network and external access was restricted to Web access, or if your client was developed using a different programming language and couldn’t perform naming and remo te method invocation. Under such conditions, HTTP provides a better alternative. It is programming language independent—all you need is the capability to make HTTP requests programmatically. Rather than obtaining a proxy and invoking methods on the proxy, you can send HTTP POST requests (with parameters sent as POST parameters) to a Web server. The Web server can then execute the necessary logic (refer to point 1 above), and send an HTTP response.Message QueuingMessage queuing is the simplest form of asynchronous communication between senders and recipients. In this form of communication, the intermediary maintains several message queues, one queue per sender-recipient pair. The sender puts messages into the queue, and the recipient gets messages from the queue; thus, the queue acts as a buffer for this communication. Figure 17 shows how message queuing can take place between senders and recipients.As the figure shows, the message queuing infrastructure (the message-oriented middleware) maintains the queues for each sender-recipient pair. With this approach, the sender puts messages into a queue meant for a recipient; the recipient can then retrieve the message from the queue. Figure 17 shows three queues in which senders can put messages and from which recipients fetch them. But, how does the recipient know there is a message in the queue to retrieve?There are two possible approaches, as follows:1. Polling: With this approach, the recipient keeps polling the queue to check if there is a message in the designated queue.2. Notification: With this approach, the recipient receives a callback handler with the message queuing infrastructure, and it invokes this handler when there is a message to be fetched. The queuing infrastructure can repeat its attempts ininvoking this handler until the queue receives it.Of these approaches, the second approach relieves the recipient of having to check the queue continuously. Vendors of message queuing products provide one or both of these approaches for the recipient. Message senders may use the following procedure to put messages into a queue:1. Connect to the message queuing infrastructure for a specific queue.2. Create a message.3. Send a message.Message recipients may use the following steps to receive messages from the queue:1. Connect to the message queuing infrastructure for a specific queue.2. Poll for messages or register a handler.3. Receive message.Message queuing is also called, point-to-point messaging, as a queue is specific to a sender-recipient pair. (Note that a sender may act as a recipient for another queue.) Note: We have not discussed the contents of a message. Because the infrastructure is concerned only with messages and queues, the format is up to the sender and recipient. Senders and recipients may use any format (text or binary) for describing the contents of messages.Publish and SubscribeUnlike the message queuing approach, the publish and subscribe approach is based on certain applications that publish messages and certain other applications that subscribe to certain kinds of messages based on a topic. Message queuing allows for asynchronous communication between two applications, but what is the relevance of the publish and subscribe approach?As an analogy, consider a simple stock-tracking application. Depending on the values of different stocks, the application may fire events, such as “XYZ stock fell below USD50.00.” If you’re interested in such an event, you may register with the stock-tracking application and request that it notify you whenever the “XYZ stock fell below USD50.00” event occurs. You will then be notified whenever the specific stock falls below the specified value, and you will not receive any notification as long as the stock is either below or above USD50.00. As a consumer, you specify the kinds of events (or, more generally, messages) that you are interested. This is the basic idea of the publish and subscribe approach. This approach is appropriate when there are several applications generating different kinds of messages and certain applications interested in specific types of messages. For instance, in an enterprise, you may find several applications performing different business processes.Each of the processes operates on business data, and change the state of business data. Depending on the specific state of a business data (i.e., the value of a balance), you may have to initiate one or more business processes. In this case, the application processing the data may post a message stating that a certain state has occurred or that a certain event happened. There may other applications posting similar events. Now, consider a messaging infrastructure that allows applications to be registered for notification on specific message topics. Whenever matching messages are posted, the infrastructure notifies the applications that are registered against specific topics. This figure shows three publishers, three subscribers, and three topics. Each ofthese publisher applications publishes messages against a topic. The arrows on the left show this process. On the right, there are three message subscribers interested in different kinds of topics. The first subscriber is interested in topics 1 and 3, while the third subscriber is interested in topics 2 and 3. These subscribers would receive only messages published against the respective topics.Note: A publisher may publish messages against several topics and, similarly, a subscriber may subscribe for messages against several topics. The publish and subscribe approach differs from message queuing approach in the following ways: 1. While message queuing is based on queues between two applications (sender andrecipient), publish and subscribe is based on topics for messages.2. The sender (publisher) publishes messages against topics and not into queues.3. The recipient (subscriber) receives messages based on topics, irrespective of the publisher’s identity.4. The publisher and subscriber are coupled via messages and not queues. In this approach, message publishers may use the following procedure to put messages into a queue:1. Connect to the messaging infrastructure for a specific topic.2. Create a message.3. Publish a message.Message subscribers may use the following steps to receive messages from the queue:1. Connect to the message queuing infrastructure for a specific topic.2. Poll for messages or register a handler.3. Receive message for the specific topic.J2EE for Server-Side ProgrammingUp to this point in this article, we have discussed various principles behind server-side computing. During the discussion, though I have made references to some of the server-side Java technologies, I have intentionally left out details of how these principles map to various server-side technologies with Java. From this section forward, we will discuss specific Java server-side technologies within J2EE.The J2EE is an integrated platform combining various server-side programming models previously discussed in this article. Sun Microsystems introduced J2EE in late 199954, though some J2EE APIs, such as servlets, Java Naming and Directory Interface (JNDI), etc., were introduced before; Sun Microsystems integrated all such technologies with a coherent and integrated architecture for server-side programming with J2EE. Today, J2EE is the de facto standard for building server-side and Internet applications using Java and is endorsed by several vendors offering J2EE-compatible application servers.J2EE is essentially a specification that stipulates how the various J2EE technologieswork together. Each of these technologies is discussed in various specifications released by Sun Microsystems. Sun maintains a reference implementation of J2EE. Nonetheless, J2EE is still a specification with several commercial and open-source implementations. Although such implementations are typically referred to as J2EE application servers, we will instead use the term J2EE platform to indicate an implementation of the J2EE technologies. J2EE includes the following technologies: Enterprise JavaBeans (EJBs): Used for developing distributed components.Java servlets and Java Server Pages (JSP Pages): Used to build Web-based applicationsLet us now discuss how J2EE provides for each of these needs.Before we go into the details on how these programming models are supported, we will look at some of the most commonly used J2EE terminology, as follows:1. Container: We use the term container to denote a runtime that supports application programs. There are two types of containers for developing server-side applications using J2EE.EJB Containers: EJB containers are capable of hosting server-sideobjects that are developed for the synchronous request-responsemodel. In the upcoming enhancement via J2EE1.3 and EJB2.0, EJBcontainers are also capable of hosting server-side objects that canbe activated asynchronously via messages.Web Containers: Web containers are capable of hosting objectsdeveloped for the stateless request-response model withcommunication over HTTP. The Web container maintains instancesof Java servlets and JSP pages2. Application Components: The J2EE specification uses the term application components to denote container-managed objects, such as EJBs, Java servlets, and JSP pages. These are managed, as the container (i.e., the runtime) maintains the lifecycle of these instances. (Developers do not explicitly create these instances.) The containers also manage such things as transactions and security as we will see later in this article.3. Modules: Apart from the notion of application components, J2EE employs the notion of modules. A module consists of one or more of a given type application components. For instance, an EJB module consists of one or more EJB components and, similarly, a Web module consists of one or more servlets and JSP pages (along with static content, such as HTML files, images, etc.). The primary purpose of a module is to allow flexible packaging structure. In J2EE, modules are packaged into Web archive (WAR) or Java archive (JAR) files.4. J2EE Applications: A J2EE application is a combination of or more modules. J2EE applications can be packaged into enterprise archive (EAR) files. Apart from serving as a means for high-level application module packaging, a J2EEapplication can also define virtual boundaries between various applications deployed on a given container.5. Deployment: This is another word you will encounter frequently in the J2EE world. While a strict definition of deployment is outside the scope of this article, in simple terms, deployment is the process of adding your applications to a J2EE platform. This could mean simply copying the classes (suitably packaged as applications) into a directory accessible by a J2EE platform implementation, or it could mean using vendor-specific deployment tools to add applications to a J2EE platform. Once deployed, J2EE application components are available forinvocation by J2EE containers based on clients’ requests (i.e., requests from Web browsers or other clients) or even other J2EE application components.6. Deployment Descriptor: In simple terms, a deployment descriptor is a configuration file expressed using XML. Along with application components, each module consists of a deployment descriptor. Depending on the type of application component, the deployment descriptor consists of specific configuration information. Deployment descriptors help containers to not only decipher the contents of modules, but also to let containers manage the lifecycle of various application components, transactions, and even security.中文译文Java服务器程序设计:原理和技术什么是服务器端的编程?术语服务器和服务器端编程是非常普遍的。
JAVA学习过程论文中英文资料对照外文翻译文献

JAVA学习过程论文中英文资料对照外文翻译文献During my process of learning Java。
I have found that everyone has their own unique study method。
What works for one person may not work for another。
As I am studying Java independently。
I have not asked ___。
I have had to rely on my own ___ out。
While I cannot say whether this is the best method。
I can offer it as a reference for others.When I first started learning Java。
___ understanding of the language。
As I progressed。
I began to work on small projects to apply what I had learned.One of the biggest challenges I faced was understanding object-oriented programming。
___。
once I understood the basics。
everything else started to fall into place.___ practicing programming。
I also made sure to take breaks and give my brain time to rest。
I found that this helped me to ___.Overall。
my learning process has been a n of n。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
THE TECHNIQUE DEVELOPMENT HISTORY OF JSPBy:Kathy Sierra and Bert BatesSource: Servlet&JSPThe Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can carry out the JSP on own system.The After Sun release the JS P( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product.This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP.1.1 GENER ALIZEThe JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it.JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or theother. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.JSP provides the following benefits over servlets alone:• It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.• You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.• You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the apGFDGpropriate tool for the job, and servlets, by themselves, do not complete your toolkit.1.2 SOURCE OF JSPThe technique of JSP of the company of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to design to turn the end page with format. Use the perhaps small script future life of marking of JSP becomes the dynamic state on the page contents.( the contents changes according to the claim of)The Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can complete, this name of Servlet comes from the Applet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but don't do any translation, if reader would like to, can call it as" small service procedure". The Servlet is similar to traditional CGI, ISAPI, NSAPI etc. Web procedure development the function of the tool in fact, at use the Java Servlet hereafter, the customer need not use again the lowly method of CGI of efficiency, also need not use only the ability come to born page of Web of dynamic state in the method of API that a certain fixed Web server terrace circulate. Many servers of Web all support the Servlet, even not support the Servlet server of Web directly and can also pass the additional applied server and the mold pieces to support theServlet. Receive benefit in the characteristic of the Java cross-platform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is complete to have nothing to do with terrace and is to have nothing to do with server of Web. Because the Java Servlet is internal to provide the service by the line distance, need not start a progress to the each claimses, and make use of the multi-threading mechanism can at the same time for several claim service, therefore the efficiency of Java Servlet is very high.But the Java Servlet also is not to has no weakness, similar to traditional CGI, ISAPI, the NSAPI method, the Java Servlet is to make use of to output the HTML language sentence to carry out the dynamic state web page of, if develop the whole website with the Java Servlet, the integration process of the dynamic state part and the static state page is an evil-foreboding dream simply. For solving this kind of weakness of the Java Servlet, the SUN released the JSP.A number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was ahigh-level manager from a very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, Cold Fusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did.The JSP is an establishment at the model of Java servlets on of the expression layer technique, it makes the plait write the HTML to become more simple.Be like the SSJS, it also allows you carry the static state HTML contents and servers the script mix to put together theborn dynamic state exportation. JSP the script language that the Java is the tacit approval, however, be like the ASP and can use other languages( such as JavaScript and VBScript), the norm of JSP also allows to use other languages.1.3JSP CHARACTERISTICSIs a service according to the script language in some one language of the statures system this kind of discuss, the JSP should be see make is a kind of script language. However, be a kind of script language, the JSP seemed to be too strong again, almost can use all Javas in the JSP.Be a kind of according to text originally of, take manifestation as the central development technique, the JSP provided all advantages of the Java Servlet, and, when combine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate. Separate the contents and advantage of logical manifestations is, the personnel who renews the page external appearance need not know the code of Java, and renew the JavaBeans personnel also need not be design the web page of expert in hand, can use to take the page of JavaBeans JSP to define the template of Web, to build up a from have the alike external appearance of the website that page constitute. JavaBeans completes the data to provide, having no code of Java in the template thus, this means that these templates can be written the personnel by a HTML plait to support. Certainly, can also make use of the Java Servlet to control the logic of the website, adjust through the Java Servlet to use the way of the document of JSP to separate website of logic and contents.Generally speaking, in actual engine of JSP, the page of JSP is the edit and translate type while carry out, not explain the type of. Explain the dynamic state web page development tool of the type, such as ASP, PHP3 etc., because speed etc. reason, have already can't satisfy current the large electronic commerce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+;PHP3 → PHP4.In the JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and must write with the Java definitely. Actually, have some engines of JSP are adoptive other script languages such as the EMAC- Script, etc., but actually this a few script languages also are to set up on the Java, edit and translate for the Servlet to carry out of. Write according to the norm of JSP, have no Scriptlet of relation with Java also is can of, however, mainly lie in the ability and JavaBeans, the Enterprise JavaBeanses because of the JSP strongfunction to work together, so even is the Scriptlet part not to use the Java, edit and translate of performance code also should is related with Java.1.4JSP MECHANISMTo comprehend the JSP how unite the technical advantage that above various speak of, come to carry out various result easily, the customer must understand the differentiation of" the module develops for the web page of the center" and" the page develops for the web page of the center" first.The SSJS and ASP are all in several year ago to release, the network of that time is still very young, no one knows to still have in addition to making all business, datas and the expression logic enter the original web page entirely heap what better solve the method. This kind of model that take page as the center studies and gets the very fast development easily. However, along with change of time, the people know that this kind of method is unwell in set up large, the Web that can upgrade applies the procedure. The expression logic write in the script environment was lock in the page, only passing to shear to slice and glue to stick then can drive heavy use. Express the logic to usually mix together with business and the data logics, when this makes be the procedure member to try to change an external appearance that applies the procedure but do not want to break with its llied business logic, apply the procedure of maintenance be like to walk the similar difficulty on the eggshell. In fact in the business enterprise, heavy use the application of the module already through very mature, no one would like to rewrite those logics for their applied procedure.HTML and sketch the designer handed over to the implement work of their design the Web plait the one who write, make they have to double work- Usually is the handicraft plait to write, because have no fit tool and can carry the script and the HTML contents knot to the server to put together. Chien but speech, apply the complexity of the procedure along with the Web to promote continuously, the development method that take page as the center limits sex to become to get up obviously.At the same time, the people always at look for the better method of build up the Web application procedure, the module spreads in customer's machine/ server the realm. JavaBeans and ActiveX were published the company to expand to apply the procedure developer for Java and Windows to use to come to develop the complicated procedure quickly by" the fast application procedure development"( RAD) tool. These techniques make the expert in the some realm be able to write the module for theperpendicular application plait in the skill area, but the developer can go fetch the usage directly but need not control the expertise of this realm.Be a kind of take module as the central development terrace, the JSP appeared. It with the JavaBeans and Enterprise JavaBeans( EJB) module includes the model of the business and the data logic for foundation, provide a great deal of label and a script terraces to use to come to show in the HTML page from the contents of JavaBeans creation or send a present in return. Because of the property that regards the module as the center of the JSP, it can drive Java and not the developer of Java uses equally. Not the developer of Java can pass the JSP label( Tags) to use the JavaBeans that the deluxe developer of Java establish. The developer of Java not only can establish and use the JavaBeans, but also can use the language of Java to come to control more accurately in the JSP page according to the expression logic of the first floor JavaBeans.See now how JSP is handle claim of HTTP. In basic claim model, a claim directly was send to JSP page in. The code of JSP controls to carry on hour of the logic processing and module of JavaBeanses' hand over with each other, and the manifestation result in dynamic state bornly, mixing with the HTML page of the static state HTML code. The Beans can be JavaBeans or module of EJBs. Moreover, the more complicated claim model can see make from is request other JSP pages of the page call sign or Java Servlets.The engine of JSP wants to chase the code of Java that the label of JSP, code of Java in the JSP page even all converts into the big piece together with the static state HTML contents actually. These codes piece was organized the Java Servlet that customer can not see to go to by the engine of JSP, then the Servlet edits and translate them automatically byte code of Java.Thus, the visitant that is the website requests a JSP page, under the condition of it is not knowing, an already born, the Servlet actual full general that prepared to edit and translate completes all works, very concealment but again and efficiently. The Servlet is to edit and translate of, so the code of JSP in the web page does not need when the every time requests that page is explain. The engine of JSP need to be edit and translate after Servlet the code end is modify only once, then this Servlet that editted and translate can be carry out. The in view of the fact JSP engine auto is born to edit and translate the Servlet also, need not procedure member begins to edit and translate the code, so the JSP can bring vivid sex that function and fast developments need that you are efficiently.Compared with the traditional CGI, the JSP has the equal advantage. First, on the speed, the traditional procedure of CGI needs to use the standard importation of the system to outputthe equipments to carry out the dynamic state web page born, but the JSP is direct is mutually the connection with server. And say for the CGI, each interview needs to add to add a progress to handle, the progress build up and destroy by burning constantly and will be a not small burden for calculator of be the server of Web. The next in order, the JSP is specialized to develop but design for the Web of, its purpose is for building up according to the Web applied procedure, included the norm and the tool of a the whole set. Use the technique of JSP can combine a lot of JSP pages to become a Web application procedure very expediently.JSP的技术发展历史作者: Kathy Sierra and Bert Bates来源: Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。