资源预览内容
第1页 / 共33页
第2页 / 共33页
第3页 / 共33页
第4页 / 共33页
第5页 / 共33页
第6页 / 共33页
第7页 / 共33页
第8页 / 共33页
第9页 / 共33页
第10页 / 共33页
亲,该文档总共33页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
本文是中英对照毕业设计论文外文文献翻译,下载后直接可用!省去您找文献、pdf整理成word以及翻译的时间,一辈子也就一次的事!文献引用作者出处信息:Vishal Layka Learn Java for web development,2020 (如觉得年份太老,可改为近2年,毕竟很多毕业生都这样做)英文4536单词,27361字符(字符就是印刷符),中文7515汉字。(如果字数多了,可自行删减,大多数学校都是要求选取外文的一部分内容进行翻译的。)Best Practices in Java EE Web DevelopmentEvery so often good solutions are invented. At times they are discovered. Invention and discovery are not synonyms,1 and they signify different objectives; however, both are realized through experience and expertise. Experience helps you achieve good solutions, and when you apply those good solutions to the same set of problems, patterns begin to emerge. Patterns are the catalog of good solutions that stem from the experience and expertise of developers.An architect named Christopher Alexander observed that architects tend to solve the same problems in more or less the same way. This realization led him to write a book of design patterns for architects.2 He reflected in this book, “A design pattern describes a problem which occurs over and over again, and then describes the core of the solution to that problem, in such a way that you can use this solution a million times over, without ever doing it the same way twice.”In 1994, the book Design Patterns: Elements of Reusable Object-Oriented Software, by Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides (Addison-Wesley, 1994) (the “Gang of Four” or “GoF”), applied Alexanders ideas to software. This book expounded OO patterns and ushered in a wave of best-practice solutions, addressing a number of design requirements that surfaced over the years with a design strategy that is reusable across applications.As server systems grew, enterprise infrastructure such as Java EE emerged that provided abstractions of technologies and services. However, using Java EE does not naturally lead to best-practice architecture and design. John Crupi, Dan Malks, and Deepak Alur first established Java EE design patterns based on their experience of architecting enterprise systems.Applying these Java EE design patterns to the development of a Java EEbased application is de rigueur to achieving best-practice architecture and design. That said, ensuring best-practice architecture and design is not enough to ensure reusable, maintainable, extensible software. Even with the Java EE design patterns in place, a software project is often afflicted by a phenomenon called entropy, a measure of the degree of disorder. According to the Second Law of Thermodynamics, everything in the universe moves from low entropy (a state of order) to high entropy (disorder) and eventual chaos. Everything in nature is bound by this law of physics, and nature deals with this irrevocable law by means of evolution.A software project too often tends to move from low entropy to high entropy, and to deal with the disordered state, it needs to keep evolving. That is not to say that evolving your project supersedes project management and methodologies; despite the most finely honed project management, sharp-edged methodologies, and a team with a keen sense of style, a software project may fall into a state of high entropy. Figure 3-1 presents the evolutionary steps in Java EEs web tier that help deal with entropy in software projects.Figure 3-1. The evolution in the Java EE web tierAs you can see in Figure 3-1, not only have the technologies in the Java EE web tier evolved, but new ones are added with each new release. If you are still using J2EE 1.4, for instance, you will not have the unified EL (EL 2.1) in your toolbox. It is essential to keep up with the evolution of any technology to keep from falling into the eventual state of high entropy that can afflict any software project.This chapter elucidates the importance of gradually evolving a project with any new technologies available with each new release of Java EE and using them to deal with high entropy in the project. The chapter then discusses the importance of the Java EE patterns and explains how the web applications can be made reusable, maintainable, and extensible by using Java EE web tier patterns. Next, the chapter shows how web frameworks relinquish you from using Java EE web tier patterns by providing you out-of-the-box best-practice solutions.Best-Practice Solutions: Using EL and JSTLSun released the Servlet specification in 1998. The sole purpose of servlets was to help the Java web server generate dynamic content for the client. Listing 3-1 illustrates what the first servlet looked like.Servlets worked fine for dynamic content generation but had one big problem. The view was hardwired into the servlet, as you can see in lines 13 to 17 in Listing 3-1. To solve this problem, JSP was born. JSP removes the need of hardwiring the view code into the business logic code. This separation of the view concern from the business-logic concern depends on the attributes shown in Listing 3-2 and Listing 3-3.Listing 3-2. U
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号