【正文】
major benefit of using bytecode is porting. However, the overhead of interpretation means that interpreted programs almost always run more slowly than programs piled to native executables would. JustinTime pilers were introduced from an early stage that pile bytecodes to machine code during Microsystems officially licenses the Java Standard Edition platform for Linux, Mac OS X, and Solaris. Although in the past Sun has licensed Java to Microsoft, the license has expired and has not been renewed. Through a network of thirdparty vendors and licensees, alternative Java environments are available for these and other platforms.Sun39。 there are microcontrollers that can run java in hardware instead of a software JVM, and ARM based processors can have hardware support for executing Java bytecode through its Jazelle option.Automatic memory managementJava uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable memory bees eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer39。s primitive data types are not objects. Values of primitive types are either stored directly in fields (for objects) or on the stack (for methods) rather than on the heap, as monly true for objects (but see Escape analysis). This was a conscious decision by Java39。s automatic memory management model is that programmers can be spared the burden of having to perform manual memory management. In some languages, memory for the creation of objects is implicitly allocated on the stack, or explicitly allocated and deallocated from the heap. In the latter case the responsibility of managing memory resides with the programmer. If the program does not deallocate an object, a memory leak occurs. If the program attempts to access or deallocate memory that has already been deallocated, the result is undefined and difficult to predict, and the program is likely to bee unstable and/or crash. This can be partially remedied by the use of smart pointers, but these add overhead and plexity. Note that garbage collection does not prevent logical memory leaks, . those where the memory is still referenced but never used.Garbage collection may happen at any time. Ideally, it will occur when a program is idle. It is guaranteed to be triggered if there is insufficient free memory on the heap to allocate a new object。 execution speed improved significantly with the introduction of Justintime pilation in 1997/1998 for Java , the addition of language features supporting better code analysis (such as inner classes, StringBuffer class, optional assertions, etc.), and optimizations in the Java Virtual Machine itself, such as HotSpot being the default for Sun39。s vicepresident Rich Green has said that Sun39。 it went by the name Green later, and was later renamed Java, from a list of random aimed to implement a virtual machine and a language that had a familiar C/C++ style of notation.Sun Microsystems released the first public implementation as Java in 1995. It promised Write Once, Run Anywhere (WORA), providing nocost runtimes on popular platforms. Fairly secure and featuring configurable security, it allowed network and fileaccess restrictions. Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular. With the advent of Java 2 (released initially as J2SE in December 1998–1999), new versions had multiple configurations built for different types of platforms. For example, J2EE targeted enterprise applications and the greatly strippeddown version J2ME for mobile applications (Mobile Java). J2SE designated the Standard Edition. In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively.In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process. Java remains a de facto standard, controlled through the Java Community Process. At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status. Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise System. Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) (a subset of the SDK)。它被稱為“輕型”的體系結(jié)構(gòu)時(shí),我們只使用對(duì)象關(guān)系映射的組成部分。 Hibernate是很好的工具盡可能對(duì)象關(guān)系映射的關(guān)注,但在連接管理和事務(wù)管理方面,它在性能和能力缺乏。 2交易管理:事務(wù)管理服務(wù)提供給用戶能夠同時(shí)執(zhí)行多個(gè)數(shù)據(jù)庫報(bào)表。Hibernate不僅負(fù)責(zé)從Java類到數(shù)據(jù)庫表的映射(還包括從Java數(shù)據(jù)類型到SQL數(shù)據(jù)類型的映射),還提供了面向?qū)ο蟮臄?shù)據(jù)查詢檢索機(jī)制,從而極大地縮短的手動(dòng)處理SQL和JDBC上的開發(fā)時(shí)間。 它是使用GNU寬通用公共許可證發(fā)行的自由、開源的軟件。它的目的是為了減少在運(yùn)用MVC設(shè)計(jì)模型來開發(fā)Web應(yīng)用的時(shí)間。很多開發(fā)人員認(rèn)為Struts目前尚不成熟,應(yīng)用的成本較高。為了擺脫上述的約束與局限,把業(yè)務(wù)邏輯代碼從表現(xiàn)層中清晰的分離出來,2000年,Craig McClanahan采用了MVC的設(shè)計(jì)模式開發(fā)Struts。在Struts的視圖(View)端,除了使用標(biāo)準(zhǔn)的JavaServer Pages(JSP)以外,還提供了大量的標(biāo)簽庫使用,同時(shí)也可以與其他表現(xiàn)層組件技術(shù)(產(chǎn)品)進(jìn)行整合,比如Velocity Templates,XSLT等。它通過采用Java Servlet/JSP技術(shù),實(shí)現(xiàn)了基于Java EE Web應(yīng)用的ModelViewController〔MVC〕設(shè)計(jì)模式的應(yīng)用框架〔Web Framework〕,是MVC經(jīng)典設(shè)計(jì)模式中的一個(gè)經(jīng)典產(chǎn)品。Spring卻具有能夠讓這部分工作變得簡單的能力。靈活的基于核心 Spring 功能的 MVC 網(wǎng)頁應(yīng)用程序框架。并且面向JDBC的異常與Spring 通用數(shù)據(jù)訪問對(duì)象(Data Access Object)異常等級(jí)相一致。JDBC 抽象層提供了有針對(duì)性的異常等級(jí)(不再從SQL異常中提取原始代碼),簡化了錯(cuò)誤處理,大大減少了程序員的編碼量。Spring 中包含的關(guān)鍵特性:強(qiáng)大的基于 JavaBeans 的采用控制翻轉(zhuǎn)(Inversion of Control,IoC)原則的配置管理,使得應(yīng)用程序的組建更加快捷簡易。JSP具備了Java技術(shù)的簡單易用,完全的面向?qū)ο?,具有平臺(tái)無關(guān)性且安全可靠,主要面向因特網(wǎng)的所有特點(diǎn)。插入的Java程序段可以操作數(shù)據(jù)庫、重新定向網(wǎng)頁等,以實(shí)現(xiàn)建立動(dòng)態(tài)網(wǎng)頁所需要的功能。JSP技術(shù)使用Java編程語言編寫類XML的tags和scriptlets,來封裝產(chǎn)生動(dòng)態(tài)網(wǎng)頁的處理邏輯。2004年,IBM和BEA公司準(zhǔn)備聯(lián)合對(duì)官方的Java開源軟件工程進(jìn)行支持,但是2005年初,sun公司拒絕了這個(gè)支持。每個(gè)包中包含有相關(guān)的接口和類。IBM有一篇有關(guān)Java存儲(chǔ)器回收機(jī)制比不激活垃圾收集機(jī)制的C++存儲(chǔ)器處理快數(shù)倍的技術(shù)文章,而著名的Java技術(shù)書籍《Java編程思想》(Thinking in Java)也有一段論述Java存儲(chǔ)器及性能達(dá)到甚至超過C++的章節(jié)。}在循環(huán)開始之前,字符串str已經(jīng)不會(huì)再用到了,但未將這個(gè)參考指向null,因此字符串str無法被gc所回收。注意程序員不需要修改finalize方法,自動(dòng)垃圾收集也會(huì)發(fā)生作用。除此之外,由于智能指針是一個(gè)基于模板的功能,所以沒有經(jīng)驗(yàn)的程序員在需要使用多態(tài)特性進(jìn)行自動(dòng)清理時(shí)也可能束手無策。因此如果同一存儲(chǔ)