15000字的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外文资料翻译
本文由hunter_yiyi贡献
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外文文献+翻译

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不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。

Java中英翻译

Java中英翻译

abstract (关键字) 抽象['.bstr.kt]access vt.访问,存取['.kses]'(n.入口,使用权)algorithm n.算法['.lg.riem]Annotation [java]代码注释[.n.u'tei..n]anonymous adj.匿名的[.'n.nim.s]'(反义:directly adv.直接地,立即[di'rektli, dai'rektli])apply v.应用,适用[.'plai]application n.应用,应用程序[,.pli'kei..n]' (application crash 程序崩溃) arbitrary a.任意的['ɑ:bitr.ri]argument n.参数;争论,论据['ɑ:gjum.nt]'(缩写args)assert (关键字) 断言[.'s.:t] ' (java 1.4 之后成为关键字)associate n.关联(同伴,伙伴) [.'s.u.ieit]attribute n.属性(品质,特征) [.'tribju:t]boolean (关键字) 逻辑的, 布尔型call n.v.调用; 呼叫; [k.:l]circumstance n.事件(环境,状况) ['s.:k.mst.ns]crash n.崩溃,破碎[kr..]cohesion内聚,黏聚,结合[k.u'hi:..n](a class is designed with a single, well-focoused purpose. 应该不止这点) command n. 命令,指令[k.'mɑ:nd](指挥, 控制) (command-line 命令行)Comments [java]文本注释['k.ments]compile [java] v.编译[k.m'pail]' Compilation n.编辑[,k.mpi'lei..n] const (保留字)constant n. 常量, 常数, 恒量['k.nst.nt]continue (关键字)coupling耦合,联结['k.pli.]making sure that classes know about other classes only through their APIs. declare [java]声明[di'kl..]default (关键字) 默认值; 缺省值[di'f.:lt]delimiter定义符; 定界符Encapsulation[java]封装(hiding implementation details)Exception [java]例外; 异常[ik'sep..n]entry n.登录项, 输入项, 条目['entri]enum (关键字)execute vt.执行['eksikju:t]exhibit v.显示, 陈列[ig'zibit]exist存在, 发生[ig'zist] '(SQL关键字exists)extends (关键字) 继承、扩展[ik'stend]false (关键字)final (关键字) finally (关键字)fragments段落; 代码块['fr.gm.nt]FrameWork [java]结构,框架['freimw.:k]Generic [java]泛型[d.i'nerik]goto (保留字) 跳转heap n.堆[hi:p]implements (关键字) 实现['implim.nt]import (关键字) 引入(进口,输入)Info n.信息(information [,inf.'mei..n] )Inheritance [java]继承[in'herit.ns] (遗传,遗产)initialize预置初始化[i'iz]instanceof (关键字) 运算符,用于引用变量,以检查这个对象是否是某种类型。

计算机系 Java EE 外文翻译 外文文献 英文文献

计算机系 Java EE 外文翻译 外文文献 英文文献

外文科技资料翻译英文原文The Java EE Platform is the leading enterprise web server. The Adobe Flash Platform is the leader in the rich Internet application space. Using both, developers can deliver compelling, data-centric applications that leverage the benefits of an enterprise back-end solution and a great user experience.In this article, you learn about the architecture of applications built using Flex and Java including:(1)An overview of the client/server architecture.(2)The different ways the client and server can communicate.(3)An introduction to Flash Remoting and why and how you use it.(4)How to integrate a Flex application with your security framework.(5)An overview of how to build Flex applications using events, states,MXML components, and modules.(6)An introduction to developing a Flex application with real-time serverdata push.(7)How to boost productivity developing data-intensive applicationsusing the Data Management service in LiveCycle Data Services.(8)An overview of model driven development using Flash Builder andLiveCycle Data Services to generate client and server-side code.(9)How to deploy a Flex application on a portal server.(10)Be sure to also watch the video Introduction to Flex 4 and Javaintegration.(11)To learn more about the technologies used to build these applications,read The technologies for building Flex and Java applications article.Client/server architectureFlex and Java applications use a multi-tier architecture where the presentation tier is the Flex application, the business or application tier is the Java EE server and code, and the data tier is the database. You can write the back-end code just as you normally would for a Java application, modeling your objects, defining your database, using an object-relational framework such as Hibernate or EJB 3, and writing the business logic to query and manipulate these objects. The business tier must be exposed for access via HTTP from the Flex application and will be used to move the data between the presentation and data tiers.Typical HTML applications consist of multiple pages and as a user navigates between them, the application data must be passed along so the application itself (the collection of pages and functionality it consists of) can maintain state. In contrast, Flex applications, by nature, are stateful. A Flex application is embedded in a single HTML page that the user does not leave and is rendered by Flash Player. The Flex application can dynamically change views and send and retrieve data asynchronously to the server in the background, updating but never leaving the single application interface (see Figure 1) (similar to the functionality provided by the XMLHttpRequest API with JavaScript.)Figure 1. The client/server architecture.Client/server communicationFlex applications can communicate with back-end servers using either direct socket connections or more commonly, through HTTP. The Flex framework has three remote procedure call APIs that communicate with a server over HTTP: HTTPService, WebService, and RemoteObject. All three wrap Flash Player'sHTTP connectivity, which in turn, uses the browser's HTTP library. Flex applications cannot connect directly to a remote database.You use HTTPService to make HTTP requests to JSP or XML files, to RESTful web services, or to other server files that return text over HTTP. You specify the endpoint URL, listener functions (the callback functions to be invoked when the HTTPService request returns a successful or unsuccessful response), and a data type for the returned data (what type of data structure it should be translated into once received in the Flex application). You can specify the data to be handled as raw text and assigned to a String variable or converted to XML, E4X, or plain old ActionScript objects. If you get back JSON, you can use the Adobe Flex corelib package of classes to deserialize the JSON objects into ActionScript objects. To make calls to SOAP based web services, you can use the HTTPService API or the more specialized WebService API, which automatically handles the serialization and deserialization of SOAP formatted text to ActionScript data types and vice versa.The third option for making remote procedure calls is to use the RemoteObject API. It makes a Flash Remoting request to a method of a server-side Java class that returns binary Action Message Format over HTTP. When possible, use Flash Remoting whose binary data transfer format enables applications to load data up to 10 times faster than with the more verbose, text-based formats such as XML, JSON, or SOAP (see Figure 2). To see a comparison of AMF to other text-based serialization technologies, see James Ward's Census RIA Benchmark application.Figure 2. Methods for connecting Flex and Java.Flash RemotingFlash Remoting is a combination of client and server-side functionality that together provides a call-and-response model for accessing server-side objects from Flash Platform applications as if they were local objects. It provides transparent data transfer between ActionScript and server-side data types, handling the serialization into Action Message Format (AMF), deserialization, and data marshaling between the client and the server.Flash Remoting uses client-side functionality built in to Flash Player and server-side functionality that is built in to some servers (like ColdFusion and Zend) but must be installed on other servers (as BlazeDS or LiveCycle Data Services on Java EE servers, WebORB or FluorineFX on .NET servers, the Zend framework or amfphp on PHP servers, and more). See the technologies for building Flex and Java applications article for more details about BlazeDS and LiveCycle Data Services.BlazeDS and LiveCycle Data Services use a message-based framework to send data back and forth between the client and server. They provide Remoting, Proxying, and Messaging services, and for LiveCycle, an additional Data Management service. The Flex application sends a request to the server and the request is routed to an endpoint on the server. From the endpoint, the request is passed to the MessageBroker, the BlazeDS and LiveCycle Data Services engine that handles all the requests and routes them through a chain of Java objects to the destination, the Java class with the method to invoke (see Figure 3).Figure 3. Flash Remoting architecture.AMFAMF is a binary format used to serialize ActionScript objects and facilitate data exchange between Flash Platform applications and remote services over the Internet. Adobe publishes this protocol; the latest is AMF 3 Specification for ActionScript 3. You can find tables listing the data type mappings when converting from ActionScript to Java and Java to ActionScript here.For custom or strongly typed objects, public properties (including those defined with get and set methods) are serialized and sent from the Flex application to the server or from the server to the Flex application as properties of a general 0bject. To enable mapping between the corresponding client and server-side objects, you use the same property names in the Java and ActionScript classes and then in the ActionScript class, you use the [RemoteClass] metadata tag to create an ActionScript object that maps directly to the Java object.Here is an example Employee ActionScript class that maps to a server-side Employee Java DTO located in the services package on the server.package valueobjects.Employee{ [Bindable] [RemoteClass(alias="services.Employee")] public class Employee { public var id:int; public var firstName:String; public var lastName:String; (...) } }Installing BlazeDS or LiveCycle Data ServicesTo use Flash Remoting with BlazeDS or LiveCycle Data Services, you need to install and configure the necessary server-side files. For BlazeDS, you can download it as a WAR file which you deploy as a web application or as a turnkey solution. The turnkey download contains a ready-to-use version of Tomcat in which the the BlazeDS WAR file has already been deployed and configured along with a variety of sample applications. Similarly, for LiveCycle Data Services, the installer lets you choose to install LiveCycle with an integrated Tomcat server or as a LiveCycle Data Services web application.In either scenario a web application called blazeds or lcds (usually appended by a version number) is created. You can modify and build out this application with your Java code, or more typically, you can copy the JAR files and configuration files the blazeds or lcds web application contains and add them to an existing Java web application on the server (see Figure 4).Figure 4. The required BlazeDS or LiveCycle Data Services files.Modifying web.xmlIf copying the files to a different web application, you also need to modify the web.xml file to define a session listener for HttpFlexSession and a servlet mapping for MessageBroker, which handles all the requests and passes them off to the correct server-side Java endpoints. You can copy and paste these from the original blazeds or lcds web application web.xml file.<!-- Http Flex Session attribute and binding listener support --> <listener> <listener-class>flex.messaging.HttpFlexSession</listener-class> </listener> <!-- MessageBroker Servlet --> <servlet><servlet-name>MessageBrokerServlet</servlet-name><display-name>MessageBrokerServlet</display-name><servlet-class>flex.messaging.MessageBrokerServlet</servlet-class><init-param> <param-name>services.configuration.file</param-name><param-value>/WEB-INF/flex/services-config.xml</param-value></init-param> <load-on-startup>1</load-on-startup> </servlet><servlet-mapping> <servlet-name>MessageBrokerServlet</servlet-name><url-pattern>/messagebroker/*</url-pattern> </servlet-mapping>Optionally, you may also want to copy and paste (and uncomment) the mapping for RDSDispatchServlet, which is used for RDS (Remote Data Service) access with the data service creation feature in Flash Builder 4 that introspects a server-side service and generates corresponding client-side code. See the model driven development section for more details.<servlet> <servlet-name>RDSDispatchServlet</servlet-name><display-name>RDSDispatchServlet</display-name><servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class><init-param> <param-name>useAppserverSecurity</param-name><param-value>false</param-value> </init-param><load-on-startup>10</load-on-startup> </servlet> <servlet-mappingid="RDS_DISPATCH_MAPPING"><servlet-name>RDSDispatchServlet</servlet-name><url-pattern>/CFIDE/main/ide.cfm</url-pattern> </servlet-mapping> Reviewing services-config.xmlFor Flash Remoting, the client sends a request to the server to be processed and the server returns a response to the client containing the results. You configure these requests by modifying the services-config.xml and remoting-config.xml files located in the /WEB-INF/flex/ folder for the web application.The services-config.xml file defines different channels that can be used when making a request. Each channel definition specifies the network protocol and the message format to be used for a request and the endpoint to deliver the messages to on the server. The Java-based endpoints unmarshal the messages in a protocol-specific manner and then pass the messages in Java form to the MessageBroker which sends them to the appropriate service destination (you'll see how to define these next).<channels> <channel-definition id="my-amf"class="mx.messaging.channels.AMFChannel"> <endpointurl="http://{}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition><channel-definition id="my-secure-amf"class="mx.messaging.channels.SecureAMFChannel"> <endpointurl="https://{}:{server.port}/{context.root}/messagebroker/amfsecu re" class="flex.messaging.endpoints.SecureAMFEndpoint"/></channel-definition> (...) </channels>Defining destinationsIn the remoting-config.xml file, you define the destinations (named mappings to Java classes) to which the MessageBroker passes the messages. You set the source property to the fully qualified class name of a Java POJO with a no argument constructor that is located in a source path, usually achieved by placing it in the web application's /WEBINF/classes/ directory or in a JAR file in the /WEBINF/lib/ directory. You can access EJBs and other objects stored in the Java Naming and Directory Interface (JNDI) by calling methods on a destination that is a service facade class that looks up an object in JNDI and calls its methods.You can access stateless or stateful Java objects by setting the scope property to application, session, or request (the default). The instantiation and management of the server-side objects referenced is handled by BlazeDS or LiveCycle Data Services.<service id="remoting-service"class="flex.messaging.services.RemotingService"> <adapters><adapter-definition id="java-object"class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> </adapters> <default-channels> <channel ref="my-amf"/> </default-channels> <destination id="employeeService"> <properties><source>services.EmployeeService</source> <scope>application</scope></properties> </destination> </service>You can also specify channels for individual destinations.<destination id="employeeService " channels="my-secure-amf">Lastly, you use these destinations when defining RemoteObject instances in a Flex application.<s:RemoteObject id="employeeSvc" destination="employeeService"/>SecurityIn many applications, access to some or all server-side resources must be restricted to certain users. Many Java EE applications use container managed security in which user authentication (validating a user) and user authorization (determining what the user has access to—which is often role based) are performed against the Realm, an existing store of usernames, passwords, and user roles. The Realm is configured on your Java EE server to be a relational database, an LDAP directory server, an XML document, or to use a specific authentication and authorization framework.To integrate a Flex application with the Java EE security framework so that access to server-side resources is appropriately restricted, you add security information to the BlazeDS or LiveCycle Data Services configuration files (details follow below) and then typically in the Flex application, create a form to obtain login credentials from the user which are passed to the server to be authenticated. The user credentials are then passed to the server automatically with all subsequent requests.Modifying services-config.xmlIn the BlazeDS or LiveCycle Data Services services-config.xml file, you need to specify the "login command" for your application server in the <security> tag. BlazeDS and LiveCycle Data Services supply the following login commands: TomcatLoginCommand (for both Tomcat and JBoss), JRunLoginCommand, WeblogicLoginCommand, WebSphereLoginCommand, OracleLoginCommand. These are all defined in the XML file and you just need to uncomment the appropriate one.You also need to define a security constraint that you specify to use either basic or custom authentication and if desired, one or more roles. To do custom authentication with Tomat or JBoss, you also need to add some extra classes tothe web application for integrating with the security framework used by the Jave EE application server and modify a couple of configuration files. Mode details can be found here.<services-config> <security> <login-commandclass="flex.messaging.security.TomcatLoginCommand" server="Tomcat"><per-client-authentication>false</per-client-authentication></login-command> <security-constraint id="trusted"><auth-method>Custom</auth-method> <roles> <role>employees</role><role>managers</role> </roles> </security-constraint> </security> ...</services-config>Modifying remoting-config.xmlNext, in your destination definition, you need to reference the security constraint:<destination id="employeeService"> <properties><source>services.EmployeeService</source> </properties> <security><security-constraint ref="trusted"/> </security> </destination>You can also define default security constraints for all destinations and/or restrict access to only specific methods that can use different security constraints.The default channel, my-amf, uses HTTP. You can change one or more of the destinations to use the my-secure-amf channel that uses HTTPS:<destination id="employeeService"> <channels> <channelref="my-secure-amf"/> </channels> ... </destination>where my-secure-amf is defined in the services-config.xml file:<!-- Non-polling secure AMF --> <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> <endpointurl="https://{}:{server.port}/{context.root}/messagebroker/amfsecu re" class="flex.messaging.endpoints.SecureAMFEndpoint"/></channel-definition>Adding code to the Flex applicationThat covers the server-side setup. Now, if you are using custom authentication, you need to create a form in the Flex application to retrieve a username and password from the user and then pass these credentials to the server by calling the ChannelSet.login() method and then listening for its result and fault events. A result event indicates that the login (the authentication) occurred successfully, and a fault event indicates the login failed. The credentials are applied to all services connected over the same ChannelSet. For basic authentication, you don’t have to add anything to your Flex application. The browser opens a login dialog box when the application first attempts to connect to a destination.Your application can now make Flash Remoting requests to server destinations just as before, but now the user credentials are automatically sent with every request (for both custom and basic authentication). If the destination or methods of the destination have authorization roles specified which are not met by the logged in user, the call will return a fault event. To remove the credentials and log out the user, you use the ChannelSet.logout() method.中文译文Java EE平台是全球领先的企业Web服务器。

