【正文】
錄也在不斷的被打破并提高。Java的設計者們不想讓Java有多重繼承的特性,因為C++的多重繼承顯示了這種特性的困難。應用程序開發(fā)接口在Java語言中,應用程序接口(API)化身成類,并且分組成為包。對于不同的平臺,Java提供了不同版本的包。任何公司和個人都可以參與這個工程,對API進行設計。JSP技術簡介JSP(JavaServer Pages)是由Sun Microsystems公司倡導、許多公司參與一起建立的一種動態(tài)網頁技術標準。用JSP開發(fā)的Web應用是跨平臺的,即能在Linux下運行,也能在其他操作系統上運行。網頁還能通過tags和scriptlets訪問存在于服務端的資源的應用邏輯。Web服務器在遇到訪問JSP網頁的請求時,首先執(zhí)行其中的程序段,然后將執(zhí)行結果連同JSP文件中的HTML代碼一起返回給客戶。JSP與Java Servlet一樣,是在服務器端執(zhí)行的,通常返回該客戶端的就是一個HTML文本,因此客戶端只要有瀏覽器就能瀏覽。JSP頁面由HTML代碼和嵌入其中的Java代碼所組成。Java Servlet 是JSP的技術基礎,而且大型的Web應用程序的開發(fā)需要Java Servlet和JSP配合才能完成。 Spring Spring Framework 是一個開源的Java/Java EE全功能棧(fullstack)的應用程序框架,以Apache許可證形式發(fā)布。Spring Framework 提供了一個簡易的開發(fā)方式,這種開發(fā)方式,將避免那些可能致使底層代碼變得繁雜混亂的大量的屬性文件和幫助類。一個可用于從 applet 到 Java EE 等不同運行環(huán)境的核心 Bean 工廠。內建的針對 JTA 和 單個 JDBC 數據源的一般化策略,使 Spring 的事務支持不要求 Java EE 環(huán)境,這與一般的 JTA 或者 EJB CMT 相反。再次利用JDBC時,你無需再寫出另一個 39。 (finally) 模塊。以資源容器,DAO 實現和事務策略等形式與 Hibernate,JDO 和 iBATIS SQL Maps 集成。所有這些全部遵從Spring通用事務處理和通用數據訪問對象異常等級規(guī)范。開發(fā)者通過策略接口將擁有對該框架的高度控制,因而該框架將適應于多種呈現(View)技術,例如 JSP,FreeMarker,Velocity,Tiles,iText 以及 POI。在設計應用程序Model時,MVC 模式(例如Struts)通常難于給出一個簡潔明了的框架結構。程序開發(fā)員們可以使用Spring的 JDBC 抽象層重新設計那些復雜的框架結構。它最初是Jakarta項目中的一個子項目,并在2004年3月成為ASF的頂級項目。MVC結構在Struts中,已經由一個名為ActionServlet的Servlet充當 控制器(Controller)的角色,根據描述模型、視圖、轉發(fā)視圖(View)的請求,組裝響應數據模型(Model)。在這里,Struts可以與各種標準的數據訪問技術結合在一起,包括Enterprise Java Beans(EJB), JDBC與JNDI。通過應用Struts的框架,最終用戶可以把大部分的關注點放在自己的業(yè)務邏輯(Action)與 映射關系的配置文件()中。因為這兩種方式不可避免的要把表現與業(yè)務邏輯代碼混合在一起,都給前期開發(fā)與后期維護帶來巨大的復雜度。后來該框架產品一度被認為是最廣泛、最流行JAVA的WEB應用框架。至此,Struts項目并行提供與維護兩個主要版本的框架產品——Struts 1與Struts 2。 附帶的一點點建議: Struts的優(yōu)點主要集中體現在兩個方面:Taglib和頁面導航。 Struts這個名字來源于在建筑和舊式飛機中使用的支持金屬架。你仍然需要學習和應用該架構,不過它將可以完成其中一些繁重的工作。Hibernate開源框架介紹Hibernate是一種Java語言下的對象關系映射解決方案。它為面向對象的領域模型到傳統的關系型數據庫的映射,提供了一個使用方便的框架。無論是從設計草案還是從一個遺留數據庫開始,開發(fā)人員都可以采用Hibernate。.NET 上的 HibernateHibernate 有個在 .NET Framework 上的實現版本,稱為 NHibernate,在 Entity Framework 發(fā)表之前,NHibernate 是在 .NET Framework 上經常被使用的 ORM 實現。數據庫連接是與數據庫進行交互,因為它需要大量資源的開放和關閉數據庫連接的最昂貴的部分。3對象關系映射:對象關系映射是從對象映射模型的數據表示為關系數據模型的技術。()的方法時,Hibernate讀取該對象的變量的狀態(tài),并執(zhí)行必要的查詢。所以通常冬眠與其他正在使用的連接管理和事務管理工具。Hibernate提供了使用中的靈活性。而在“全面解決”的體系結構的所有三個組件對象關系映射,連接管理和事務管理)的使用。s office。 the primary distinction involves the JRE39。s core code available under free software/opensource distribution terms, aside from a small portion of code to which Sun did not hold the 39。s ideal role with regards to Java is as an evangelist.Following Oracle Corporation39。s trademark license for usage of the Java brand insists that all implementations be patible. This resulted in a legal dispute with Microsoft after Sun claimed that the Microsoft implementation did not support RMI or JNI and had added platformspecific features of their own. Sun sued in 1997, and in 2001 won a settlement of US$20 million, as well as a court order enforcing the terms of the license from Sun. As a result, Microsoft no longer ships Java with Windows, and in recent versions of Windows, Internet Explorer cannot support Java applets without a thirdparty plugin. Sun, and others, have made available free Java runtime systems for those and other versions of Java is essential to the Java EE strategy, and an even more rigorous validation is required to certify an implementation. This environment enables portable serverside applications, such as Web services, Java Servlets, and Enterprise JavaBeans, as well as with embedded systems based on OSGi, using Embedded Java environments. Through the new GlassFish project, Sun is working to create a fully functional, unified open source implementation of the Java EE also distributes a superset of the JRE called the Java Development Kit (monly known as the JDK), which includes development tools such as the Java piler, Javadoc, Jar, and debugger.Java performance and garbage collectorsPrograms written in Java have a reputation for being slower and requiring more memory than those written in C. However, Java programs39。s JVM in 2000. Currently, Java code has approximately half the performance of C code.Some platforms offer direct hardware support for Java。s code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a null pointer exception is thrown.One of the ideas behind Java39。 this can cause a program to stall momentarily. Explicit memory management is not possible in Java.Java does not support C/C++ style pointer arithmetic, where object addresses and unsigned integers (usually long integers) can be used interchangeably. This allows the garbage collector to relocate referenced objects and ensures type safety and security.As in C++ and some other objectoriented languages, variables of Java39。s designers for performance reasons. Because of this, Java was not considered to be a pure objectoriented programming language. However, as of Java , autoboxing enables programmers to proceed as if primitive types were instances of their wrapper class. Java contains multiple types of garbage collectors. By default, HotSpot uses the Concurrent Mark Sweep collector, also known as the CMS Garbage Collector. However, there are also several other garbage collectors that can be used to manage the Heap. For 90% of applications in Java, the CMS Garbage Collector is good enough.A class that is not declared public may be stored in any .java file. The piler will generate a class file for each class defined in the source file. The name of the class file is the name of the class, with .class appended. For class file generation, anonymous classes are treated as if their name were the concatenation of the name of their enclosing class, a $, and an integer. The keyword public denotes that a method can be called from code in other classes, or that a class may be used by classes outside the class hierarchy. The class hierarchy is related to the name of the directory in which the .java file is located.The keyword static in front of a method indicates a sta