外文翻译-----使用开放源码工具的专业便携式开发
软件工程毕业论文文献翻译中英文对照

软件工程毕业论文文献翻译中英文对照学生毕业设计(论文)外文译文学生姓名: 学号专业名称:软件工程译文标题(中英文):Qt Creator白皮书(Qt Creator Whitepaper)译文出处:Qt network 指导教师审阅签名: 外文译文正文:Qt Creator白皮书Qt Creator是一个完整的集成开发环境(IDE),用于创建Qt应用程序框架的应用。
Qt是专为应用程序和用户界面,一次开发和部署跨多个桌面和移动操作系统。
本文提供了一个推出的Qt Creator和提供Qt开发人员在应用开发生命周期的特点。
Qt Creator的简介Qt Creator的主要优点之一是它允许一个开发团队共享一个项目不同的开发平台(微软Windows?的Mac OS X?和Linux?)共同为开发和调试工具。
Qt Creator的主要目标是满足Qt开发人员正在寻找简单,易用性,生产力,可扩展性和开放的发展需要,而旨在降低进入新来乍到Qt的屏障。
Qt Creator 的主要功能,让开发商完成以下任务: , 快速,轻松地开始使用Qt应用开发项目向导,快速访问最近的项目和会议。
, 设计Qt物件为基础的应用与集成的编辑器的用户界面,Qt Designer中。
, 开发与应用的先进的C + +代码编辑器,提供新的强大的功能完成的代码片段,重构代码,查看文件的轮廓(即,象征着一个文件层次)。
, 建立,运行和部署Qt项目,目标多个桌面和移动平台,如微软Windows,Mac OS X中,Linux的,诺基亚的MeeGo,和Maemo。
, GNU和CDB使用Qt类结构的认识,增加了图形用户界面的调试器的调试。
, 使用代码分析工具,以检查你的应用程序中的内存管理问题。
, 应用程序部署到移动设备的MeeGo,为Symbian和Maemo设备创建应用程序安装包,可以在Ovi商店和其他渠道发布的。
, 轻松地访问信息集成的上下文敏感的Qt帮助系统。
计算机外文翻译--Struts-MVC 的一种开放源码实现