计算机java外文翻译外文文献英文文献

计算机java外文翻译外文文献英文文献

英文原文:Title: Business Applications of Java. Author: Erbschloe, Michael, Business Applications of Java -- Research Starters Business, 2008DataBase: Research Starters - BusinessBusiness Applications of JavaThis article examines the growing use of Java technology in business applications. The history of Java is briefly reviewed along with the impact of open standards on the growth of the World Wide Web. Key components and concepts of the Java programming language are explained including the Java Virtual Machine. Examples of how Java is being used bye-commerce leaders is provided along with an explanation of how Java is used to develop data warehousing, data mining, and industrial automation applications. The concept of metadata modeling and the use of Extendable Markup Language (XML) are also explained.Keywords Application Programming Interfaces (API's); Enterprise JavaBeans (EJB); Extendable Markup Language (XML); HyperText Markup Language (HTML); HyperText Transfer Protocol (HTTP); Java Authentication and Authorization Service (JAAS); Java Cryptography Architecture (JCA); Java Cryptography Extension (JCE); Java Programming Language; Java Virtual Machine (JVM); Java2 Platform, Enterprise Edition (J2EE); Metadata Business Information Systems > Business Applications of JavaOverviewOpen standards have driven the e-business revolution. Networking protocol standards, such as Transmission Control Protocol/Internet Protocol (TCP/IP), HyperText Transfer Protocol (HTTP), and the HyperText Markup Language (HTML) Web standards have enabled universal communication via the Internet and the World Wide Web. As e-business continues to develop, various computing technologies help to drive its evolution.The Java programming language and platform have emerged as major technologies for performing e-business functions. Java programming standards have enabled portability of applications and the reuse of application components across computing platforms. Sun Microsystems' Java Community Process continues to be a strong base for the growth of the Java infrastructure and language standards. This growth of open standards creates new opportunities for designers and developers of applications and services (Smith, 2001).Creation of Java TechnologyJava technology was created as a computer programming tool in a small, secret effort called "the Green Project" at Sun Microsystems in 1991. The Green Team, fully staffed at 13 people and led by James Gosling, locked themselves away in an anonymous office on Sand Hill Road in Menlo Park, cut off from all regular communications with Sun, and worked around the clock for18 months. Their initial conclusion was that at least one significant trend would be the convergence of digitally controlled consumer devices and computers. A device-independent programming language code-named "Oak" was the result.To demonstrate how this new language could power the future of digital devices, the Green Team developed an interactive, handheld home-entertainment device controller targeted at the digital cable television industry. But the idea was too far ahead of its time, and the digital cable television industry wasn't ready for the leap forward that Java technology offered them. As it turns out, the Internet was ready for Java technology, and just in time for its initial public introduction in 1995, the team was able to announce that the Netscape Navigator Internet browser would incorporate Java technology ("Learn about Java," 2007).Applications of JavaJava uses many familiar programming concepts and constructs and allows portability by providing a common interface through an external Java Virtual Machine (JVM). A virtual machine is a self-contained operating environment, created by a software layer that behaves as if it were a separate computer. Benefits of creating virtual machines include better exploitation of powerful computing resources and isolation of applications to prevent cross-corruption and improve security (Matlis, 2006).The JVM allows computing devices with limited processors or memory to handle more advanced applications by calling up software instructions inside the JVM to perform most of the work. This also reduces the size and complexity of Java applications because many of the core functions and processing instructions were built into the JVM. As a result, software developersno longer need to re-create the same application for every operating system. Java also provides security by instructing the application to interact with the virtual machine, which served as a barrier between applications and the core system, effectively protecting systems from malicious code.Among other things, Java is tailor-made for the growing Internet because it makes it easy to develop new, dynamic applications that could make the most of the Internet's power and capabilities. Java is now an open standard, meaning that no single entity controls its development and the tools for writing programs in the language are available to everyone. The power of open standards like Java is the ability to break down barriers and speed up progress.Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards. There are over 3 million Java developers and now there are several versions of the code. Most large corporations have in-house Java developers. In addition, the majority of key software vendors use Java in their commercial applications (Lazaridis, 2003).ApplicationsJava on the World Wide WebJava has found a place on some of the most popular websites in the world and the uses of Java continues to grow. Java applications not only provide unique user interfaces, they also help to power the backend of websites. Two e-commerce giants that everybody is probably familiar with (eBay and Amazon) have been Java pioneers on the World Wide Web.eBayFounded in 1995, eBay enables e-commerce on a local, national and international basis with an array of Web sites-including the eBay marketplaces, PayPal, Skype, and -that bring together millions of buyers and sellers every day. You can find it on eBay, even if you didn't know it existed. On a typical day, more than 100 million items are listed on eBay in tens of thousands of categories. Recent listings have included a tunnel boring machine from the Chunnel project, a cup of water that once belonged to Elvis, and the Volkswagen that Pope Benedict XVI owned before he moved up to the Popemobile. More than one hundred million items are available at any given time, from the massive to the miniature, the magical to the mundane, on eBay; the world's largest online marketplace.eBay uses Java almost everywhere. To address some security issues, eBay chose Sun Microsystems' Java System Identity Manager as the platform for revamping its identity management system. The task at hand was to provide identity management for more than 12,000 eBay employees and contractors.Now more than a thousand eBay software developers work daily with Java applications. Java's inherent portability allows eBay to move to new hardware to take advantage of new technology, packaging, or pricing, without having to rewrite Java code ("eBay drives explosive growth," 2007).Amazon (a large seller of books, CDs, and other products) has created a Web Service application that enables users to browse their product catalog and place orders. uses a Java application that searches the Amazon catalog for books whose subject matches a user-selected topic. The application displays ten books that match the chosen topic, and shows the author name, book title, list price, Amazon discount price, and the cover icon. The user may optionally view one review per displayed title and make a buying decision (Stearns & Garishakurthi, 2003).Java in Data Warehousing & MiningAlthough many companies currently benefit from data warehousing to support corporate decision making, new business intelligence approaches continue to emerge that can be powered by Java technology. Applications such as data warehousing, data mining, Enterprise Information Portals (EIP's), and Knowledge Management Systems (which can all comprise a businessintelligence application) are able to provide insight into customer retention, purchasing patterns, and even future buying behavior.These applications can not only tell what has happened but why and what may happen given certain business conditions; allowing for "what if" scenarios to be explored. As a result of this information growth, people at all levels inside the enterprise, as well as suppliers, customers, and others in the value chain, are clamoring for subsets of the vast stores of information such as billing, shipping, and inventory information, to help them make business decisions. While collecting and storing vast amounts of data is one thing, utilizing and deploying that data throughout the organization is another.The technical challenges inherent in integrating disparate data formats, platforms, and applications are significant. However, emerging standards such as the Application Programming Interfaces (API's) that comprise the Java platform, as well as Extendable Markup Language (XML) technologies can facilitate the interchange of data and the development of next generation data warehousing and business intelligence applications. While Java technology has been used extensively for client side access and to presentation layer challenges, it is rapidly emerging as a significant tool for developing scaleable server side programs. The Java2 Platform, Enterprise Edition (J2EE) provides the object, transaction, and security support for building such systems.Metadata IssuesOne of the key issues that business intelligence developers must solve is that of incompatible metadata formats. Metadata can be defined as information about data or simply "data about data." In practice, metadata is what most tools, databases, applications, and other information processes use to define, relate, and manipulate data objects within their own environments. It defines the structure and meaning of data objects managed by an application so that the application knows how to process requests or jobs involving those data objects. Developers can use this schema to create views for users. Also, users can browse the schema to better understand the structure and function of the database tables before launching a query.To address the metadata issue, a group of companies (including Unisys, Oracle, IBM, SAS Institute, Hyperion, Inline Software and Sun) have joined to develop the Java Metadata Interface (JMI) API. The JMI API permits the access and manipulation of metadata in Java with standard metadata services. JMI is based on the Meta Object Facility (MOF) specification from the Object Management Group (OMG). The MOF provides a model and a set of interfaces for the creation, storage, access, and interchange of metadata and metamodels (higher-level abstractions of metadata). Metamodel and metadata interchange is done via XML and uses the XML Metadata Interchange (XMI) specification, also from the OMG. JMI leverages Java technology to create an end-to-end data warehousing and business intelligence solutions framework.Enterprise JavaBeansA key tool provided by J2EE is Enterprise JavaBeans (EJB), an architecture for the development of component-based distributed business applications. Applications written using the EJB architecture are scalable, transactional, secure, and multi-user aware. These applications may be written once and then deployed on any server platform that supports J2EE. The EJB architecture makes it easy for developers to write components, since they do not need to understand or deal with complex, system-level details such as thread management, resource pooling, and transaction and security management. This allows for role-based development where component assemblers, platform providers and application assemblers can focus on their area of responsibility further simplifying application development.EJB's in the Travel IndustryA case study from the travel industry helps to illustrate how such applications could function. A travel company amasses a great deal of information about its operations in various applications distributed throughout multiple departments. Flight, hotel, and automobile reservation information is located in a database being accessed by travel agents worldwide. Another application contains information that must be updated with credit and billing historyfrom a financial services company. Data is periodically extracted from the travel reservation system databases to spreadsheets for use in future sales and marketing analysis.Utilizing J2EE, the company could consolidate application development within an EJB container, which can run on a variety of hardware and software platforms allowing existing databases and applications to coexist with newly developed ones. EJBs can be developed to model various data sets important to the travel reservation business including information about customer, hotel, car rental agency, and other attributes.Data Storage & AccessData stored in existing applications can be accessed with specialized connectors. Integration and interoperability of these data sources is further enabled by the metadata repository that contains metamodels of the data contained in the sources, which then can be accessed and interchanged uniformly via the JMI API. These metamodels capture the essential structure and semantics of business components, allowing them to be accessed and queried via the JMI API or to be interchanged via XML. Through all of these processes, the J2EE infrastructure ensures the security and integrity of the data through transaction management and propagation and the underlying security architecture.To consolidate historical information for analysis of sales and marketing trends, a data warehouse is often the best solution. In this example, data can be extracted from the operational systems with a variety of Extract, Transform and Load tools (ETL). The metamodels allow EJBsdesigned for filtering, transformation, and consolidation of data to operate uniformly on datafrom diverse data sources as the bean is able to query the metamodel to identify and extract the pertinent fields. Queries and reports can be run against the data warehouse that contains information from numerous sources in a consistent, enterprise-wide fashion through the use of the JMI API (Mosher & Oh, 2007).Java in Industrial SettingsMany people know Java only as a tool on the World Wide Web that enables sites to perform some of their fancier functions such as interactivity and animation. However, the actual uses for Java are much more widespread. Since Java is an object-oriented language like C++, the time needed for application development is minimal. Java also encourages good software engineering practices with clear separation of interfaces and implementations as well as easy exception handling.In addition, Java's automatic memory management and lack of pointers remove some leading causes of programming errors. Most importantly, application developers do not need to create different versions of the software for different platforms. The advantages available through Java have even found their way into hardware. The emerging new Java devices are streamlined systems that exploit network servers for much of their processing power, storage, content, and administration.Benefits of JavaThe benefits of Java translate across many industries, and some are specific to the control and automation environment. For example, many plant-floor applications use relatively simple equipment; upgrading to PCs would be expensive and undesirable. Java's ability to run on any platform enables the organization to make use of the existing equipment while enhancing the application.IntegrationWith few exceptions, applications running on the factory floor were never intended to exchange information with systems in the executive office, but managers have recently discovered the need for that type of information. Before Java, that often meant bringing together data from systems written on different platforms in different languages at different times. Integration was usually done on a piecemeal basis, resulting in a system that, once it worked, was unique to the two applications it was tying together. Additional integration required developing a brand new system from scratch, raising the cost of integration.Java makes system integration relatively easy. Foxboro Controls Inc., for example, used Java to make its dynamic-performance-monitor software package Internet-ready. This software provides senior executives with strategic information about a plant's operation. The dynamic performance monitor takes data from instruments throughout the plant and performs variousmathematical and statistical calculations on them, resulting in information (usually financial) that a manager can more readily absorb and use.ScalabilityAnother benefit of Java in the industrial environment is its scalability. In a plant, embedded applications such as automated data collection and machine diagnostics provide critical data regarding production-line readiness or operation efficiency. These data form a critical ingredient for applications that examine the health of a production line or run. Users of these devices can take advantage of the benefits of Java without changing or upgrading hardware. For example, operations and maintenance personnel could carry a handheld, wireless, embedded-Java device anywhere in the plant to monitor production status or problems.Even when internal compatibility is not an issue, companies often face difficulties when suppliers with whom they share information have incompatible systems. This becomes more of a problem as supply-chain management takes on a more critical role which requires manufacturers to interact more with offshore suppliers and clients. The greatest efficiency comes when all systems can communicate with each other and share information seamlessly. Since Java is so ubiquitous, it often solves these problems (Paula, 1997).Dynamic Web Page DevelopmentJava has been used by both large and small organizations for a wide variety of applications beyond consumer oriented websites. Sandia, a multiprogram laboratory of the U.S. Department of Energy's National Nuclear Security Administration, has developed a unique Java application. The lab was tasked with developing an enterprise-wide inventory tracking and equipment maintenance system that provides dynamic Web pages. The developers selected Java Studio Enterprise 7 for the project because of its Application Framework technology and Web Graphical User Interface (GUI) components, which allow the system to be indexed by an expandable catalog. The flexibility, scalability, and portability of Java helped to reduce development timeand costs (Garcia, 2004)IssueJava Security for E-Business ApplicationsTo support the expansion of their computing boundaries, businesses have deployed Web application servers (WAS). A WAS differs from a traditional Web server because it provides a more flexible foundation for dynamic transactions and objects, partly through the exploitation of Java technology. Traditional Web servers remain constrained to servicing standard HTTP requests, returning the contents of static HTML pages and images or the output from executed Common Gateway Interface (CGI ) scripts.An administrator can configure a WAS with policies based on security specifications for Java servlets and manage authentication and authorization with Java Authentication andAuthorization Service (JAAS) modules. An authentication and authorization service can bewritten in Java code or interface to an existing authentication or authorization infrastructure. Fora cryptography-based security infrastructure, the security server may exploit the Java Cryptography Architecture (JCA) and Java Cryptography Extension (JCE). To present the user with a usable interaction with the WAS environment, the Web server can readily employ a formof "single sign-on" to avoid redundant authentication requests. A single sign-on preserves user authentication across multiple HTTP requests so that the user is not prompted many times for authentication data (i.e., user ID and password).Based on the security policies, JAAS can be employed to handle the authentication process with the identity of the Java client. After successful authentication, the WAS securitycollaborator consults with the security server. The WAS environment authentication requirements can be fairly complex. In a given deployment environment, all applications or solutions may not originate from the same vendor. In addition, these applications may be running on different operating systems. Although Java is often the language of choice for portability between platforms, it needs to marry its security features with those of the containing environment.Authentication & AuthorizationAuthentication and authorization are key elements in any secure information handling system. Since the inception of Java technology, much of the authentication and authorization issues have been with respect to downloadable code running in Web browsers. In many ways, this had been the correct set of issues to address, since the client's system needs to be protected from mobile code obtained from arbitrary sites on the Internet. As Java technology moved from a client-centric Web technology to a server-side scripting and integration technology, it required additional authentication and authorization technologies.The kind of proof required for authentication may depend on the security requirements of a particular computing resource or specific enterprise security policies. To provide such flexibility, the JAAS authentication framework is based on the concept of configurable authenticators. This architecture allows system administrators to configure, or plug in, the appropriate authenticatorsto meet the security requirements of the deployed application. The JAAS architecture also allows applications to remain independent from underlying authentication mechanisms. So, as new authenticators become available or as current authentication services are updated, system administrators can easily replace authenticators without having to modify or recompile existing applications.At the end of a successful authentication, a request is associated with a user in the WAS user registry. After a successful authentication, the WAS consults security policies to determine if the user has the required permissions to complete the requested action on the servlet. This policy canbe enforced using the WAS configuration (declarative security) or by the servlet itself (programmatic security), or a combination of both.The WAS environment pulls together many different technologies to service the enterprise. Because of the heterogeneous nature of the client and server entities, Java technology is a good choice for both administrators and developers. However, to service the diverse security needs of these entities and their tasks, many Java security technologies must be used, not only at a primary level between client and server entities, but also at a secondary level, from served objects. By using a synergistic mix of the various Java security technologies, administrators and developers can make not only their Web application servers secure, but their WAS environments secure as well (Koved, 2001).ConclusionOpen standards have driven the e-business revolution. As e-business continues to develop, various computing technologies help to drive its evolution. The Java programming language and platform have emerged as major technologies for performing e-business functions. Java programming standards have enabled portability of applications and the reuse of application components. Java uses many familiar concepts and constructs and allows portability by providing a common interface through an external Java Virtual Machine (JVM). Today, you can find Java technology in networks and devices that range from the Internet and scientific supercomputers to laptops and cell phones, from Wall Street market simulators to home game players and credit cards.Java has found a place on some of the most popular websites in the world. Java applications not only provide unique user interfaces, they also help to power the backend of websites. While Java technology has been used extensively for client side access and in the presentation layer, it is also emerging as a significant tool for developing scaleable server side programs.Since Java is an object-oriented language like C++, the time needed for application development is minimal. Java also encourages good software engineering practices with clear separation of interfaces and implementations as well as easy exception handling. Java's automatic memory management and lack of pointers remove some leading causes of programming errors. The advantages available through Java have also found their way into hardware. The emerging new Java devices are streamlined systems that exploit network servers for much of their processing power, storage, content, and administration.中文翻译:标题:Java的商业应用。

java毕业设计外文文献原文及译文

java毕业设计外文文献原文及译文

毕业设计说明书英文文献及中文翻译学学 院:专指导教师:2014 年 6 月软件学院 软件工程Thinking in JavaAlthough it is based on C++, Java is more of a “pure” object-oriented C++ and Java are hybrid languages, but in Java the designers felt that the hybridization was not as important as it was in C++. A hybrid language allows multiple programming styles; the reason C++ is hybrid is to support backward compatibility with the C language. Because C++ is a superset of the C language, it includes many of that language’s undesirable features, which can make some aspects of C++ overly complicated. The Java language assumes that you want to do only object-oriented programming. This means that before you can begin you must shift your mindset into an object-oriented world (unless it’s already there). The benefit of this initial effort is the ability to program in a language that is simpler to learn and to use than many other OOP languages. In this chapter we’ll see the basic components of a Java program and we’ll learn that everything in Java is an object, even a Java program.Each programming language has its own means of manipulating data. Sometimes the programmer must be constantly aware of what type of manipulation is going on. Are you manipulating the object directly, or are you dealing with some kind of indirect representation (a pointer in C or C++) that must be treated with a special syntax?All this is simplified in Java. You treat everything as an object, using a single consistent syntax. Although you treat everything as an object, the identifier you manipulate is actually a “reference” to an object. You might imagine this scene as a television (the object) with your remote control (the reference). As long as you’re holding this reference, you have a connection to the television, but when someone says “change the channel” or “lower the volume,” what you’re manipulating is the reference, which in turn modifies the object. If you want to move around the room and still control the television, you take the remote/reference with you, not the television.Also, the remote control can stand on its own, with no television. That is, just because you have a reference doesn’t mean there’s necessarily an object connected to it. So if you want to hold a word or sentence, you create a String reference:But here you’ve created only the reference, not an object. If you decided to send a message to s at this point, you’ll get an error (at run time) because s isn’t actually attached to anything (there’s no television). A safer practice, then, is always to initialize a reference when you create it.However, this uses a special Java feature: strings can be initialized with quoted text. Normally, you must use a more general type of initialization for objectsWhen you create a reference, you want to connect it with a new object. You do so, in general, with the new keyword. The keyword new says, “Make me a new one of these objects.” So in the preceding example, you can say:Not only does this mean “Make me a new String,” but it also gives information about how to make the String by supplying an initial character string.Of course, String is not the only type that exists. Java comes with a plethora of ready-made types. What’s more important is that you can create your own types. In fact, that’s the fundamental activity in Java programming, and it’s what you’ll b e learning about in the rest of this bookIt’s useful to visualize some aspects of how things are laid out while the program is running—in particular how memory is arranged. There are six different places to store data: Registers. This is the fastest storage because it exists in a place different from that of other storage: inside the processor. However, the number of registers is severely limited, so registers are allocated by the compiler according to its needs. You don’t have direct control, nor do you see any evidence in your programs that registers even exist.The stack. This lives in the general random-access memory (RAM) area, but has direct support from the processor via its stack pointer. The stack pointer is moved down to create new memory and moved up to release that memory. This is an extremely fast and efficient way to allocate storage, second only to registers. The Java compiler must know, while it is creating the program, the exact size and lifetime of all the data that is stored on the stack, because it must generate the code to move the stack pointer up and down. This constraint places limits on the flexibility of your programs, so while some Java storage exists on the stack—in particular, object references—Java objects themselves are not placed on the stack. The heap. This is a general-purpose pool of memory (also in the RAM area) where all Java objects live. The nice thing about the heap is that, unlike the stack, the compiler doesn’t need to know how much storage it needs to allocate from the heap or how long that storage must stay on the heap. Thus, there’s a great deal of flexibility in using storage on the heap. Whenever you need to create an object, you simply write the code to create it by using new, and the storage is allocated on th e heap when that code is executed. Of course there’s a priceyou pay for this flexibility. It takes more time to allocate heap storage than it does to allocate stack storage (if you even could create objects on the stack in Java, as you can in C++). Static storage. “Static” is used here in the sense of “in a fixed location” (although it’s also in RAM). Static storage contains data that is available for the entire time a program is running. You can use the static keyword to specify that a particular element of an object is static, but Java objects themselves are never placed in static storage.Constant storage. Constant values are often placed directly in the program code, which is safe since they can never change. Sometimes constants are cordoned off by themselves so that they can be optionally placed in read-only memory (ROM), in embedded systems.Non-RAM storage. If data lives completely outside a program, it can exist while the program is not running, outside the control of the program. The two primary examples of this are streamed objects, in which objects are turned into streams of bytes, generally to be sent to another machine, and persistent objects, in which the objects are placed on disk so they will hold their state even when the program is terminated. The trick with these types of storage is turning the objects into something that can exist on the other medium, and yet can be resurrected into a regular RAM-based object when necessary. Java provides support for lightweight persistence, and future versions of Java might provide more complete solutions for persistenceOne group of types, which you’ll use quite often in your programming, gets special treatment. You can think of these as “primitive” types. The reason for the special treatment is that to create an object with new—especially a small, simple variable—isn’t very efficient, because new places objects on the heap. For these types Java falls back on the approach taken by C and C++. That is, instead of creating the variable by using new, an “automatic” variable is created that is not a reference. The variable holds the value, and it’s placed on the stack, so it’s much more efficient.Java determines the size of each primitive type. These sizes don’t change from one machine architecture to another as they do in most languages. This size invariance is one reason Java programs are portableJava编程思想“尽管以C++为基础,但Java是一种更纯粹的面向对象程序设计语言”。

java毕业论文外文文献翻译

java毕业论文外文文献翻译

Advantages of Managed CodeMicrosoft intermediate language shares with Java byte code the idea that it is a low-level language with a simple syntax , which can be very quickly translated into native machine code. Having this well-defined universal syntax for code has significant advantages.Platform independenceFirst, it means that the same file containing byte code instructions can be placed on any platform; at runtime the final stage of compilation can then be easily accomplished so that the code will run on that particular platform. In other words, by compiling to IL we obtain platform independence for .NET, in much the same way as compiling to Java byte code gives Java platform independence. Performance improvementIL is actually a bit more ambitious than Java byte code. IL is always Just-In-Time compiled (known as JIT), whereas Java byte code was often interpreted. One of the disadvantages of Java was that, on execution, the process of translating from Java byte code to native executable resulted in a loss of performance.Instead of compiling the entire application in one go (which could lead to a slow start-up time), the JIT compiler simply compiles each portion of code as it is called (just-in-time). When code has been compiled.once, the resultant native executable is stored until the application exits, so that it does not need to be recompiled the next time that portion of code is run. Microsoft argues that this process is more efficient than compiling the entire application code at the start, because of the likelihood that large portions of any application code will not actually be executed in any given run. Using the JIT compiler, such code will never be compiled.This explains why we can expect that execution of managed IL code will be almost as fast as executing native machine code. What it doesn’t explain is why Microsoft expects that we will get a performance improvement. The reason given for this is that, since the final stage of compilation takes place at runtime, the JIT compiler will know exactly what processor type the program will run on. This means that it can optimize the final executable code to take advantage of any features or particular machine code instructions offered by that particular processor.实际上,IL比Java字节代码的作用还要大。

JAVA毕业设计外文文献翻译

JAVA毕业设计外文文献翻译

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 Webapplication that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on themarket 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 appropriatein 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 computer platform in the Java programming language you could also do in assembly language. But it still matters which youchoose.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 completeyour 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 changesaccording 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 neednot 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 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 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 a high-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 ownpurposes. 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 theaforementioned 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 the born 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 alsoallows 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 strong function 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 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 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 andefficiently. 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 output the 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 Webapplication procedure very expediently.JSP的技术发展历史作者:Kathy Sierra and Bert Bates来源:Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。

java中英文翻译

java中英文翻译

java中英文翻译Characteristics of LANsThe main Characteristics of a LAN include its throughput,delays,wiring type and distances,security,and reliability.We discuss these characteristics below.We then compare the characteristics of major LANs.ThroughputThe throughput is the average total transmission rate when the LAN is heavily loaded by many nodes.In a shared LAN,the throughput is a fraction of the rate of the transmitters.This fraction is called the efficiency of the MAC protocl.For insyance,a network that uses a MAC protocol with an efficiency oh 65 percent and 10-Mbps transmitters has a throughput of 6.5 Mbps.These values are typical for a shared 10-Mbps Ethernet.The throughput of a token ring network and that of FDDI are close to their thransmission rate. Latency The latency is the time a packet takes froms its arrival at anetwork interface until it reaches the destination node.We explain in Section 4.8that this latency is almost aiways less than a fraction of a second and is often much smaller.Wiring Type and DistanceSome LANs use twisted wire pairs,others use optical fibers,Older LANs and installations in special environments use coaxial cables.The maximum length of the connections depends on the LAN and on the techanology.Typical values are 100 m for twisted pairs and a few kilometers for multimode fibers.SecurityAnoptical fiber is more difficult to tap into than a twisted pair,which improves the“physical”security.However,eave sdroppers rarely need to tap directly into a link to gain access to information.A more common attackis to use one of the computers attached on the LAN and configure it to read all the packets that travel on the network(this is called snooping).If sensitive pieces of information such as user passwords are transmitted in the clear(nonencrypted),then the eavesdropper obtains entry points into computers.As a rule,a switched LAN is more secure than a shared LAN because a computer on such a network sees only the packets intended for it.ReliabilityWe depend increasingly on networks.Accordingly,reliability becomes more essential.As we mentioned in the opening remarks of this chapter,FDDA is designed to survive a link or node failure.An Ethernet keeps on working when some of its nodes or links fail.Atoken ring network can be wired with bypass electronics to have a similar reliability.Network DevicesTextThere are many types of media for the network, and each one has advantages and disadvantages. One of the disadvantages of the type of cable that we primarily use (CAT5 UTP) is cable length. The maximum length for UTP cable in a network is 100 meters (approximately 333 feet). If we need to extend our network beyond that limit, we must add a device to our network. This device is called a repeater.The term repeater comes from the early days of visual communication, when a man situated on a hill would repeat the signal to the person on the hill to his right. It also comes fromtelegraph, telephone, microwave, and optical communications, all of which use repeaters to strengthen their signals over long distances, or else the signals will eventually fade or die out.The purpose of a repeater is regenerate and retime network signals at the bit level to allow them to travel a longer distance on the media. Watchout for the Four Repeater Rule for 10Mbps Ethernet, also known as the 5-4-3 Rule, when extending LAN segments. This rule states that you can connect five network segments end-to-end using four repeaters but only three segments can have hosts (computers) on them.The term repeater traditionally me ant a single port “in” and a single port “out” device. But in common terminology today the term multiport repeater is often used as well. Repeaters are classified as Layer 1 devices in the OSI model, because they act only on the bit level and look at no other information. The symbol for repeaters is not standardized.The purpose of a hub is to regenerate and retime network signals. This is done at the bit level to a large number of hosts (e.g.4,8, or even 24) using a process known as concentration. You will notice that this definition is very similar to the repeater’s, which is why a hub is also known as a multi-port repeater. The difference is the number of cables that connect to the device. Two reasons for using hubs are to create a central connection point for the wiring media, and increase the reliability of the network. The reliability of the network is increased by allowing any single cable to fail without disrupting the entire network. This differs from the bus topology where having one cable fail will disrupt the entire network. Hubs are considered Layer 1 devices because they only regenerate the signal and broadcast it out allof their ports (network connections).E-commerce (Electronic Commerce, is abbreviated as E-commerce) employs the way on the basis of the browser / server under the environment of Internet's open network, realize consumers' online shopping, online trade between the trade companies and a new kind of commercial operation modes paid by mails online. E-commerce on Internet can be divided into three respects: Information service, trade and paying. The main contentincludes: Electronic market conditions advertisement; The electron is chosen and exchange of trade, electronic trade evidence; Paying by mails and settling account and online service after sale,etc.. The main trade type is trade (C2C) of trade (B2B) and individual and man-to-man bet between enterprises and personal trade (B2C) and enterprise,etc.. JSP (Java Server Page) is that dynamic Web based on that Java has nothing to do but with the platform develops technology, there is very high operational efficiency, development period is shorter, it is stronger to expand ability, have opening, step the platform, expandability and reusable characteristic. JAVABEAN is kind of a kind of Java, become through encapsulating and have a certain function or target of dealing with a certain business, can visit Bean and method in JSP page Java code inside through inlaying. The online mobile phone store is a WEB application program based on that JSP/JAVABEAN technology sets up, divide into 2 parts of goods show of the front desk and sale, back-stage management, It is a kind of typical B2C e-commerce mode, realize the main function of e-commerce."The electronic commerce 21 century economy grows engine",It not only in on microscopic affects the enterprise themanagement behavior and consumer's expense behavior, moreover from on macroscopic will affect the international trade relations and the country future the competitive ability. This article in view of the electronic commerce in our country development present situation, has analyzed the question which exists in the development, proposed the corresponding solution and the suggestion, according to the physical resource, the financial resource and the talented person develops our country electronic commerce, explores the China electronic commerce development path.Here nowadays develops the condition and the tendency two aspects from the electronic commerce connotation and the characteristic as wellas the electronic commerce outlines the electronic commerce, by will have the direct-viewing understanding and the understanding to the electronic commerce. Makes the brief review afterwards to our country electronic commerce developing process, from aspect and so on environment condition, profession and local condition makes the multianalysis to our country electronic commerce development present situation and indicates the electronic commerce in our country foreign trade status and the function, analyzes question which exists in the development, like lacks in the strategic plan and the policy support is insufficient, the corresponding legal laws and regulations standard standard lag and so on. Finally aims at the question to propose the countermeasure and the suggestion, including government countermeasure and to enterprise, individual request and so on, and the forecast forecast electronic commerce development tendency and the direction, can play the certain impetus role by the time to our country electroniccommerce health development . abstract ] this article with to know the circumstances of the matter the power in the outline electronic commerce right of privacy and its in the protection question foundation, discussed in the electronic commerce the right of privacy with to know the circumstances of the matter the power conflict question, then proposed the solution two conflict principle and the means. [ Key word ] the electronic commerce right of privacy knows the circumstances of the matter the power The electronic commerce is one kind of brand-new commercial mechanism which under the whole world economic integration background produces, has the high efficiency, boundless characteristic and so on, does not have time limit and low cost, receives the global various countries government and the enterprise widely takes, has become at the beginning of for the 21st century one of global economy biggest growth. The electronic commerce has had the huge impact to the present legal system, if this article is going to discussthe right of privacy and knows the circumstances of the matter the power always is a pair of opposition legal science category, they have represented the different aspect spiritual benefit, but in information time electronic commerce, these two kind of rights conflict then is more prominent, therefore we have the necessity with to know the circumstances of the matter the power to in the electronic commerce right of privacy to carry on the discussion, and attempts to seek the coordinated two conflict the means. In 1 electronic commerce privacy and its protection (1) in electronic commerce right of privacy and its content. The right of privacy is the natural person enjoys to its individual, individual information, the personal activity and the private domain which has nothing to do with with the public interestcarries on the control one kind of personality power. The right of privacy took an independent civil right already confirms by many national constitutions and legal as well as the international human rights organization's document and the protection. In our country, "General provisions of the civil law" stipulates to the right of privacy principle for citizen's personal dignity the legal protection. The Supreme People's Court's two judicial interpretation, will violate the other people privacy the behavior to recognize for will be violates the other people right of reputation one kind of behavior. The right of privacy took one kind of concrete personality power, its basic content mainly includes the privacy to conceal the power, the privacy use power, the privacy maintenance power and the privacy right to control and so on four rights. Along with electronic commerce swift and violent development, the people stemming from the network transaction need, must provide including the oneself individual material in the network to each kind of operator the privacy, moreover consumer on-line "whereabouts", like individual arrives the website, the expense custom, the reading custom credit record which visitsand so on also frequently in unconsciously center is even recorded. But these individual materials are possibly given by the collection resale other commercial organizations. Therefore, under this kind of situation, the people to participate in the electronic commerce whether can expose the oneself individual privacy extremely to pay attention in the electronic commerce the protection mainly concentrates to the right of privacy in 3 aspects. (1) individual material right of privacy protection.(2) correspondence secret and correspondence free protection. (3) individual life peaceful protection.局域网的特点局域网的主要特点包括它的吞吐量,延迟,线路类型和距离,安全和可靠性. 下面我们就讨论一下这些特点.然后,我们把一些主要局域网的特点作个比较。

Java技术介绍-毕业论文外文翻译

Java技术介绍-毕业论文外文翻译

Java Technical DescriptionJava as a Programming Platform.Java is certainly a good programming language. There is no doubt that it is one of the better languages available to serious programmers. We think it could potentially have been a great programming language, but it is probably too late for that. Once a language is out in the field, the ugly reality of compatibility with existing code sets in."Java was never just a language. There are lots of programming languages out there, and few of them make much of a splash. Java is a whole platform, with a huge library, containing lots of reusable code, and an execution environment that provides services such as security, portability across operating systems, and automatic garbage collection.As a programmer, you will want a language with a pleasant syntax and comprehensible semantics (i.e., not C++). Java fits the bill, as do dozens of other fine languages. Some languages give you portability, garbage collection, and the like, but they don't have much of a library, forcing you to roll your own if you want fancy graphics or networking or database access. Well, Java has everything—a good language, a high-quality execution environment, and a vast library. That combination is what makes Java an irresistible proposition to so many programmers.Features of Java.1.SimpleWe wanted to build a system that could be programmed easily without a lot of esoteric training and which leveraged today's standard practice. So even though we found that C++ was unsuitable, we designed Java as closely to C++ as possible in order to make the system more comprehensible. Java omits many rarely used, poorly understood, confusing features of C++ that, in our experience, bring more grief than benefit.The syntax for Java is, indeed, a cleaned-up version of the syntax for C++. There is no need for header files, pointer arithmetic (or even a pointer syntax), structures, unions, operator overloading, virtual base classes, and so on. (See the C++ notes interspersed throughout the text for more on the differences between Java and C++.) The designers did not, however, attempt to fix all of the clumsy features of C++. For example, the syntax of the switch statement is unchanged in Java. If you know C++, you will find the transition to the Java syntax easy.If you are used to a visual programming environment (such as Visual Basic), you will not find Java simple. There is much strange syntax (though it does not take long to get the hang of it). More important, you must do a lot more programming in Java. The beauty of Visual Basic is that its visual design environment almost automatically provides a lot of the infrastructure for an application. The equivalent functionality must be programmed manually, usually with a fair bit of code, in Java. There are, however, third-party development environments that provide "drag-and-drop"-style program development.Another aspect of being simple is being small. One of the goals of Java is to enable the construction of software that can run stand-alone in small machines. The size of the basic interpreter and class support is about 40K bytes; adding the basic standard libraries and thread support (essentially a self-contained microkernel) adds an additional 175K.2. Object OrientedSimply stated, object-oriented design is a technique for programming that focuses on the data (= objects) and on the interfaces to that object. To make an analogy with carpentry, an "object-oriented" carpenter would be mostly concerned with the chair he was building, and secondarily with the tools used to make it; a "non-object-oriented" carpenter would think primarily of his tools. The object-oriented facilities of Java are essentially those of C++.Object orientation has proven its worth in the last 30 years, and it is inconceivable that a modern programming language would not use it. Indeed, the object-oriented features of Java are comparable to those of C++. The major differencebetween Java and C++ lies in multiple inheritance, which Java has replaced with the simpler concept of interfaces, and in the Java metaclass model. The reflection mechanism and object serialization feature make it much easier to implement persistent objects and GUI builders that can integrate off-the-shelf components.3. DistributedJava has an extensive library of routines for coping with TCP/IP protocols like HTTP and FTP. Java applications can open and access objects across the Net via URLs with the same ease as when accessing a local file system. We have found the networking capabilities of Java to be both strong and easy to use. Anyone who has tried to do Internet programming using another language will revel in how simple Java makes onerous tasks like opening a socket connection. (We cover networking in Volume 2 of this book.) The remote method invocation mechanism enables communication between distributedobjects (also covered in Volume 2).There is now a separate architecture, the Java 2 Enterprise Edition (J2EE), that supports very large scale distributed applications.4. RobustJava is intended for writing programs that must be reliable in a variety of ways. Java puts a lot of emphasis on early checking for possible problems, later dynamic (run-time) checking, and eliminating situations that are error-prone.… The single biggest difference between Java and C/C++ is that Java has a pointer model that eliminates the possibility of overwriting memory and corrupting data.This feature is also very useful. The Java compiler detects many problems that, in other languages, would show up only at run time. As for the second point, anyone who has spent hours chasing memory corruption caused by a pointer bug will be very happy with this feature of Java.If you are coming from a language like Visual Basic that doesn't explicitly use pointers, you are probably wondering why this is so important. C programmers are not so lucky. They need pointers to access strings, arrays, objects, and even files. In Visual Basic, you do not use pointers for any of these entities, nor do you need to worry about memory allocation for them. On the other hand, many data structures aredifficult to implement in a pointerless language. Java gives you the best of both worlds. You do not need pointers for everyday constructs like strings and arrays. You have the power of pointers if you need it, for example, for linked lists. And you always have complete safety, because you can never access a bad pointer, make memory allocation errors, or have to protect against memory leaking away.5. SecureJava is intended to be used in networked/distributed environments. Toward that end, a lot of emphasis has been placed on security. Java enables the construction of virus-free, tamper-free systems.In the first edition of Core Java we said: "Well, one should 'never say never again,'" and we turned out to be right. Not long after the first version of the Java Development Kit was shipped, a group of security experts at Princeton University found subtle bugs in the security features of Java 1.0. Sun Microsystems has encouraged research into Java security, making publicly available the specification and implementation of the virtual machine and the security libraries. They have fixed all known security bugs quickly. In any case, Java makes it extremely difficult to outwit its security mechanisms. The bugs found so far have been very technical and few in number. From the beginning, Java was designed to make certain kinds of attacks impossible, among them:∙Overrunning the runtime stack—a common attack of worms and viruses Corrupting memory outside its own process space Reading or writing files without permission.∙A number of security features have been added to Java over time. Since version1.1, Java has the notion of digitally signed classesWith a signed class, you can be sure who wrote it. Any time you trust the author of the class, the class can be allowed more privileges on your machine.6. Architecture NeutralThe compiler generates an architecture-neutral object file format—the compiled code is executable on many processors, given the presence of the Java runtime system.The Java compiler does this by generating bytecode instructions which have nothing to do with a particular computerarchitecture. Rather, they are designed to be both easy to interpret on any machine and easily translated into native machine code on the fly.This is not a new idea. More than 20 years ago, both Niklaus Wirth's original implementation of Pascal and the UCSD Pascal system used the same technique. Of course, interpreting bytecodes is necessarily slower than running machine instructions at full speed, so it isn't clear that this is even a good idea. However, virtual machines have the option of translating the most frequently executed bytecode sequences into machine code, a process called just-in-time compilation. This strategy has proven so effective that even Microsoft's .NET platform relies on a virtual machine.The virtual machine has other advantages. It increases security because the virtual machine can check the behavior of instruction sequences. Some programs even produce bytecodes on the fly, dynamically enhancing the capabilities of a running program.7. PortableUnlike C and C++, there are no "implementation-dependent" aspects of the specification. The sizes of the primitive data types are specified, as is the behavior of arithmetic on them.For example, an int in Java is always a 32-bit integer. In C/C++, int can mean a 16-bit integer, a 32-bit integer, or any other size that the compiler vendor likes. The only restriction is that the int type must have at least as many bytes as a short int and cannot have more bytes than a long int. Having a fixed size for number types eliminates a major porting headache. Binary data is stored and transmitted in a fixed format, eliminating confusion about byte ordering. Strings are saved in a standard Unicode format.The libraries that are a part of the system define portable interfaces. For example, there is an abstract Window class and implementations of it for UNIX, Windows, and the Macintosh.As anyone who has ever tried knows, it is an effort of heroic proportions to write a program that looks good on Windows, the Macintosh, and 10 flavors of UNIX. Java1.0 made the heroic effort, delivering a simple toolkit that mapped common user interface elements to a number of platforms.Unfortunately, the result was a library that, with a lot of work, could give barely acceptable results on different systems. (And there were often different bugs on the different platform graphics implementations.) But it was a start. There are many applications in which portability is more important than user interface slickness, and these applications did benefit from early versions of Java. By now, the user interface toolkit has been completely rewritten so that it no longer relies on the host user interface. The result is far more consistent and, we think, more attractive than in earlier versions of Java.8. InterpretedThe Java interpreter can execute Java bytecodes directly on any machine to which the interpreter has been ported. Since linking is a more incremental and lightweight process, the development process can be much more rapid and exploratory.Incremental linking has advantages, but its benefit for the development process is clearly overstated. In any case, we have found Java development tools to be quite slow. If you are used to the speed of the classic Microsoft Visual C++ environment, you will likely be disappointed with the performance of Java development environments. (The current version of Visual Studio isn't as zippy as the classic environments, however. No matter what languageyou program in, you should definitely ask your boss for a faster computer to run the latest development environments. )9. High PerformanceWhile the performance of interpreted bytecodes is usually more than adequate, there are situations where higher performance is required. The bytecodes can be translated on the fly (at run time) into machine code for the particular CPU the application is running on.If you use an interpreter to execute the bytecodes, "high performance" is not the term that we would use. However, on many platforms, there is also another form ofcompilation, the just-in-time (JIT) compilers. These work by compiling the bytecodes into native code once, caching the results, and then calling them again if needed. This approach speeds up commonly used code tremendously because one has to do the interpretation only once. Although still slightly slower than a true native code compiler, a just-in-time compiler can give you a 10- or even 20-fold speedup for some programs and will almost always be significantly faster than an interpreter. This technology is being improved continuously and may eventually yield results that cannot be matched by traditional compilation systems. For example, a just-in-time compiler can monitor which code is executed frequently and optimize just that code for speed.10. MultithreadedThe enefits of multithreading are better interactive responsiveness and real-time behavior.if you have ever tried to do multithreading in another language, you will be pleasantly surprised at how easy it is in Java. Threads in Java also can take advantage of multiprocessor systems if the base operating system does so. On the downside, thread implementations on the major platforms differ widely, and Java makes no effort to be platform independent in this regard. Only the code for calling multithreading remains the same across machines; Java offloads the implementation of multithreading to the underlying operating system or a thread library. Nonetheless, the ease of multithreading is one of the main reasons why Java is such an appealing language for server-side development.11. DynamicIn a number of ways, Java is a more dynamic language than C or C++. It was designed to adapt to an evolving environment. Libraries can freely add new methods and instance variables without any effect on their clients. In Java, finding out run time type information is straightforward.This is an important feature in those situations in which code needs to be added to a running program. A prime example is code that is downloaded from the Internet to run in a browser. In Java 1.0, finding out runtime type information was anything but straightforward, but current versions of Java give the programmer full insight intoboth the structure and behavior of its objects. This is extremely useful for systems that need to analyze objects at run time, such as Java GUI builders, smart debuggers, pluggable components, and object databases.Java技术介绍Java是一种程序设计平台Java是一种优秀的程序设计语言。

Java技术外文翻译文献

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外文文献+翻译

(完整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。

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 mayquestion why it is so important and why it is being promoted as a revolutionarystep in computer programming. The answer isn’timmediately obvious if you’re coming from a traditional programming perspective. Although Java is very useful for solving traditional standalone programming problems, it is also important because it will solve programming problems on the World Wide Web.What is the Web?The Web can seem a bit of a mystery at first, with all this talk of “surfing,”helpful to step back and see what it realland “homepages.”It’s“presence,”y is, but to do this you must understand client/server systems, another aspecfull of confusing issues.t of computing that’sClient/Se rver computingThe primary idea of a client/server system is that you have a central repositoryof information—some kind of data, often in a database—that you want todistribute on demand to some set of people or machines. A key to the client/server concept is that the repository of information is centrally located so that it an be changed and so that those changes will propagate out to the information consumers. Taken together, the information repository, the software that distributes the information, and the machine(s) where the information and software reside is called the server. The software that resides on the remote machine, communicates with the server, fetches the information, processes it, and then displays it on the remote machine is called the client.The basic concept of client/server computing, then, is not so complicated. The problems arise because you have a single server trying to serve many clientsat once. Generally, a database management system is involved, so the designer the layout of data into tables for optimal use. In addition, systems oft “balances”en allow a client to insert new information into a server. This means you mustnew datwalk over another client’snew data doesn’tensure that one cl ient’slost in the process of adding it to the database (this is called a, or that data isn’ttransaction processing). As client software changes, it mustbe built, debugged,and installed on the client machines, which turns out to be more complicatedespecially problematic to support muand expensive than you might think. It’sthe all-impoltiple types of computers and operating systems. Finally, there’srtant performance issue: You might have hundreds of clients making requestsof your server at any one time, so any small delay is crucial. To minimize latency, programmers work hard to offload processing tasks, often to the client machine, but sometimes to other machines at the server site, using so-called middleware. (Middleware is also used to improve maintainability.)The simple idea of distributing information has so many layers of complexitcrucial: Cliy that the whole problem can seem hopelessly enigmatic. And yet it’sent/server computing accounts for roughly half of all programming activities. It’s responsible for everything from taking orders and credit-c ar d transactions tothe distribution of any kind of data—stock market, scientific, government, youname it. What we’ve come up with in the past is individual solutions to individual problems, inventing a new solution each time. These were hard to create and hard to use, and the user had to learn a new interface for each one. The entire client/server problem needs to be solved in a big way.The Web asagiant s ervera bit worse than thThe Web is actually one giant client/server system. It’sat, since you have all the servers and clients coexisting on a single network atneed to know that, because all you care about is connecting to a once. You don’tnd interacting with one server at a time (even though you might be hopping around the world in your search for the correct server). Initially it was a simple one-way process. You made a request of a server and it handed you a file, which y browser software (i.e., the client) would interpret by formatting o our machine’snto your local machine. But in short order people began wanting to do morethan just deliver pages from a server. They wanted full client/server capability so that the client could feed information back to the server, for example, to do database lookups on the server, to add new information to the server, or to place an order ( which required more security than the original systems offered). These are thechanges we’ve been seeing in the development of the Web.The Web browser was a big step forward: the concept that one piece of information could be displayed on any type of computer without change. However, br owsers were still rather primitive and rapidly bogged down by the demands plaparticularly interactive, and tended to clog up bothced on them. They weren’tthe server and the Internet because any time you needed to do something that required programming you had to send information back to the server to be pro cessed. It could take many seconds or minutes to find out you had misspelled perf something in your request. Since the browser was just a viewer it couldn’torm even the simplest computing tasks. (On the otherexecute any programs on your local machi hand, it was safe, because it couldn’tne that might contain bugs or viruses.)To solve this problem, different approaches have been taken. To begin with, gr aphics standards have been enhanced to allow better animation and video within browsers. The remainder of the problem can be solved only by incorporating the ability to run programs on the client end, under the browser. This iscalled client-side programming.Client-side programmingThe Web’sinitial 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 HyperText Markup Language (HTML) contains simple mechanis ms 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 dataon the form or “submit”the data on the form back to the server. This submissio n 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 th typically called “cgi-b in.” (If you watch the address window at the top ofat’syour 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 has been a common choice because it is designed for text manipulation and is interpreted, so it can be installed on any server regardlessof processor or operating system. However, Python (my favorite—see www.Pyt /doc/4110905303.html,) has been making inroads because of its greater power and simplicity. Many powerful Web sites today are built strictly on CGI, and you can in fact do nearly anything with CGI. However, Web sites built on CGI programs can rapidly become overly complicated to maintain, and there is alsothe problem of respo nse time. The response of a CGI program depends on how much data must be s ent, as well as the load on both the server and the Internet. (On top of this, sta rting a CGI program tends to be slow.) The initial designers of the Web did notforesee how rapidly this bandwidth would be exhausted for the kinds of applic ations people developed. For example, any sort of dynamic graphing is nearly i mpossible to perform with consistency because a Graphics Interchange Format (GIF) file must be created and moved from the server to the client for each ve rsion of the graph. And you’ve no doubt had direct experience with somethingas 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 pro gram that discovers an error, formats an HTML page informing you of the error, and then sends the page back to you; you minelegant. The so ust then back up a page and try again. Not only is this slow, it’slution 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 thenext page. Client-side programming means that the Web browser is harnessedto do whatever work it can, and the result for the user is a much speedier andmore interactive experience at your Web site. The problemwith discussionsvery different from discussionsof client-side programmi ng is that they aren’tof 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 pro vides an overview of the issues and approaches in client-side programming.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 funct ionality 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 perf (You need to download the plug-in only once.) Some fast orm this new activity.”and powerful behavior is added to browsers via plug-ins, but writing a plug-inwant to do as part ofsomething you’dis not a trivial task, and isn’tthe process of building a particular site. The value of the plug-in for client-side programming is that it allows an expert programmer todevelop a new language and add that language to a browser without the permission of the browser manufacturer. Thus, plug-ins provide a “back d oor” that allows the creation of new client-side programming languages (although not all languages are implemented as plug-ins).ScriptinglanguagesPlug-ins resulted in an explosion of scripting languages. With a scripting language, you embed the source code for your client-side program directlyinto 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 fordoing amazingly so everyone to see (and steal). Generally, however, you aren’tphisticated 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 richerand more interactive graphical user interfaces (GUIs).However, a scripting language might solve 80 percent of the problems encountered in client-side prog ramming. 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 s olution such as Java or ActiveX programming.The most commonly discussed browser scripting languages are JavaScript (named that way just to grab some of Ja which has nothing to do with Java; it’smarketing momentum), VBScript (which looks like Visual BASIC), and Tcl/va’sTk, 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 bothNetscape Navigator and the Microsoft Internet Explorer (IE). Unfortunately,the flavor of JavaScript on the two browsers can vary widely (the Mozilla browser, freely downloadable from /doc/4110905303.html,, supports the ECMAScript standard, which may one day become universally supported). In addition, there are probably more JavaScript books available than there arefor 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 pr oductive using those scripting languages rather than learning a new one. (You’ll have your hands full dealing with the Web issues already.)ja va和因特网既然Jav a不过另一种类型的程序设计语言,大家可能会奇怪它为什么值得如此重视,为什么还有这么多的人认为它是计算机程序设计的一个里程碑呢?如果您来自一个传统的程序设计背景,那么答案在刚开始的时候并不是很明显。

java中英文对照

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. Early languages such as LISP and APL chose particular views of the world (“All problems are ultimately lists” or “All problems are algorithmic,” respectively). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the particular class of problem they’re designed to solve, but when you step outside of that domain they become awkward.The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the solution space as “objects.” (You will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, sowhen you read the code describing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run. There’s still a connection back to the computer: each object looks quite a bit like a little computer—it has a state, and it has operations that you can ask it to perform. However, this doesn’t seem like such a bad analogy to objects in the real world—they all have characteristics and behaviors.Alan Kay summarized five basic characteristics of Smalltalk, the first successful object-oriented language and one of the languages upon which Java is based. These characteristics represent a pure approach to object-oriented programming:1.Everything is an object.Think of an object as a fancy variable; it stores data, but you can “makerequests” to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem you’re trying to solve (dogs, building s, services, etc.) and represent it as an object in your program.2. A program is a bunch of objects telling each other what to do by sending messages. To make arequest of an object, you “send a message” to that object. More concretely, you can think of a m essage as a request to call a method that belongs to a particular object.3.Each object has its own memory made up of other objects. Put another way, you create a new kindof object by making a package containing existing objects. Thus, you can build complexity into a program while hiding it behind the simplicity of objects.4.Every object has a type. Using the parlance, each object is an instance of a class, in which “class” issynonymous with “type.” The most important distinguishing characteristic of a class is “What messages can you send to it?”5.All objects of a particular type can receive the same messages. This is actually a loaded statement,as you will see later. Because an object of type “circle” is also an object of type “shape,” a circle is guaranteed to accept shape messages. This means you can write code that talks to shapes and automatically handle anything that fits the description of a shape. This substitutability is one of the powerful concepts in OOP.Booch offers an even more succinct description of an object:An object has state, behavior and identity.This means that an object can have internal data (which gives it state), methods (to produce behavior), and each object can be uniquely distinguished from every other object—to put this in a concrete sense, each object has a unique address in memory.1.2 An object has an interfaceAristotle was probably the first to begin a careful study of the concept of type;he spoke of “the class of fishes and the class of birds.” The idea that all objects, while being unique, are also part of a class of objects that have characteristics and behaviors in common was used directly in the first object-oriented language, Simula-67, with its fundamental keyword class that introduces a new type into a program.S imula, as its name implies, was created for developing simulations such as the classic “bank teller problem.” In this, you have a bunch of tellers, customers, accounts, transactions, and units of money—a lot of “objects.” Objects that are identical except for their state during a program’s execution are grouped together into “classes of objects” and that’s where the keyword class came from. Creating abstract data types (classes) is a fundamental concept in object-oriented programming. Abstract data types work almost exactly like built-in types: You can create variables of a type (called objects or instances in object-oriented parlance) and manipulate those variables (called sending messages or requests; you send a message and the object figures out what to do with it). The members (elements) of each class share some commonality: every account has a balance, every teller can accept a deposit, etc. At the same time, each member has its own state: each account has a different balance, each teller has a name. Thus, the tellers, customers, accounts, transactions, etc., can each be represented with a unique entity in the computer program. This entity is the object, and each object belongs to a particular class that defines its characteristics and behaviors.So, although what we really do in object-oriented programming is create new data types, virtually all object-oriented programming languages use the “class” keyword. When you see the word “type” think “class” and vice versa.Since a class describes a set of objects that have identical characteristics (data elements) and behaviors (functionality), a class is really a data type because a floating point number, for example, also has a set ofcharacteristics and behaviors. The difference is that a programmer defines a class to fit a problem rather than being forced to use an existing data type that was designed to represent a unit of storage in a machine. You extend the programming language by adding new data types specific to your needs. The programming system welcomes the new classes and gives them all the care and type-checking that it gives to built-in types.The object-oriented approach is not limited to building simulations. Whether or not you agree that any program is a simulation of the system you’re designing, the use of OOP techniques can easily reduce a large set of problems to a simple solution.Once a class is established, you can make as many objects of that class as you like, and then manipulate those objects as if they are the elements that exist in the problem you are trying to solve. Indeed, one of the challenges of object-oriented programming is to create a one-to-one mapping between the elements in the problem space and objects in the solution space.But how do you get an object to do useful work for you? There must be a way to make a request of the object so that it will do something, such as complete a transaction, draw something on the screen, or turn on a switch. And each object can satisfy only certain requests. The requests you can make of an object are defined by its interface, and the type is what determines the interface. A simple example might be a representation of a light bulb:Light lt = new Light();lt.on();The interface establishes what requests you can make for a particular object. However, there must be code somewhere to satisfy that request. This, along with the hidden data, comprises the implementation. From a procedural programming standpoint, it’s not that complicated. A type has a method associated with each possible request, and when you make a particular request to an object, that method is called. This process isusually summarized by saying that you “send a message” (make a request) to an object, and the object figures out what to do with that message (it executes code).Here, the name of the type/class is Light, the name of this particular Light object is lt,and the requests that you can make of a Light object are to turn it on, turn it off, make it brighter, or make it dimmer. You create a Light object by defining a “reference” (lt) for that object and calling new to request a new object of that type. To send a message to the object, you state the name of the object and connect it to the message request with a period (dot). From the standpoint of the user of a predefined class, that’s pretty much all there is to programming with objects.The preceding diagram follows the format of the Unified Modeling Language(UML). Each class is represented by a box, with the type name in the top portion of the box, any data members that you care to describe in the middle portion of the box, and the methods(the functions that belong to this object, which receive any messages you send to that object) in the bottom portion of the box. Often, only the name of the class and the public methods are shown in UML design diagrams, so the middle portion is not shown. If you’re interested only in the class name, then the bottom portion doesn’t need to be shown, either1.3 An object provides services.While you’re trying to develop or understand a program design, one of the best ways to think about objects is as “service providers.” Your program itself will provide services to the user, and it will accomplish this by using the services offered by other objects. Your goal is to produce (or even better, locate in existing code libraries) a set of objects that provide the ideal services to solve your problem.A way to start doing this is to ask “if I could magically pull them out of a hat, what objects would solve my problem right away?” For example, suppose you are creating a bookkeeping program. You might imagine some objects that contain pre-defined bookkeeping input screens, another set of objects that perform bookkeeping calculations, and an object that handles printing of checks and invoices on all different kinds of printers. Maybe some of these objects alread y exist, and for the ones that don’t, what would they look like? What services would those objects provide, and what objects would they need to fulfill their obligations? If you keep doing this, you will eventually reach a point where you can say either “t hat object seems simpleenough to sit down and write” or “I’m sure that object must exist already.” This is a reasonable way to decompose a problem into a set of objects.Thinking of an object as a service provider has an additional benefit: it helps to improve the cohesiveness of the object. High cohesion is a fundamental quality of software design: It means that the various aspects of a software component (such as an object, although this could also apply to a method or a library of objects) “fit togethe r” well. One problem people have when designing objects is cramming too much functionality into one object. For example, in your check printing module, you may decide you need an object that knows all about formatting and printing. You’ll probably discover that this is too much for one object, and that what you need is three or more objects. One object might be a catalog of all the possible check layouts, which can be queried for information about how to print a check. One object or set of objects could be a generic printing interface that knows all about different kinds of printers (but nothing about bookkeeping—this one is a candidate for buying rather than writing yourself). And a third object could use the services of the other two to accomplish the task. Thus, each object has a cohesive set of services it offers. In a good object-oriented design, each object does one thing well, but doesn’t try to do too much. As seen here, this not only allows the discovery of objects that might be purchased (the printer interface object), but it also produces the possibility of an object that might be reused somewhere else (the catalog of check layouts).Treating objects as service providers is a great simplifying tool, and it’s very useful not only during the design process, but also when someone else is trying to understand your code or reuse an object—if they can see the value of the object based on what service it provides, it makes it much easier to fit it into the design.1. 对象入门1.1 抽象的进步所有编程语言的最终目的都是提供一种“抽象”方法。

JAVA游戏英文文献翻译

JAVA游戏英文文献翻译

J2ME mobile games programmingJ2ME and Wireless DevicesWith the dramatic increase and sophistication of mobile communications devices such as cell phones came demand for applications that can run on those devices. Consumers and corporations want to expand mobile communications devices from voice communications to applications traditionally found on laptops and PCs. They want to send and receive email, store and retrieve personal information, perform sophisticated calculations, and play games.Developers, mobile communications device manufacturers, and mobile network providers are anxious to fill this need, but there is a serious hurdle: mobile communications devices utilize a number of different application platforms and operating systems.Without tweaking the code, an application written for one device cannot run on another device. Mobile communications devices lack a standard application platform and operating system, which has made developing applications for mobile communications devices a risky economic venture for developers.The lack of standards is nothing new to computing or to any developing technology. Traditionally, manufacturers of hardware devices try to corner the market and enforce their own proprietary standard as the de facto standard for the industry. Usually one upstart succeeds, as in the case of Microsoft. Other times, industry leaders form a consortium, such as the Java Community Process Program, to collectively develop a standard. The Wireless Application Protocol (WAP) forum became the initial industry group that set out to create standards for wireless technology. Ericsson, Motorola, Nokia, and Unwired Planet formed theWAP forum in 1997, and it has since grown to include nearly all mobile device manufacturers, mobile network providers, and developers. The WAP forum created mobile communications device standards referred to as theWAP standard. TheWAP standard is an enhancement of HTML, XML, and TCP/IP. One element of this standard is the Wireless Markup Language specification, which consists of a blend of HTML and XML and is used by developers to create documents that can be displayed by a microbrowser. A microbrowser is a diminutive web browser that operateson a mobile communications device.TheWAP standard also includes specifications for aWireless Telephony Application Interface (WTAI) specification and the WMLScript specification. WTAI is used to create an interface for applications that run on a mobile communications device. WMLScript is a stripped-down version of JavaScript.While the WAP forum provided the framework within which developers can build mobile communications device applications, they still had to overcome a common hurdle found in every rapidly developing technology. The sophistication of mobile communications devices, phenomenal growth of the market, and high demand for industrial-strength mobile communications applications out-paced the ability to define and implement new mobile communications device standards.Many sophisticated applications designed for mobile communications devices require the device to process information beyond the capabilities of theWAP specification. J2ME provided the standard to fill this gap. For example, a sales representative wants to check available flights and hotel accommodations, purchase an airline ticket, book the hotel and car rental, and then send the itinerary to a client, all while sitting in a taxi in traffic. The sales representative also wants the itinerary stored on the mobile communications device and retrieved during the trip.J2ME applications referred to as a MIDlet can run on practically any mobile communications device that implements a JVM and MIDP. This encourages developers to invest time and money in building applications for mobile communications devices without the ri sk that the application is device dependent. However, J2ME isn’t seen as a replacement for the WAP specification because both are complementary technologies. Developers whose applications are light-client based continue to use WML and WMLScript. Developers turn to J2ME for heavier clients that require sophisticated processing on the mobile communications device.The Game API PackageThe javax.microedition.lcdui.game package, a welcome addition to MIDP in version 2.0, provides classes that enable developers to build rich gaming content for wireless devices. The classes have been implemented in a way that reduces application size andimproves performance by minimizing the amount of work done by code written in the Java programming language. The API is based on low-level graphics classes such as Graphics and Image from MIDP 1.0, so you can use this package in conjunction with graphics primitives. A good example would be to use the Game API package to render a complex background, and render visual elements on top of it using graphics primitives like drawLine().Note that when methods modify the states of the classes in this package, there is no immediate visible effect. The objects store their states, for use in subsequent calls to paint() – which is fine for gaming applications that redraw the entire screen at the end of every game cycle.The Game API package comprises five classes: GameCanvas is a subclass of javax.microedition.lcdui.Canvas; it provides the basic screen functionality for a game. It includes gaming-oriented methods to query the state of the game keys, and synchronous graphics flushing. Such features simplify building games and improve their performance.Layer is an abstract class that forms the basis for a framework of layered graphics. It represents a visual element in a game, such as a Sprite or a TiledLayer, and has attributes like location, size, and visibility.Sprite is a basic animated layer that can display one of several graphical frames, which are of equal size and are stored in a single Image object. It supports transformations such as flip and rotate, as well as collision-detection methods to simplify implementing the game's logic.TiledLayer represents a visual element composed of a grid of cells that can be filled with a set of tile images. This class enables the developer to create large areas of graphical content without the resource use that a large Image object would require.LayerManager simplifies game development by automating the rendering process. This class is useful for games with multiple layers. It enables the developer to set a view window to represent the user's view of the game, and automatically renders the game's layers to implement the desired view.The Game CanvasThe GameCanvas class is a subclass of javax.microedition.lcdui.Canvas, but differs in two ways: graphics buffering and the ability to query key states. These features of the GameCanvas class offer you enhanced control to deal with events like keystrokes and screen repainting.As I mentioned earlier, you'll get smoother animation if you create graphics objects behind the scenes, in a buffer, then update and repaint the screen simply by invoking paint(getGraphics()) and flushGraphics(). If your graphics are simple, you may not notice much difference if you call repaint() and serviceRepaints() instead, but in games with complex graphics, using the GameCanvas methods will make an appreciable difference.The GameCanvas class makes game programming much easier. You can extend the Canvas class directly to develop your game if you want, but if you do you'll need to implement the Canvas.keyPressed() method, which is called whenever the user presses a button. Errors can arise if the call occurs when multiple threads are doing different things and the code is not properly synchronized. By contrast, if you use GameCanvas you can get the keystroke information whenever you want it, from the getKeyStates() method –and in a more useful form: The keyCode passed to Canvas.keyPressed() gives you information about only a single key, but GameCanvas.getKeyStates() tells you when multiple keys are being pressed simultaneously.The GameCanvas class simplifies game programming in another way. Instead of spreading the logic across multiple methods running on separate threads, as Canvas does, GameCanvas lets you combine all the game functionality in a single loop, under the control of a single thread. Code Sample encloses the game's logic in a single loop: Code Sample : GameCanvas-Based Game Skeletonpublic class MyCanvas extends GameCanvas implements Runnable {public void run() {Graphics g = getGraphics();while(true) {// update the game state// ...int k = getKeyStates();// respond to key eventsflushGraphics();}}}TextBox ClassThe TextBox class is very similar to a TextField class, discussed previously in this chapter.Both are used to receive multiple lines of textual data from a user. You can request that a maximum number of characters be allowed in instances of both the TextBox class and the TextField class. However, the device determines the actual size of both of these instances. Characters that exceed the display area of the screen become scrollable in many devices.The TextBox class and TextField class differ in that the TextBox class is derived from the Screen class, while the TextField class is derived from the Item class. This means that an instance of the Form class cannot contain an instance of the TextBox class, while an instance of a TextField class must be contained within an instance of the Form class.Another important difference between the TextBox class and the TextField class is that the TextBox class uses a CommandListener and cannot use an ItemStateListener. An ItemStateListener is used with an instance of the TextField class, although many times the content of an instance of the TextField class is retrieved and processed when the user selects a command associated with a form that contains the text field.An instance of the TextBox class is created by passing four parameters to the TextBox class constructor. The first parameter is the title of the text box. The second parameter is text used to populate the instance. The third parameter is the maximum number of characters that can be entered into the instance. Keep in mind that this parameter is a request and may not be fulfilled by the device. The device determines the maximum number of characters for an instance of the TextBox class. The last parameter is the constraint used to limit the types of characters that can be placed within the instance.The TextBox class has the same methods as found in the TextField class. Refer tothe “TextField Class” section of this chapter for details on how to use these methods. You’ll also find Te xtBox class methods in the “Quick Reference Guide” section at the end of this chapter.The CanvasAs you’ll recall, each MIDlet has one instance of the Display class, and the Display class has one derived class called the Displayable class. Everything a MIDlet displays on the screen is created by an instance of a class that is derived from the Displayable class. The Display class hierarchy is shown here:public class Displaypublic abstract class Displayablepublic abstract class Screen extends Displayablepublic abstract class Canvas extends Displayablepublic class GraphicsThe Displayable class has two subclasses: Screen and Canvas. The Screen class and its derivatives are used to create high-level components that you learned about in the previous chapter. The Canvas class and its derivatives are used to gain low-level access to the display, which is necessary for graphic- and animation-based applications. Agraphic is used with a canvas.You can think of an instance of the Canvas class as an artist’s can vas on which you draw images that might include text. An instance of the Graphics class is similar to the artist’s tools that are used to draw an image. For example, color, lines, and arcs are some of the graphic tools available to create an image on the canvas. The Canvas class and the Graphics class give you pixel control over everything that appears on the canvas. This low-level control is particularly noticeable whenever text is placed on the canvas because you control every aspect of how characters are formed to display the text.Let’s step back to recall how you display text using the high-level user interface. First, you create an instance of a text field, text box, or string item and then associate text with the instance. Next, the setCurrent() is called and passed the instance (or a container such as a form that contains the instance). You don’t need to be concerned about describing how the device’s application manager is to form each character of the text onthe screen.However, displaying text using the Graphics class requires you to specify the height, width, and other characteristics that describe how each character of the text is to be drawn on the screen. Your application is actually drawing each character as compared to simply specifying the te xt that you want displayed. You’ll learn how to draw characters later in this chapter.A Canvas is created by instantiating a concrete subclass, which is discussed later in this chapter.The Layout of a CanvasThe canvas is divided into a virtual grid in which each cell represents one pixel. Coordinates mark the column and row of a cell within the grid. The x coordinate represents the column, and the y coordinate represents the cell’s row. The first cell located in the upper-left corner of the grid has the coordinate location of 0, 0, where the first zero is the x coordinate and the other zero is the y coordinate.As you probably imagine, the size of the canvas is device dependent since canvas size and the screen size are the same. The screen size of a mobile telephone might be different from the screen size of a PDA, and yet both devices are capable of running the same MIDlet. Your MIDlet should determine the canvas size of the device that implements your graphic application before drawing on the screen. The canvas size is measured in pixels. Your MIDlet should determine the canvas size of the deviceThe paint() and repaint() MethodsYou don’t call the paint() method directly. Instead, the paint() method is called automatically by the setCurrent() method when the MIDlet is started. You call the repaint() whenever the canvas or a portion of the canvas must be refreshed.Let’s say that you want to draw text on a canvas that is already displayed on the screen. First, you create the text using a graphic, whic h you’ll learn how to do later inthis chapter. Next, you call the repaint() method to have the entire canvas redrawn, which includes text and images that currently exist on the screen and the new text, unless you’veremoved existing text or images.There are two versions of the repaint() method. One version requires no parameters and repaints the entire canvas. The other version requires four parameters that definethe region of the canvas that is to be repainted. The first two parameters are the x andy coordinates for the upper-left corner of the region, and the last two parameters arethe width and height of the region.You specify a region of the canvas to repaint whenever only a portion of the canvas has changed and when you don’t want to waste time re painting the entire canvas, such as when an animated image is displayed on the screen.This is known as clipping. Animation is the illusion of movement caused by rapidly changing images on the screen, where each image is slightly different from the previous image. Each image displayed on the screen is referred to as a frame. A key to successful animation is speed. You must change frames in such a way that users don’t notice the change. Typically, a small portion of a frame changes in an animated image. The repaint() method is capable of repainting only the portion of the frame that changed rather than the entire frame, which dramatically reduces the time that is necessary to change a frame on the screen.The serviceRepaints() method is another painting met hod that you’ll use when developing a low-level user interface for your application. Apaint request is one of many requests a MIDlet can make to the application manager of a small computing device. Other requests can be made to store data or to communicate with a remote computer. Sometimes outstanding requests can be given a higher process priority by the device’s application manager than a paint request. However, you’ll need to override outstanding requests to have the canvas repainted whenever an image is being animated; otherwise, a delay in repainting the canvas destroys the effect of animation.The serviceRepaints() method directs the device’s application manager to override outstanding requests for service with the repaint request. The repaint request becomes the next request to be processed by the application manager.showNotify() and hideNotify()The device’s application manager calls the showNotify() method immediately before theapplication manager displays the canvas. You define the showNotify() method with statements that prepare the canvas for display, such as initializing resources by beginning threads or assigning values to variables as required by your application.The hideNotify() method is called by the application manager after the canvas is removed from the screen. You define the hideNotify() method with statements that free resources that were allocated when the showNotify() method was called. This includes deactivating threads and resetting values assigned to variables as necessary.GraphicsAs you recall from earlier in this chapter, the screen of the low-level user interface is a canvas, which is an instance of the Canvas class. The canvas is organized into a grid in which each cell of the grid is a pixel. Coordinates, as explained in the previous sections, identify each cell. An image is drawn on the canvas by using a virtual graphical device called a graphic context, such as the rectangle and line. A graphic context is an instance of the Graphics class. You’ll learn about these virtu al graphical devices in this section.Reference to the graphic context is passed to the paint() method. A mutable image, as you’ll remember, is an image that can be altered by your MIDlet. You’ve seen how to create a graphic context in previous listings that defined the paint() method. Reference to the graphic context passed to a paint() method exists for the duration of the paint() method. Once the MIDlet leaves the paint() method, the graphic context goes out of scope.The graphic context can no longer be used to draw on the canvas, even if reference to the graphic context is retained. In contrast, a graphic context created in association with a mutable image remains available to the MIDlet as long as reference to the image and the image itself remains in s cope. You’ll learn how to create a graphic context using a mutable image later in this chapter.。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

xxxx大学高新学院毕业设计(论文)外文翻译学生姓名:院(系):专业班级:指导教师:完成日期:JSP基础学习资料一、JSP 技术概述在Sun 正式发布JSP(JavaServer Pages) 之后,这种新的Web 应用开发技术很快引起了人们的关注。

JSP 为创建高度动态的Web 应用提供了一个独特的开发环境。

按照Sun 的说法,JSP 能够适应市场上包括Apache WebServer 、IIS4.0 在内的85% 的服务器产品。

即使您对ASP “一往情深”,我们认为,关注JSP 的发展仍旧很有必要。

㈠JSP 与ASP 的简单比较JSP 与Microsoft 的ASP 技术非常相似。

两者都提供在HTML 代码中混合某种程序代码、由语言引擎解释执行程序代码的能力。

在ASP 或JSP 环境下,HTML 代码主要负责描述信息的显示样式,而程序代码则用来描述处理逻辑。

普通的HTML 页面只依赖于Web 服务器,而ASP 和JSP 页面需要附加的语言引擎分析和执行程序代码。

程序代码的执行结果被重新嵌入到HTML 代码中,然后一起发送给浏览器。

ASP 和JSP 都是面向Web 服务器的技术,客户端浏览器不需要任何附加的软件支持。

ASP 的编程语言是VBScript 之类的脚本语言,JSP 使用的是Java ,这是两者最明显的区别。

此外,ASP 与JSP 还有一个更为本质的区别:两种语言引擎用完全不同的方式处理页面中嵌入的程序代码。

在ASP 下,VBScript 代码被ASP 引擎解释执行;在JSP 下,代码被编译成Servlet 并由Java 虚拟机执行,这种编译操作仅在对JSP 页面的第一次请求时发生。

㈡运行环境Sun 公司的JSP 主页在/products/jsp/index.html ,从这里还可以下载JSP 规范,这些规范定义了供应商在创建JSP 引擎时所必须遵从的一些规则。

执行JSP 代码需要在服务器上安装JSP 引擎。

此处我们使用的是Sun 的JavaServer Web Development Kit (JSWDK )。

为便于学习,这个软件包提供了大量可供修改的示例。

安装JSWDK 之后,只需执行startserver 命令即可启动服务器。

在默认配置下服务器在端口8080 监听,使用http://localhost:8080 即可打开缺省页面。

在运行JSP 示例页面之前,请注意一下安装JSWDK 的目录,特别是“ work ”子目录下的内容。

执行示例页面时,可以在这里看到JSP 页面如何被转换成Java 源文件,然后又被编译成class 文件(即Servlet )。

JSWDK 软件包中的示例页面分为两类,它们或者是JSP 文件,或者是包含一个表单的HTML 文件,这些表单均由JSP 代码处理。

与ASP 一样,JSP 中的Java 代码均在服务器端执行。

因此,在浏览器中使用“查看源文件”菜单是无法看到JSP 源代码的,只能看到结果HTML 代码。

所有示例的源代码均通过一个单独的“ examples ”页面提供。

㈢JSP 页面示例下面我们分析一个简单的JSP 页面。

您可以在JSWDK 的examples 目录下创建另外一个目录存放此文件,文件名字可以任意,但扩展名必须为.jsp 。

从下面的代码清单中可以看到,JSP 页面除了比普通HTML 页面多一些Java 代码外,两者具有基本相同的结构。

Java 代码是通过< % 和%> 符号加入到HTML 代码中间的,它的主要功能是生成并显示一个从0 到9 的字符串。

在这个字符串的前面和后面都是一些通过HTML 代码输出的文本。

< HTML>< HEAD>< TITLE>JSP 页面< /TITLE>< /HEAD>< BODY>< %@ page language="java" %>< %! String str="0"; %>< % for (int i=1; i < 10; i++) {str = str + i;} %>JSP 输出之前。

< P>< %= str %>< P>JSP 输出之后。

< /BODY>< /HTML>这个JSP 页面可以分成几个部分来分析。

首先是JSP 指令。

它描述的是页面的基本信息,如所使用的语言、是否维持会话状态、是否使用缓冲等。

JSP 指令由< %@ 开始,%> 结束。

在本例中,指令“ < %@ page language="java" %> ”只简单地定义了本例使用的是Java 语言(当前,在JSP 规范中Java 是唯一被支持的语言)。

接下来的是JSP 声明。

JSP 声明可以看成是定义类这一层次的变量和方法的地方。

JSP 声明由< %! 开始,%> 结束。

如本例中的“ < %! String str="0"; %> ”定义了一个字符串变量。

在每一项声明的后面都必须有一个分号,就象在普通Java 类中声明成员变量一样。

位于< % 和%> 之间的代码块是描述JSP 页面处理逻辑的Java 代码,如本例中的for 循环所示。

最后,位于< %= 和%> 之间的代码称为JSP 表达式,如本例中的“ < %= str %> ”所示。

JSP 表达式提供了一种将JSP 生成的数值嵌入HTML 页面的简单方法。

二、会话状态管理会话状态维持是Web 应用开发者必须面对的问题。

有多种方法可以用来解决这个问题,如使用Cookies 、隐藏的表单输入域,或直接将状态信息附加到URL 中。

Java Servlet 提供了一个在多个请求之间持续有效的会话对象,该对象允许用户存储和提取会话状态信息。

JSP 也同样支持Servlet 中的这个概念。

在Sun 的JSP 指南中可以看到许多有关隐含对象的说明(隐含的含义是,这些对象可以直接引用,不需要显式地声明,也不需要专门的代码创建其实例)。

例如request 对象,它是HttpServletRequest 的一个子类。

该对象包含了所有有关当前浏览器请求的信息,包括Cookies ,HTML 表单变量等等。

session 对象也是这样一个隐含对象。

这个对象在第一个JSP 页面被装载时自动创建,并被关联到request 对象上。

与ASP 中的会话对象相似,JSP 中的session 对象对于那些希望通过多个页面完成一个事务的应用是非常有用的。

为说明session 对象的具体应用,接下来我们用三个页面模拟一个多页面的Web 应用。

第一个页面(q1.html )仅包含一个要求输入用户名字的HTML 表单,代码如下:< HTML>< BODY>< FORM METHOD=POST ACTION="q2.jsp">请输入您的姓名:< INPUT TYPE=TEXT NAME="thename">< INPUT TYPE=SUBMIT V ALUE="SUBMIT">< /FORM>< /BODY>< /HTML>第二个页面是一个JSP 页面(q2.jsp ),它通过request 对象提取q1.html 表单中的thename 值,将它存储为name 变量,然后将这个name 值保存到session 对象中。

session 对象是一个名字/ 值对的集合,在这里,名字/ 值对中的名字为“ thename ”,值即为name 变量的值。

由于session 对象在会话期间是一直有效的,因此这里保存的变量对后继的页面也有效。

q2.jsp 的另外一个任务是询问第二个问题。

下面是它的代码:< HTML>< BODY>< %@ page language="java" %>< %! String name=""; %>< %name = request.getParameter("thename");session.putValue("thename", name);%>您的姓名是:< %= name %>< p>< FORM METHOD=POST ACTION="q3.jsp">您喜欢吃什么?< INPUT TYPE=TEXT NAME="food">< P>< INPUT TYPE=SUBMIT V ALUE="SUBMIT">< /FORM>< /BODY>< /HTML>第三个页面也是一个JSP 页面(q3.jsp ),主要任务是显示问答结果。

它从session 对象提取thename 的值并显示它,以此证明虽然该值在第一个页面输入,但通过session 对象得以保留。

q3.jsp 的另外一个任务是提取在第二个页面中的用户输入并显示它:< HTML>< BODY>< %@ page language="java" %>< %! String food=""; %>< %food = request.getParameter("food");String name = (String) session.getValue("thename");%>您的姓名是:< %= name %>< P>您喜欢吃:< %= food %>< /BODY>< /HTML>三、引用JavaBean 组件JavaBean 是一种基于Java 的软件组件。

JSP 对于在Web 应用中集成JavaBean 组件提供了完善的支持。

这种支持不仅能缩短开发时间(可以直接利用经测试和可信任的已有组件,避免了重复开发),也为JSP 应用带来了更多的可伸缩性。

JavaBean 组件可以用来执行复杂的计算任务,或负责与数据库的交互以及数据提取等。

相关文档
最新文档