版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、<p> 此文檔是畢業(yè)設(shè)計(jì)外文翻譯成品( 含英文原文+中文翻譯),無需調(diào)整復(fù)雜的格式!下載之后直接可用,方便快捷!本文價(jià)格不貴,也就幾十塊錢!一輩子也就一次的事!</p><p> 外文標(biāo)題:Introducing Java Web Development</p><p> 外文作者:Vishal Layka</p><p> 文獻(xiàn)出處:Learn
2、 Java for Web Development. pp 1-41</p><p> 英文4377單詞,中文5859漢字。</p><p> Introducing Java Web Development</p><p> The mind, once stretched by a new idea, never returns to its origin
3、al dimensions. </p><p> —Ralph Waldo Emerson</p><p> An intelligent machine is that which extends the very imagination with which it was built. An example of this is the instruction called i n
4、voke Dynami , which was introduced with Java 7 to optimize the performance of dynamically typed languages on the Java Virtual Machine (JVM). The JVM, originally intended for Java, can now host a myriad of programming lan
5、guages, including Groovy2 and Scala.3 This has led to a renaissance of Java web development. This new paradigm of cross-pollination and diver</p><p> The open source community has capitalized on the multipa
6、radigm capabilities offered by the languages that run on the JVM, by means of web frameworks, to dramatically enhance the productivity in web development. Java EE4 advanced this momentum, pioneered by Java frameworks suc
7、h as Spring,5 by standardizing and improving the API and run time environment. Further, functional programming constructs, in the form of lambdas, have been added to Java 8. As a result, Java is on the rebound to become
8、an ü</p><p> This chapter sets the stage for the book by introducing the three key players that join forces in building modern Java web applications: the JVM languages, Java EE, and the Java web framew
9、orks.</p><p> Note :The JVM languages represent a new category of languages that run on the JVM.With the latest version, Java8, Java is no longer a Privileged JVM language and is now simply one of the many
10、languages that run on the JVM.</p><p> The chapter begins by introducing the JVM languages and then introduces Java EE. The Java EE platform is the set of API specifications that act as the building blocks
11、for developing web applications. The chapter then highlights the Java web frameworks, which will be the subject of the book from Chapter 4 onward.</p><p> JVM Languages</p><p> The JVM is the
12、run time environment that provides you with the ability to use different programming languages for building web applications. The JVM languages can be largely classified into two types: languages that are designed for th
13、e JVM and existing languages that are ported to JVM.</p><p> Languages Designed for the JVM</p><p> Plenty of languages are specifically designed for the JVM; Table 1-1 describes a few of them
14、. All but Clojure are discussed in this book.</p><p> Dynamic typing: Dynamic typing keeps track of information about what sort of values the variables contain by carrying the type information on the values
15、 held in variables.</p><p> Static typing: In static typing, the type information is all about the variables, not the values in them.</p><p> Imperative languages: These are languages in which
16、 the state can be mutated by the instructions in the language.</p><p> Functional languages: In functional languages, the functions operate on values as in procedural languages, but instead of mutating the
17、state, the functions are purely mathematical functions that return new values.</p><p><b> Java EE</b></p><p> Java began life as a programming language designed for building stand-
18、alone applications and grew rapidly into other spheres. A large part of Java’s popularity can be attributed to its usage in creating web applications. A web application consists of static and dynamic (interactive) web pa
19、ges. Static web pages contain various types of markup languages (HTML, XHTML, and so on) and are used, in general, to provide information; dynamic web pages, on the other hand, are capable of generating content</p>
20、<p> The Java EE platform: This is the set of API specifications that are the building blocks of the web application. </p><p> The web container: The web container implements the API specifications
21、of the Java EE platform. Specifically, the web container provides the services for managing and executing web components such as servlets, JSPs, filters,listeners, and render responses to the client. The web containers a
22、re covered in Chapter 2.</p><p> Web components: These are hosted by the container. These web components, such as servlets, JSPs, filters, and listeners, are covered in Chapter 2.</p><p> The
23、Java EEPlatform</p><p> The Java EE platform is driven by the following two goals:</p><p> Providing the API specifications that are the building blocks of the web application.</p><
24、p> Standardizing and reducing the complexity of enterprise application development. It does this by providing an application model that defines an architecture for implementing services as multitiered applications.&l
25、t;/p><p> The Java EE platform is aimed at standardizing and reducing the complexity of enterprise application development by providing an application model that defines an architecture for implementing servic
26、es as multitiered applications. In a multitiered application, the functionality of the application is separated into distinct functional areas, called tiers. Figure 1-3 illustrates the typical multitiered</p><
27、p> architecture in a Java EE application model.</p><p> The Client Tier</p><p> The client tier is the top tier in a multitiered Java EE architecture; it consists of application clients th
28、at make requests to the Java EE server, which is often located on a different machine. The server processes the requests and returns a response to the client. An example of a client is a web browser or a stand-alone appl
29、ication.</p><p> The Web Tier</p><p> The web tier consists of components that handle the interaction between clients and the business tier. After receiving a request from the client, the web
30、tier does the following:</p><p> 1.Collects input from the client</p><p> 2.Controls the flow of screens or pages on the client</p><p> 3.Maintains the state of data for a user’s
31、 session</p><p> 4.Obtains results from the components in the business tier</p><p> 5.Generates dynamic content in various formats to the client</p><p> The multitier architectur
32、e of Java EE has a tremendous impact on the development of Java enterprise applications. A Java enterprise application can be defined as a Java application that utilizes the enterprise services offered by Java EE. In fac
33、t, a web application can be classified as an enterprise application if it utilizes Java EE services in the form of components packed in the web tier. Java EE isolates these services functionally into separate tiers, as i
34、llustrated in Figure 1-3, by provid</p><p> Each layer in Figure 1-4 is an area of concern, for the application. For instance, the web layer deals only with employing the web tier components of Java EE. Hav
35、ing different layers in an application results in what is called a separation of concerns. In terms of implementation, this separation of concerns is achieved using coarse-grained interfaces.</p><p> The co
36、ncern is the feature, functionality or business functions with which the application’s developer needs to be concerned. Crosscutting such concerns is inherent in complex systems and leads to code scattering, which is whe
37、n code for one concern spans many modules, and code tangling, which is when code in one module concentrates on addressing multiple concerns. Code scattering and code tangling lead to a lack of clarity, redundancy, rigidi
38、ty, and continuous refactoring. Figure 1-5 illustrates</p><p> Figure1-5. Book Service involved with system services</p><p> Book Service in Figure 1-5 is too involved with the system services
39、. Each object knows and is responsible for logging, security, and transaction. A method, for example, to purchase a book in Book Service should be concerned only with how to purchase the book and not with whether it is s
40、ecure or transactional. Separation of concerns, one of the main goals of software engineering, lets you handle each service on its own and thereby does the following:</p><p> Promotes traceability within an
41、d across the artifacts in the system, throughout the life cycle of the system</p><p> Controls the impact caused by the change, thereby providing scope for evolution and noninvasive adaptation</p>&l
42、t;p> Promotes development of cohesive units, thereby facilitating reuse</p><p><b> Web Layer</b></p><p> The web layer of a web application consists of the web tier components
43、of Java EE such as servlets and JSP. The web layer can access the service layer, but there should not be a tight coupling between the web layer and the service layer. That is, changing the service layer should not impact
44、 the web layer.</p><p> Service Layer</p><p> The service layer consists of the business tier components of Java EE such as Enterprise JavaBeans (EJBs). The service layer can access the data a
45、ccess layer, but there should be no tight coupling between the service layer and the data access layer. In fact, the service layer should not know anything about the web or data access layer. The service layer provides a
46、 coarse-grained interface for the web layer.</p><p> Data Access Layer</p><p> The data access layer consists of the data tier components of Java EE such as JDBC and JPA. This layer should not
47、 contain any business logic. This layer abstracts the actual persistence mechanism (in other words, JDBC or JPA) from the service layer by providing the coarse-grained interface to the service layer.</p><p>
48、 In this chapter, you will build the data access layer of the bookstore application and query it via a stand-alone Java application. In Chapter 2, you will replace this stand-alone Java application with a web layer usin
49、g the web tier components of Java EE (specifically, servlets and JSPs). You will use this data access layer throughout this book, and from Chapter 4 onward you will build a web application repeatedly by rebuilding the we
50、b layer using different web frameworks.</p><p> Oracle and the Java Community Process (JCP) provide standardized enterprise components, and if successful enterprise applications can be built using these com
51、ponents, then why do we need web frameworks? What are web frameworks for? The next section answers these questions.</p><p> Java Web Frameworks</p><p> While Java EE does a great job of standa
52、rdizing the enterprise infrastructure, providing an application model, and providing components adequate to develop web applications, two major problems are associated with it.</p><p><b> Web Layer<
53、;/b></p><p> The web layer of a web application consists of the web tier components of Java EE such as servlets and JSP. The web layer can access the service layer, but there should not be a tight coupli
54、ng between the web layer and the service layer. That is, changing the service layer should not impact the web layer.</p><p> Service Layer</p><p> The service layer consists of the business ti
55、er components of Java EE such as Enterprise JavaBeans (EJBs). The service layer can access the data access layer, but there should be no tight coupling between the service layer and the data access layer. In fact, the se
56、rvice layer should not know anything about the web or data access layer. The service layer provides a coarse-grained interface for the web layer.</p><p> Data Access Layer</p><p> The data acc
57、ess layer consists of the data tier components of Java EE such as JDBC and JPA. This layer should not contain any business logic. This layer abstracts the actual persistence mechanism (in other words, JDBC or JPA) from t
58、he service layer by providing the coarse-grained interface to the service layer.</p><p> In this chapter, you will build the data access layer of the bookstore application and query it via a stand-alone Jav
59、a application. In Chapter 2, you will replace this stand-alone Java application with a web layer using the web tier components of Java EE (specifically, servlets and JSPs). You will use this data access layer throughout
60、this book, and from Chapter 4 onward you will build a web application repeatedly by rebuilding the web layer using different web frameworks.</p><p> Oracle and the Java Community Process (JCP) provide stand
61、ardized enterprise components, and if successful enterprise applications can be built using these components, then why do we need web frameworks? What are web frameworks for? The next section answers these questions.<
62、/p><p> Java Web Frameworks</p><p> While Java EE does a great job of standardizing the enterprise infrastructure, providing an application model, and providing components adequate to develop web
63、 applications, two major problems are associated with it.</p><p> Interacting directly with the Java EE components often results in massive boilerplate code and even code redundancy.</p><p> C
64、reating an enterprise application using the Java EE infrastructure is a nontrivial task that requires a great deal of expertise. The team members usually involved in creating an enterprise Java EE application act in vari
65、ed roles, and all of them may not have the level of expertise that meets the Java EE criteria.</p><p> Now that you have looked at the three key players that join forces in building modern Java web applicat
66、ions (the JVM languages, Java EE, and the Java web frameworks), it is time to delve into some specifics about Java.</p><p> The following section introduces Java so you can build your first stand-alone Java
67、 application. Since this book is centered on web development using Java and is not about Java as a programming language, the introduction to Java is brief—it’s just enough to help newcomers to the language follow the sub
68、sequent chapters.</p><p> Getting Started with Java</p><p> A Java application is a computer program that executes when you use the j ava command to launch the JVM. In the Java programming lan
69、guage, all source code is first written in plain-text files (in Notepad, for instance, or in any text editor) with the . java extension. The source files are compiled by the javac compiler into . cl ass files that contai
70、n bytecode instructions. The JVM reads these bytecode instructions and translates them into the machine-language operations that each computer execu</p><p> The Bookstore Application</p><p> I
71、nstead of simply declaring one web framework as the best, this book intends to show the strengths of the most popular web frameworks by means of a real-world bookstore application. Developing a complete real application
72、necessitates a seamless collaboration of dynamic functionalities, and the code for building such components is contrived and too involved. Instead of focusing on developing such moving parts, this book confines its atten
73、tion on leveraging the strengths of each web framework. Thr</p><p> Throughout this book, I will use a single web application case study to demonstrate how to write a web application using servlets and JSPs
74、 and the different web frameworks such as JSF, Struts 2, Spring Web MVC, and rapid web development frameworks such as Grails and Play. The application allows users to view books and search for them by keyword, usually by
75、 the first name or last name of the author and the title of the book.</p><p> Data Model for the Bookstore Application</p><p> This section introduces a simple data model that will be used for
76、 the bookstore web application throughout this book. I will expand the model progressively with each chapter, as the need arises. The model is a simple book database that consists of three tables.</p><p> T
77、he Category table stores the different categories of books; categories include Java, Scala, and so on.</p><p> The Book table stores the book details such as titles.</p><p> The Author table s
78、tores the details of the authors.</p><p> Each category can have zero or more books. For instance, there could be zero or more books in the Java category in the bookstore. In other words, there is a one-to-
79、many relationship between the Category and Book tables. Similarly, each book can have one or more authors. In other words, there is a one-to-many relationship between the Book and Author tables. The entity-relationship (
80、ER) diagram in Figure 1-12 illustrates this relationship.</p><p> This data model is not production-ready because you can have a many-to-many relationship between Category and Book, and you can have a many-
81、to-many relationship between Book and Author. I have kept the data model simple so that the complexity of the data model does not get in the way of learning the mechanics of building a web application. However, you can,
82、for example, model a many-to-many relationship between Book and Author, as illustrated in Figure 1-13.</p><p> Data Access Layer for the Bookstore Application</p><p> Now that the database is
83、ready, you will build the data access layer for application. The data access layer will retrieve the data via JDBC from the database and directly map the result set into Java objects. These Java objects are the domain ob
84、jects in the application that are the Java representation of the tables in the database. The data access layer is responsible for interfacing with the underlying persistence mechanism in a transparent way in order to sto
85、re and retrieve objects from the da</p><p> The DAO maps application calls to the persistence mechanism and provides specific data operations without exposing details of the database. The DAO interface abst
86、racts the implementation details of accessing the data from the client (application object) and provides the domain-specific objects that the client (application object) needs.</p><p> First you need to cre
87、ate the domain-specific classes for the Java object representations of the database tables. Listings 1-4, 1-5, and 1-6 show the Book, Aut hor , and Cat egor y domain classes, respectively.</p><p> Trends an
88、d Technologies in the Java Web Landscape</p><p> Now it is time to delve into the trends and technologies in today’s Java web landscape. This may seem daunting to a newcomer to Java, but the goal is to fami
89、liarize you with the tools, technologies, and trends in Java web application development in order to give you a glimpse of the modern Java landscape. When you learn to develop web applications using rapid web frameworks
90、such as Grails 2and Play 2, you will see that most of these tools and technologies are provided out of the box.</p><p> As mentioned throughout the chapter, the JVM, originally intended for Java, can now ho
91、st a myriad of programming languages, including Groovy and Scala. As a consequence of this emerging multiprogramming paradigm, modern web applications are often characterized in one or more of the following ways:</p&g
92、t;<p> Responsive web applications </p><p> Single-page web applications </p><p> Real-time web applications </p><p> Reactive web applications </p><p> Mas
93、hups and web services</p><p> Responsive Web Applications</p><p> One of the greatest strengths of the Web is that it is flexible. This flexibility, however, is also its greatest weakness. Thi
94、s weakness manifests itself when a web application tested on one browser is viewed on the different browser and doesn’t perform properly. This cross-browser compatibility problem has only grown with the advent of smart p
95、hones.</p><p> Responsive web applications are device-agnostic, in that they adapt themselves to the device on which they are run. The technique goes as far as rethinking the way page layouts are designed.
96、You can go one step further by designing the web application with the smallest screen (smart phones) in mind and then progressively enhance the application to run on desktop screens. This technique is known as mobile-fir
97、st design. The philosophy of a mobile-first design is that if you design the interface an</p><p> Single-Page Web Application (SPA)</p><p> Another trend in web application development is a si
98、ngle-page web application (SPA).</p><p> The client-side code—such as HTML, JavaScript, and CSS—is retrieved with a single page load; the page does not reload at any point in the process, and the control is
99、 not transferred to another page.</p><p> The resources, such as images, are dynamically loaded and added to the page in response to events.</p><p> Real-Time Web Application</p><p&
100、gt; A real-time web application delivers responses to events in a measurable and acceptable time period, depending on the nature of the event, by means of asynchronous, bidirectional communication between the client and
101、 the server. WebSocket is the core technology employed for developing real-time web applications. WebSocket provides a full-duplex and bidirectional communication protocol over a single TCP connection. That is, a client
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 130計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯介紹java web開發(fā)
- 117計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯成品 對java及其歷史的介紹(最新)
- 114計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯成品集成spring mvc框架
- 130計(jì)算機(jī)專業(yè)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯:介紹java web開發(fā)
- 116計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯成品安裝和配置mysql (最新)
- 128計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯成品web網(wǎng)站開發(fā)方法 4萬字符
- 126有關(guān)計(jì)算機(jī)專業(yè)相關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯成品對delphi的概述
- 04計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品tmn網(wǎng)絡(luò)管理平臺的設(shè)計(jì)與實(shí)現(xiàn)
- 18計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品高校大學(xué)宿舍管理系統(tǒng)研究
- 177計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯 對java及其歷史的介紹(最新)
- 128計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯web網(wǎng)站開發(fā)方法 (英文)
- 29計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品c.c語言的自動(dòng)類型轉(zhuǎn)換
- 【中英雙語】118有關(guān)計(jì)算機(jī)專業(yè)相關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯成品:對 asp.net core的介紹(最新)
- 94計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品分析java ee應(yīng)用程序中的程序依賴性
- 02計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品c編程語言在增強(qiáng)故障檢測方面的擴(kuò)展
- 06計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品安卓andriod移動(dòng)設(shè)備上醫(yī)療信息服務(wù)的實(shí)現(xiàn)
- 108計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品從信息門戶到數(shù)字圖書館管理系統(tǒng)案例分析
- 112計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品基于android安卓操作系統(tǒng)的增強(qiáng)現(xiàn)實(shí)應(yīng)用程序開發(fā)
- 114計(jì)算機(jī)專業(yè)相關(guān)有關(guān)畢業(yè)設(shè)計(jì)外文文獻(xiàn)集成spring mvc框架
- 26計(jì)算機(jī)專業(yè)相關(guān)有關(guān)外文文獻(xiàn)翻譯成品基于消費(fèi)者行為建模的網(wǎng)頁內(nèi)容推薦系統(tǒng)
評論
0/150
提交評論