外文翻译学院:信息科学与工程学院专业:计算机科学与技术学生姓名:学生班级:计算机0801班学生学号:指导教师:Struts——an open-source MVC implementation This article introduces Struts, a Model-View-Controller implementation that uses servlets and JavaServer Pages (JSP) technology. Struts can help you control change in your Web project and promote specialization. Even if you never implement a system with Struts, you may get some ideas for your future servlets and JSP page implementation.IntroductionKids in grade school put HTML pages on the Internet. However, there is a monumental difference between a grade school page and a professionally developed Web site. The page designer (or HTML developer) must understand colors, the customer, product flow, page layout, browser compatibility, image creation, JavaScript, and more. Putting a great looking site together takes a lot of work, and most Java developers are more interested in creating a great looking object interface than a user interface. JavaServer Pages (JSP) technology provides the glue between the page designer and the Java developer.If you have worked on a large-scale Web application, you understand the term change. Model-View-Controller (MVC) is a design pattern put together to help control change. MVC decouples interface from business logic and data. Struts is an MVC implementation that uses Servlets 2.2 and JSP 1.1 tags, from the J2EE specifications, as part of the implementation. You may never implement a system with Struts, but looking at Struts may give you some ideas on your future Servlets and JSP implementations.Model-View-Controller (MVC)JSP tags solved only part of our problem. We still have issues with validation, flow control, and updating the state of the application. This is where MVC comes to the rescue. MVC helps resolve some of the issues with the single module approach by dividing the problem into three categories:∙ModelThe model contains the core of the application's functionality. The model encapsulates the state of the application. Sometimes the only functionality it contains is state. It knows nothing about the view or controller.∙ViewThe view provides the presentation of the model. It is the look of the application. The view can access the model getters, but it has no knowledge of the setters. In addition, it knows nothing about the controller. The view should be notified when changes to the model occur.∙ControllerThe controller reacts to the user input. It creates and sets the model.MVC Model 2The Web brought some unique challenges to software developers, most notably the stateless connection between the client and the server. This stateless behavior made it difficult for the model to notify the view of changes. On the Web, the browser has to re-query the server to discover modification to the state of the application.Another noticeable change is that the view uses different technology for implementation than the model or controller. Of course, we could use Java (or PERL, C/C++ or what ever) code to generate HTML. There are several disadvantages to that approach:∙Java programmers should develop services, not HTML.∙Changes to layout would require changes to code.∙Customers of the service should be able to create pages to meet their specific needs.∙The page designer isn't able to have direct involvement in page development.∙HTML embedded into code is ugly.For the Web, the classical form of MVC needed to change. Figure 1 displays the Web adaptation of MVC, also commonly known as MVC Model 2 or MVC 2.Figure 1. MVC Model 2Struts, an MVC 2 implementationStruts is a set of cooperating classes, servlets, and JSP tags that make up a reusable MVC 2 design. This definition implies that Struts is a framework, rather than a library, but Struts also contains an extensive tag library and utility classes that work independently of the framework. Figure 2 displays an overview of Struts.Figure 2. Struts viewStruts overviewClient browserAn HTTP request from the client browser creates an event. The Web container will respond with an HTTP response.●ControllerThe Controller receives the request from the browser, and makes the decision where to send the request. With Struts, the Controller is a command design pattern implemented as a servlet. The struts-config.xml file configures the Controller.●Business logicThe business logic updates the state of the model and helps control the flow of the application. With Struts this is done with an Action class as a thin wrapper to the actual business logic.●Model stateThe model represents the state of the application. The business objects update the application state. ActionForm bean represents the Model state at a session or request level, and not at a persistent level. The JSP file reads information from the ActionForm bean using JSP tags.●ViewThe view is simply a JSP file. There is no flow logic, no business logic, and no model information -- just tags. Tags are one of the things that make Struts unique compared to other frameworks like Velocity.Struts detailsDisplayed in Figure 3 is a stripped-down UML diagram of the org.apache.struts.action package. Figure 6 shows the minimal relationships among ActionServlet (Controller), ActionForm (Form State), and Action (Model Wrapper).Figure 3:the relationship between ActionServlet (Controller)、 ActionForm (Form State) andAction (Model Wrapper)The ActionServlet classDo you remember the days of function mappings? You would map some input event to a pointer to a function. If you where slick, you would place the configuration information into a file and load the file at run time. Function pointer arrays were the good old days of structured programming in C.Life is better now that we have Java technology, XML, J2EE, and all that. The Struts Controller is a servlet that maps events (an event generally being an HTTP post) to classes. And guess what -- the Controller uses a configuration file so you don_t have to hard-code the values. Life changes, but stays the same.ActionServlet is the Command part of the MVC implementation and is the core of the Framework. ActionServlet (Command) creates and uses Action, an ActionForm, and ActionForward. As mentioned earlier, the struts-config.xml file configures the Command. During the creation of the Web project, Action and ActionForm are extended to solve the specific problem space. The file struts-config.xml instructs ActionServlet on how to use the extended classes. There are several advantages to this approach:∙The entire logical flow of the application is in a hierarchical text file. This makes it easier to view and understand, especially with large applications.∙The page designer does not have to wade through Java code to understand the flow of the application.∙The Java developer does not need to recompile code when making flow changes. Command functionality can be added by extending ActionServlet.The ActionForm classActionForm maintains the session state for the Web application. ActionForm is an abstract class that is sub-classed for each input form model. When I say input form model, I am saying ActionForm represents a general concept of data that is set or updated by a HTML form. For instance, you may have a UserActionForm that is set by an HTML Form. The Struts framework will:∙Check to see if a UserActionForm exists; if not, it will create an instance of the class.∙Struts will set the state of the UserActionForm using corresponding fields from the HttpServletRequest. No more dreadful request.getParameter() calls. For instance, the Struts framework will take fname from request stream and call UserActionForm.setFname().∙The Struts framework updates the state of the UserActionForm before passing it to the business wrapper UserAction.∙Before passing it to the Action class, Struts will also conduct form state validation by calling the validation() method on UserActionForm.Note: This is not always wise to do.There might be ways of using UserActionForm in other pages or business objects, where the validation might be different. Validation of the state might be better in the UserAction class.∙The UserActionForm can be maintained at a session level.Notes:∙The struts-config.xml file controls which HTML form request maps to which ActionForm.∙Multiple requests can be mapped UserActionForm.∙UserActionForm can be mapped over multiple pages for things such as wizards.The Action classThe Action class is a wrapper around the business logic. The purpose of Action class is to translate the HttpServletRequest to the business logic. To use Action, subclass and overwrite the process() method.The ActionServlet (Command) passes the parameterized classes to ActionForm using the perform() method. Again, no more dreadful request.getParameter() calls. By the time the event gets here, the input form data (or HTML form data) has already been translated out of the request stream and into an ActionForm class.Note: "Think thin" when extending the Action class. The Action class should control the flow and not the logic of the application. By placing the business logic in a separate package or EJB, we allow flexibility and reuse.Another way of thinking about Action class is as the Adapter design pattern. The purpose of the Action is to "Convert the interface of a class into another interface the clients expect. Adapter lets classes work together that couldn_t otherwise because of incompatibility interface" (from Design Patterns - Elements of Reusable OO Software by Gof). The client in this instance is the ActionServlet that knows nothing about our specific business class interface. Therefore, Struts provides a business interface it does understand, Action. By extending the Action, we make our business interface compatible with Struts business interface. (An interesting observation is that Action is a class and not an interface. Action started as an interface and changed into a class over time. Nothing's perfect.)The Error classesThe UML diagram (Figure 4) also included ActionError and ActionErrors. ActionError encapsulates an individual error message. ActionErrors is a container of ActionError classes that the View can access using tags. ActionErrors is Struts way of keeping up with a list of errors.Figure 4:the relationship between Command (ActionServlet) and Model (Action)The ActionMapping classAn incoming event is normally in the form of an HTTP request, which the servlet Container turns into an HttpServletRequest. The Controller looks at the incoming event and dispatches the request to an Action class. The struts-config.xml determines what Action class the Controller calls. The struts-config.xml configuration information is translated into a set of ActionMapping, which are put into container of ActionMappings. (If you have not noticed it, classes that end with s are containers)The ActionMapping contains the knowledge of how a specific event maps to specific Actions. The ActionServlet (Command) passes the ActionMapping to the Action class via the perform() method. This allows Action to access the information to control flow.ActionMappingsActionMappings is a collection of ActionMapping objects.Struts prosUse of JSP tag mechanismThe tag feature promotes reusable code and abstracts Java code from the JSP file. This feature allows nice integration into JSP-based development tools that allow authoring with tags.∙Tag libraryWhy re-invent the wheel, or a tag library? If you cannot find something you need in the library, contribute. In addition, Struts provides a starting point if you are learning JSP tag technology.∙Open sourceYou have all the advantages of open source, such as being able to see the code and having everyone else using the library reviewing the code. Many eyes make for great code review.∙Sample MVC implementationStruts offers some insight if you want to create your own MVC implementation.∙Manage the problem spaceDivide and conquer is a nice way of solving the problem and making the problem manageable. Of course, the sword cuts both ways. The problem is more complex and needs more management.Struts cons∙YouthStruts development is still in preliminary form. They are working toward releasing a version 1.0, but as with any 1.0 version, it does not provide all the bells and whistles.∙ChangeThe framework is undergoing a rapid amount of change. A great deal of change has occurred between Struts 0.5 and 1.0. You may want to download the most current Struts nightly distributions, to avoid deprecated methods. In the last 6 months, I have seen theStruts library grow from 90K to over 270K. I had to modify my examples several times because of changes in Struts, and I am not going to guarantee my examples will work with the version of Struts you download.∙Correct level of abstractionDoes Struts provide the correct level of abstraction? What is the proper level of abstraction for the page designer? That is the $64K question. Should we allow a page designer access to Java code in page development? Some frameworks like Velocity say no, and provide yet another language to learn for Web development. There is some validity to limiting Java code access in UI development. Most importantly, give a page designer a little bit of Java, and he will use a lot of Java. I saw this happen all the time in Microsoft ASP development. In ASP development, you were supposed to create COM objects and then write a little ASP script to glue it all together. Instead, the ASP developers would go crazy with ASP script. I would hear "Why wait for a COM developer to create it when I can program it directly with VBScript?" Struts helps limit the amount of Java code required in a JSP file via tag libraries. One such library is the Logic Tag, which manages conditional generation of output, but this does not prevent the UI developer from going nuts with Java code. Whatever type of framework you decide to use, you should understand the environment in which you are deploying and maintaining the framework. Of course, this task is easier said than done.∙Limited scopeStruts is a Web-based MVC solution that is meant be implemented with HTML, JSP files, and servlets.∙J2EE application supportStruts requires a servlet container that supports JSP 1.1 and Servlet 2.2 specifications.This alone will not solve all your install issues, unless you are using Tomcat 3.2.ComplexitySeparating the problem into parts introduces complexity. There is no question that some education will have to go on to understand Struts. With the constant changes occurring, this can be frustrating at times.Future of StrutsThings change rapidly in this new age of software development. In less than 5 years, we have seen things go from cgi/perl, to ISAPI/NSAPI, to ASP with VB, and now Java and J2EE. Sun is working hard to adapt changes to the JSP/servlet architecture, just as they have in the past with the Java language and API. You can obtain drafts of the new JSP 1.2 and Servlet 2.3 specifications from the Sun Web site. Additionally, a standard tag library for JSP files is appearing.Struts——MVC 的一种开放源码实现本文介绍Struts,它是使用servlet 和JavaServer Pages 技术的一种Model-View-Controller 实现。
计算机专业外文文献及翻译微软Visual Studio

计算机专业外文文献及翻译微软Visual Studio 微软 Visual Studio1 微软 Visual Studio Visual Studio 是微软公司推出的开发环境,Visual Studio 可以用来创建 Windows 平台下的Windows 应用程序和网络应用程序,也可以用来创建网络服务、智能设备应用程序和 Office 插件。
Visual Studio 是一个来自微软的集成开发环境 IDE(inteqrated development environment),它可以用来开发由微软视窗,视窗手机,Windows CE、.NET 框架、.NET 精简框架和微软的 Silverlight 支持的控制台和图形用户界面的应用程序以及 Windows 窗体应用程序,网站,Web 应用程序和网络服务中的本地代码连同托管代码。
Visual Studio 包含一个由智能感知和代码重构支持的代码编辑器。
集成的调试工作既作为一个源代码级调试器又可以作为一台机器级调试器。
其他内置工具包括一个窗体设计的 GUI 应用程序,网页设计师,类设计师,数据库架构设计师。
它有几乎各个层面的插件增强功能,包括增加对支持源代码控制系统(如 Subversion 和 Visual SourceSafe)并添加新的工具集设计和可视化编辑器,如特定于域的语言或用于其他方面的软件开发生命周期的工具(例如 Team Foundation Server 的客户端:团队资源管理器)。
Visual Studio 支持不同的编程语言的服务方式的语言,它允许代码编辑器和调试器(在不同程度上)支持几乎所有的编程语言,提供了一个语言特定服务的存在。
内置的语言中包括 C/C 中(通过Visual C)(通过 Visual ),C,中(通过 Visual C,)和 F,(作为Visual Studio2010),为支持其他语言,如 MPython和 Ruby 等,可通过安装单独的语言服务。
论文中英文翻译(译文)

编号:桂林电子科技大学信息科技学院毕业设计(论文)外文翻译(译文)系别:电子工程系专业:电子信息工程学生姓名:韦骏学号:0852100329指导教师单位:桂林电子科技大学信息科技学院姓名:梁勇职称:讲师2012 年6 月5 日设计与实现基于Modbus 协议的嵌入式Linux 系统摘要:随着嵌入式计算机技术的飞速发展,新一代工业自动化数据采集和监测系统,采用核心的高性能嵌入式微处理器的,该系统很好地适应应用程序。
它符合消费等的严格要求的功能,如可靠性,成本,尺寸和功耗等。
在工业自动化应用系统,Modbus 通信协议的工业标准,广泛应用于大规模的工业设备系统,包括DCS,可编程控制器,RTU 及智能仪表等。
为了达到嵌入式数据监测的工业自动化应用软件的需求,本文设计了嵌入式数据采集监测平台下基于Modbus 协议的Linux 环境采集系统。
串行端口的Modbus 协议是实现主/从式,其中包括两种通信模式:ASCII 和RTU。
因此,各种药膏协议的设备能够满足串行的Modbus通信。
在Modbus 协议的嵌入式平台实现稳定和可靠。
它在嵌入式数据监测自动化应用系统的新收购的前景良好。
关键词:嵌入式系统,嵌入式Linux,Modbus 协议,数据采集,监测和控制。
1、绪论Modbus 是一种通讯协议,是一种由莫迪康公司推广。
它广泛应用于工业自动化,已成为实际的工业标准。
该控制装置或不同厂家的测量仪器可以链接到一个行业监控网络使用Modbus 协议。
Modbus 通信协议可以作为大量的工业设备的通讯标准,包括PLC,DCS 系统,RTU 的,聪明的智能仪表。
随着嵌入式计算机技术的飞速发展,嵌入式数据采集监测系统,使用了高性能的嵌入式微处理器为核心,是一个重要的发展方向。
在环境鉴于嵌入式Linux 的嵌入式工业自动化应用的数据,一个Modbus 主协议下的采集监测系统的设计和实现了这个文件。
因此,通信设备,各种药膏协议能够满足串行的Modbus。
开放源码技术研究及应用

开放源码技术研究及应用第一章:开放源码技术介绍开放源码技术(Open Source Technology),简称为OS技术,是指软件开发过程中,使用的程序源代码是公开透明的,可以免费获取、使用、修改和分发的一种技术。
而开放源码的最大特点就在于其开放性与协作性,其源代码可以公开给任何人查看、学习、分析,且可以应用于各种自主研发、二次开发、商业应用等。
1998年,Linux系统的发明人Linus Torvalds正式宣布开放源码,将Linux操作系统的内核开放给世界各地的开发者和用户使用和开发,从而开创了开放源码技术的时代。
随着技术的不断发展,开放源码技术早已不再仅仅是一种工具,更成为了一种开发模式和文化。
第二章:开放源码技术的应用开放源码技术可以运用到各个领域,以下介绍其在几个领域的应用:1. 操作系统领域Linux系统是开放源码技术最经典的代表,在操作系统领域的应用被广泛运用。
2. 云计算领域开放源码技术在云计算技术领域中也有广泛应用。
例如OpenStack、Kubernetes、Docker这些产品的源码都是开放的,社区开发者可以对这些产品的功能和性能进行调整、完善或改进等。
3. 大数据领域Apache Hadoop是一个开源框架,主要是用于处理海量数据集的分布式计算和存储,它可以运用于各种大数据应用场景,从而为多个行业提供了支持。
4. IoT领域随着互联网的不断发展,物联网领域是当前热门的领域之一。
而开放源码技术可以为IoT领域的开发提供技术支持,例如Arduino、Raspberry Pi等开源硬件平台,可以为IoT应用开发者提供更多的选择和开发思路。
第三章:开放源码技术的优缺点1. 优点(1)开放性:开放源码技术的最大特点就是其开放性,任何人都有权查看和修改源代码,为产品的改进提供了方便。
(2)合作性:由于开放源码技术的使用者和贡献者可以在社区中互相交流、合作,从而推动技术的发展和完善。
计算机外文翻译---基于PHP和MYSQL的网站设计和实现

译文二:基于PHP和MYSQL的网站设计和实现摘要PHP和MYSQL因为其免费以及开放源码已经成为主要的web开发工具。
作者就基于PHP和MYSQL开发网站进行开发环境问题的讨论。
关键词PHP;MYSQL;发展和实现。
1.介绍随着网络技术的发展,不可避免的带动各种企业传统营销与网络营销的增长。
其中最有效的方法是为他们的公司建立一个网站。
目前网站开发的主流平台包括LAMP(Linux操作系统,Apache网络服务器,MYSQL数据库,PHP编程语言),J2EE 和.NET商业软件。
因为PHP和MYSQL是免费的,开源等等,他们是为专业的IT 人士开发的。
从网站流量的角度来看,超过70%的网站流量是有LAMP提供的,这是最流行的网站开发平台。
在本文中,我们基于PHP和MYSQL设计了一个网站。
本文的组织如下。
第一节分析开发环境。
第二节中,我们提出基于PHP的开发模型。
然后,第四节是案例研究。
在第五节我们做出结论。
2.发展环境分析A.开发语言的选择,PHP&JSP是三个主流的网站开发语言,它们分别具有各自的优点和缺点,它们之间的比较见表1。
这个项目我们采用PHP作为开发语言的原因如下:免费的。
这个项目小,不需要使用支付开发平台如 and JSP。
强大的支持。
中小型网站,甚至一些大型网站如百度,新浪都把PHP作为开发语言,可以有组与解决在编程上的问题。
良好的可移植性。
尽管起初只能在Linux和Apache Web服务器环境中开发,现在已经可以移植到任何的操作系统,并兼容标准的Web服务器软件。
简单的语法。
PHP和C编程语言有许多的相似之处,所以会C的程序员很容易的就能使用PHP程序语言。
发展快速。
因为其源代码是开放的,所以PHP能迅速的发展。
B.构建开发环境目前有很多基于PHP的开发平台。
通常大多数开发人员喜欢LAMP开发环境。
那些有一定开发经验的可以通过选择相关的服务器,数据库管理系统和操作系统设置他们的开发平台。
openanolis介绍

openanolis介绍OpenAnolis是一款创新的软件工具,旨在提供一种高效、可靠的方式来处理数据分析和模型开发。
它以用户友好的界面和强大的功能,吸引了众多数据科学家和研究人员的关注。
在数据分析领域,OpenAnolis被广泛应用于各种行业和领域。
它提供了丰富的数据处理功能,包括数据清洗、特征工程、模型训练和评估等。
用户只需简单地拖拽和点击,就能完成复杂的数据处理任务。
与传统的编程工具相比,OpenAnolis减少了学习成本,并提高了工作效率。
OpenAnolis还具有强大的模型开发功能。
它提供了多种机器学习算法和深度学习模型,供用户选择和使用。
用户可以根据自己的需求,选择适合的算法和模型,并进行参数调优。
同时,OpenAnolis还提供了模型评估和解释功能,帮助用户理解模型的性能和预测结果。
除了数据分析和模型开发,OpenAnolis还支持数据可视化和报告生成。
用户可以使用丰富的图表和图形来展示数据分析结果,并生成美观、易于理解的报告。
这使得数据科学家能够更好地与非技术人员沟通和共享分析结果。
OpenAnolis的优势不仅仅在于其功能和性能,还在于其开放性和灵活性。
它支持与其他工具和平台的集成,如Python、R和Hadoop等,使用户能够更好地利用现有资源和技术。
同时,OpenAnolis还提供了丰富的文档和教程,帮助用户快速上手和解决问题。
OpenAnolis是一款强大而灵活的数据分析和模型开发工具,为用户提供了高效、可靠的解决方案。
无论是专业的数据科学家还是初学者,都能够通过OpenAnolis实现数据分析和模型开发的目标。
它的出现,为数据科学领域带来了全新的可能性,推动了数据驱动的决策和创新。
flash动作脚本ActionScript外文翻译

《动作脚本》,摘自自维基百科,自由的百科全书《ActionScript》Designed by Gary Grossman英文译文:动作脚本ActionScript是Macromedia(现已被Adobe收购)为其Flash产品开发的,最初是一种简单的脚本语言,此刻最新版本3.0,是一种完全的面向对象的编程语言,功能壮大,类库丰硕,语法类似JavaScript,多用于Flash互动性、娱乐性、有效性开发,网页制作和RIA应用程序开发。
ActionScript 是一种基于ECMAScript的脚本语言,可用于编写Adobe Flash动画和应用程序。
由于ActionScript和JavaScript都是基于ECMAScript语法的,理论上它们相互能够很流畅地从一种语言翻译到另一种。
只是JavaScript的文档对象模型(DOM)是以阅读器窗口,文档和表单为主的,ActionScript的文档对象模型(DOM)那么以SWF格式动画为主,可包括动画,音频,文字和事件处置。
历史在Mac OS X 10.2操作系统上的Macromedia Flash MX专业版里,这些代码能够创建一个与MAC OS X启动进程中看见的类似的动画。
ActionScript第一次以它目前的语法显现是Flash 5版本,这也是第一个完全可对Flash编程的版本。
那个版本被命名为ActionScript1.0。
Flash 6通过增加大量的内置函数和对动画元素更好的编程操纵更进一步增强了编程环境的功能。
Flash 7(MX 2004)引进了ActionScript2.0,它增加了强类型(strong typing)和面向对象特点,如显式类声明,继承,接口和严格数据类型。
ActionScript1.0和2.0利用相同的编译形式编译成Flash SWF文件(即Shockwave Flash files,或'Small Web Format').时刻表Flash Player 2:第一个支持脚本的版本,包括操纵时刻轴的gotoAndPlay, gotoAndStop, nextFrame和nextScene等动作。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Professional Portal Development with Open Source ToolsDesign Pattern Considerations in Your PortalClearly, there are many ways to implement a design that cannot be expressed adequately in this chapteralone. Hopefully, the introduction of high-level pattern constructs and brief discussion of the implementationof Java standards in this chapter can facilitate your design decisions on your portal deployments.Java language and implementation standards can also help control complexity so that consistent levels ofquality can be attained in your development activities. This in turn can lead to increased partner adoptionand portlet maintenance. Last, the adoption of design patterns should be applied so that best practices arepropagated in your portal deployment and development operations can be hastened.Much has been written during the last few years about design patterns and their use in Java development,so rather than go into great elaboration of their use, we felt that it would be more beneficial to providehigh-level concepts of patterns that might be used in your portal deployments and to encourage you toexplore them from the online Javaworld newsletter and from the Core J2EE Patterns book [ALUR].Planning for Portal DeploymentUsing Java StandardsFor many mission-critical development portal efforts, decisions need to be made about expensive softwareprocurements to satisfy your development needs. In order to protect this investment, it is wise toconsider standards when you make your purchasing decision because there is nothing worse thandumping a lot of money into a particular framework only to learn after you have obtained it that it is aclosed, proprietary system that does not work well with other systems. To guarantee that this does nothappen to you, you should become familiar with software standards and other application frameworks’use of them. Regrettably, systems that do rely heavily on proprietary extensions often force your projectto hire expensive expertise to help you deploy your program with their framework.Figure 7.21 illustrates some of the Java standards that could be considered for portal development. It isimportant to remember that these need to be established prior to procuring a portal framework or integratingexisting applications into a homegrown portal application. Always be cognizant of the latest versionsof the standards listed in Figure 7.21, and the effects that newer versions of those standards mighthave on your design decisions.Figure 7.21Figure 7.22 illustrates some of the portal standards that should be considered before building your portalapplication.On many portal implementations, a business case for adherence to language standards that relate toindividual portlets needs to be made so that proprietary extensions are not adopted by a program thatdisallows code reuse and promotes vendor lock-in. Being exposed to proprietary data formats, oneinevitably gets increasingly locked into the solutions of a particular vendor, which in turn limits theoptions for application software. This ultimately enables vendors to dictate enhancement prices andintroduces unnecessary risks to your systemFigure 7.22Model-View-Controller (MVC) PatternIn the portal architecture shown in Figure 7.23, theMVC Patternis where the servlet controller rendersdifferent views to the portal façade from a disparate set of data sources.Themodelis the piece that has no specific knowledge of its controllers or its views. The portal systemmaintains relations between the different models and views and broadcasts content to the views whenthe model changes state. The viewis typically the piece that manages the visualizations of the modeldata. Thecontrolleris the piece that manages user interaction with the model data.The MVC Pattern is used with many frameworks because of its ability to handle content delivery complexitiesthat are prominent in many enterprise systems. Jakarta’s Struts and BEA’s WebFlow are twonotable implementations that use this in their frameworks.Template Method PatternA good practice when developing JavaBeans in your portal applications is to use the Template MethodPattern [GoF] to enforce a common design across the portal back-end. The Template Method Pattern canbe used so that modifications to your get and/or set methods will not affect your presentation view.In the portal display in Figure 7.23, the JavaBean applications on the back-end implement the TemplateMethod Pattern to manage the logic in the accessor (get/set) methods.Memento PatternIn the sample portal visualization shown in Figure 7.23, the view labeled #4 indicates that a form will berendered to the user display. In many cases, the form will use JavaScript to perform validation testing sothat activities will be performed on the client side in order to alleviate unnecessary operations on theserver. This is a good practice for some Web applications, especially portals that perform heavy serveroperations, but sometimes incompatibilities in browsers allow inconsistent behaviors to occur.TheMemento Pattern [GoF] will persist the state of the form entries so that submits retain that data inthe form text fields, and can perform server-side validation operations on that data.Facade PatternThe Façade Pattern[GoF] is used in the portal application shown in Figure 7-23 to facilitate tediousoperations that are associated with a database connection. Some of the operations that would warrantthe use of a façade include the following: database connection handling, driver setups, and SQL statementconstruction.Adapter PatternThe Adapter Pattern[GoF] could be applied in the aforementioned portal application as a means torewrite legacy code implementations to share data from the back-end data stores. By wrapping existingcode with an object adapter, the application can support existing interfaces by adapting the interface ofthe parent class.The Adapter Pattern provides a mechanism to convert one interface into another. This is necessary when anewer interface has superceded an older one. Instead of recoding the implementation of the older interface,that implementation can be wrapped by an adapter that implements the newer interface. Calls to the newinterface methods are then translated into calls to the older interface methods. This enables the legacy codeto be extended to allow for more functionality, without having to rewrite existing code.Factory Method PatternThe Factory Method Pattern [GoF] can be used to instantiate objects, such as a factory, by abstracting thecreation and initialization of these objects from the user. This enables the client to focus on the applicationwithout being concerned with the object creation details. In our sample portal display, it can be usedto generate a taxonomy object (from an XML file) that will generate queries as the user traverses thenavigation tree.Singleton PatternThe Singleton Pattern[GoF] ensures that only one instance of a class is created, and provides a singlepoint of access to an object. In the portal example shown in Figure 7-23 a Singleton can be used to open adatabase connection or to generate a navigation tree from an XML file.Front Controller PatternThe Front Controller Pattern[ALUR] is part of the J2EE Presentation Tier Patterns library. The FrontController Pattern is similar to the MVC Pattern, and is actually used within the context of it, but it differsin that no model, or data access component, is associated with it. Referring to our sample portalshown in Figure 7-23, a Servlet controller is used to render different JSP views to the portal display.Note the following important features of the Front Controller Pattern: It allows for the handling ofrequests in a centralized location, which facilitates maintenance, and can perform authorization checkswithout having to spread unnecessary logic across multiple applications.Intercepting Filter PatternThe Intercepting Filter Pattern [ALUR] is another J2EE Presentation Tier Pattern thatwas introducedwith the Servlet 2.3 specification. This Pattern allows for the pre-processing and post-processing of userrequests, as well as the capability to alter response headers and data when processing requests.In the portal display, the Intercepting Filter Pattern can be used to swap presentation views within aportlet, meaning that the data sent back from the back-end database can be processed to render data inXML format so that an XSL stylesheet can be applied to the data to present a different user view.Client-Side ProcessingClient-side processing refers to the application processing done at the browser. All browsers have beenenabled to interpret scripting instructions that would usually be sent to the server. This activity reducesthe load on the server’s back-end.Sadly, many challenges are present in browsers because of inconsistencies in their adherence to scriptingstandards. One of the most troublesome problems with browsers is inconsistencies with their implementationsof the Document Object Model (DOM). The DOM standard is used to access elements and attributesof a Web document. These inconsistencies force developers to increase their development efforts to supportdifferent browserincompatibilities. To work around this issue, some portal efforts perform more serversideprocessing, which places a great load on the back-end. Other workaround measures involve allowingonly limited amounts of client-side processing, and the application of best practices obtained through otherdevelopment endeavors.JavaScriptDifferent Web browsers, and different versions of the same Web browser, will often treat the similarJavaScript documents slightly differently. This browser incompatibility becomes a more salient issuethe more your portal application applies it in its client-side processing. The trick to is to establish aJavaScript standard, and apply it across all of your portal applications that use JavaScript. With al l portalapplications that use JavaScript, make sure you’re aware of your presentations when JavaScript has beendisabled in your browser.Always remember to propagate your proven scripting practices across your portal development efforts.One best practice to apply across your JavaScripting effort in your portal is to put your JavaScript sourcein a separate JavaScript (.js) file. When this is done, the JavaScript source can be referenced with thescript tag in the following manner: <scriptsrc=””>.Server-Side ProcessingAccording to the JSR-168 Portlet Specification, portlets share many of the same attributes as servlet components.The following table compares the two Web components to highlight their commonalities anddifferences.Figure 7.24 describes the request-handling operations that occur during portlet processing in a portalthat implements the JSR-168 Portlet Specification APIs. The portlet container processes the action initiatedby the portal user first, and then renders the portlet fragments in no specific order to refresh theuser display.Figure 7.24Java Plug-insJava Plug-ins enable Web applications to supplant a browser’s default virtual machine so that more upto-date JVMs can be applied to that application. The Java Plug-in, which requires a one-time download,enables applications to be consistent in their operations by overriding browser inconsistencies.The first time a Web browser encounters a Web page that specifies the use of the Java Plug-in, the browsermust download and install the required files for proper operation. On most portals’ applications, a linkshould be provided to show users where a plug-in can be obtained to run their application. After the Java.Plug-in has been downloaded, subsequent invocations of Web pages that are reliant on the plug-in willretrieve it from the local hard drive when an applet component is rendered.The implementation of applets and Java Plug-ins in your portal deployments typically needs stakeholder“buy-in” prior to acceptance. This consideration needs to be addressed because of bandwidthand firewall issues that might prevent users from downloading theplug-in to access portlets that usethem. To gain better clarity on the implementation of the Java Plug-in on your portal implementationwith two of the most common browsers, Netscape and Internet Explorer, developers should refer toSun’s Java Plug-in reference at:/products/plugin/.Web Services for Remote Portals (WSRP)Web Services for Remote Portals (WSRP) is a new technology that will be an important feature oftheJSR-168 Portlet Standard Specification. It enables the plug-n-play of visual UI Web services with portalsor any other Web applications. WSRP services will allow content providers to expose content or applicationsin a non-intrusive manner that does not requireapplication-specific adaptation by consumingapplications.The intention of WSRP is to facilitate the integration of Web applications through a standard set ofWeb service interfaces. A simple sequence of steps (shown in Figure 7.25) is performed when addingportlets through Web services in portals. When a user puts a portlet on one of the portal pages, the portalrequests the creation of a corresponding portlet instance on the WSRP service’s side, by calling the createPortletInstanceoperation and obtaining a portlet instance handle that it uses in subsequentrequests. It can then obtain markup to embed from the WSRP service by calling the getPortletMarkupoperation and displaying that markup within a portlet. If the obtained markup contains links or formswith associated actions, and the user clicks into the portlet on one of these links or forms, the portlet triggersthe corresponding action in the WSRP service by calling the performActionoperation. Whentheportal doesn’t need the portlet i nstance anymore because the portlet is removed from a user’s page, itrequests to discard the portlet instance on the WSRP service’s side by calling the destroyInstanceoperation. A good reference on WSRP implementation can be found at /developerworks/library/ws-wsrp.Figure 7.25使用开放源码工具的专业便携式开发门户的模式设计与思考显然,有许多方法来完成这个设计,在这一章不能全部表述出来。