软件工程专业毕业设计外文文献翻译
- 格式:doc
- 大小:59.50 KB
- 文档页数:21
TranslationUnit-1III. (1) 由于计算机与信息系统的结合以及复杂的图形用户界面而产生的新技术对软件工程师提出了新的要求。
(2) 不同类型系统和使用这些系统的不同类型组织的广泛的多样性,意味着我们需要软件开发方法的多样性。
…………………. 第8页翻译III. (1) 当芯片设计者为微处理器开发各种各样的指令集的同时,他们增加了越来越复杂的指令,每个指令的执行都需要若干时钟周期。
………………………..第13页翻译Unit-2III. (1) 对于详细说明软件需求中的困难,根本原因源于其涉及客户、最终用户、以及软件开发人员的有关三方.。
第22页翻译III. (1) 正如我们所知,指示一台计算机如何执行一项任务的指令被称为计算机程序。
(2) 这类软件包含大量数据——不像数据库软件,数据库软件销售时不带任何数据。
…………………………….第27页翻译Unit-3III. (1) 为了即使在风险存在的情况下能够达到项目目标,需要适当的风险管理。
(2) 通过适当的监控,这些情况能够被识别,从而可以相应地改变计划。
………………………………….第38页翻译III. (1) 不过,主要区别在于,多用户操作系统排定在一个集中式计算机上的处理请求,而网络操作系统仅仅是将数据和程序路由到每个用户的本地计算机,实际处理是发生在每个用户的本地计算机上。
……………………….第42页翻译Unit-4III. (1) 详细进度安排只有在实际的人员分配已经完成之后才进行,因为任务分配需要团队成员能力的相关信息。
(2) 小组目标由全体成员的一致同意来设定,并且每位成员的提议可用于重要决定。
…………………………………………….第52页翻译III. (1) 以太网是一种可用于几乎所有类型的计算机,描述数据如何能够在计算机与通常在近距离的其它网络设备之间以包的形式发送的局域网技术。
…………………第58页翻译Unit-5III. (1) 以数据结构为中心的设计(例如,Jackson方法,Warnier-Orr方法)从程序操作的数据结构着手,而不是从其实现的功能着手。
大连东软信息学院
毕业设计(论文)外文资料及译文
系所:
专业:
班级:
姓名:
学号:
大连东软信息学院
Dalian Neusoft University of Information
外文资料和译文格式要求
一、装订要求
1、外文资料原文(复印或打印)在前、译文在后、最后为指导教师评定成绩。
2、译文必须采用计算机输入、打印。
3、A4幅面打印,于左侧装订。
二、撰写要求
1、外文文献内容与所选课题相关。
2、译文汉字字数不少于4000字。
三、格式要求
1、译文字号:中文小四号宋体,英文小四号“Times New Roman”字型,全文统一,首行缩进2个中文字符,1.5倍行距。
2、译文页码:页码用阿拉伯数字连续编页,字体采用“Times New Roman”字体,字号小五,页底居中。
3、译文页眉:眉体使用单线,页眉说明五号宋体,居中“大连东软信息学院本科毕业设计(论文)译文”。
大连东软信息学院毕业设计(论文)译文
-1-。
毕业设计(论文)外文资料翻译系:计算机系专业:计算机科学与技术姓名:学号:外文出处:Ghosh,D..Java Object-oriented(用外文写)programming[J]. IEEE Transactionson SoftwareEngineering,2009, 13(3):42-45.附件: 1.外文资料翻译译文;2.外文原文。
注:请将该封面与附件装订成册。
附件1:外文资料翻译译文Java的面向对象编程——面向对象编程和它的关键技术—继承和多态性软件的重用可以节省程序开发时间。
它鼓励重复使用已经调试好的高质量的软件,从而减少系统运行后可能出现的问题。
这些都是令人振奋的可能性。
多态性允许我们用统一的风格编写程序,来处理多种已存在的类和特定的相关类。
利用多态性我们可以方便地向系统中添加新的功能。
继承和多态对于解决软件的复杂性是一种有效可行的技术。
当创建一个新的类时,而不用完整的写出新的实例变量和实例方法,程序员会指定新的类继承已定义的超类的实例变量和实例方法。
这个新的类被称为一个子类。
每个子类本身将来亦可有新的子类,而其本身将成为父类。
一个类的直接父类就是该类所直接继承的类(通过关键字extends继承)。
一个间接超类是通过从两级或更多级以上的类继承而来的。
例如,从类JApplet(包javax.swing 中)扩展来的类Applet(包java.applet)。
一个类单一的从一个父类继承而来。
Java 不支持多重继承(而C++可以),但它支持接口的概念。
接口可以使Java实现许多通过多重继承才能实现的优点而没有关联的问题。
我们将在本章讨论的接口的详细内容。
我们会给出创建和使用接口的一般规律和具体实例。
一个子类通常添加自己的实例变量和自己的实例方法,因此子类通常比父类大。
一个子类比它的父类更具体并且代表一组更小、更专业的对象。
通过单一继承,子类在开始时拥有父类的所有特性。
继承性真正的力量在于它可以在定义子类时增加或取代从超类中继承来的特征。
淮阴工学院毕业设计说明书(论文)作者: ** 学号:10813013**学院: 计算机工程专业: 计算机科学与技术题目: 专家系统指导者:(姓名) (专业技术职务)评阅者:(姓名) (专业技术职务)年月毕业设计说明书(论文)中文摘要系统介绍:专家系统是一种计算机程序,是计算机科学的一个分支主要研究人工智能。
人工智能的科学目标是能让计算机程序展示智能行为。
它关注象征性的推理或推理的概念和方法,以及如何使用知识将这些理论放入一台机器内。
当然,长期的智能包含了很多认知技能,包括解决问题,学习,理解语言的能力,人工智能能解决所有的这些问题。
但大多数已经取得的进展,已经取得了该问题的解决。
人工智能程序到达专家级解决问题的能力在任务地区将承担的知识有关的具体任务是所谓的知识或专家系统。
通常,长期的专家系统是保留程序的基础知识,包含人类专家的知识。
和教科书或非专家知识的对比,往往,专家系统和基于知识的系统公司同义。
两者合计,他们代表了人工智能应用最广泛的类型。
在专家系统捕获人类智力活动的区域被称为任务域。
域是指正在执行任务的区域,任务是指一些以目标位向导,解决问题的活动。
典型的任务是诊断,规则,调度,配置和设计。
专家系统被称为知识工程及其从业人员被称为知识的工程师。
知识工程师必须确保计算机的所有知识需要解决一个问题。
知识工程师必须选择一个或多个形式,代表所需的知识为符号模式在计算机的内存——也就是说,他(或她)必须选择一种知识表示。
他还必须确保计算机可以使用的知识有效地选择从一个几个推理方法。
实践知识工程描述。
我们首先描述了专家系统的组成部分。
专家系统的组成:每一个专家系统由两个主要部分组成:知识库和推理或推论,发动机专家系统的知识库包含事实和启发式知识。
事实性知识是任务域被广泛共享,通常在教科书或期刊,并共同商定后,在特定领域的那些知识渊博的知识启发式知识是不太严格,更多体验,更多的判断性能的知识。
在事实性知识,启发式知识很少被讨论,主要是个人主义。
附录Software Engineering-A PRACTITIONER’S APPROACHWritten by Roger S. Pressman, Ph.D. (P.340-P.343)13.3DESIGN PRINCIPLESSoftware design is both a process and a model. The design process is a sequence ofsteps that enable the designer to describe all aspects of the software to be built. It is important to note, however, that the design process is not simply a cookbook. Creative skill, past experience, a sense of what makes “good” software, and an overallcommitment to quality are critical success factors for a competent design.The design model is the equivalent of an architect’s plans for a house. It begins by representing the totality of the thing to be built (e.g., a three-dimensional renderingof the house) and slowly refines the thing to provide guidance for constructing eachdetail (e.g., the plumbing layout). Similarly, the design model that is created for softwareprovides a variety of different views of the computer software.Basic design principles enable the software engineer to navigate the design process.Davis suggests a setof principles for software design, which have beenadapted and extended in the following list:• The design process should not suffer from “tunnel vision.” A gooddesigner should consider alternative approaches, judging each based on therequirements of the the resources available to do the job, and thedesign concepts presented in Section • The design should be traceable to the analysis model. Because a singleelement of the design model often traces to multiple requirements, it is necessaryto have a means for tracking how requirements have been satisfied bythe design model.• The design should not reinvent the wheel. Systems are constructed usinga set of design patterns, many of which have likely been encountered before.These patterns should always be chosen as an alternative to reinvention.Time is short and resources are limited! Design time should be invested inrepresenting truly new ideas and integrating those patterns that already exist.• The design should “minimize the intellectual distance”between the software and the problem as it exists in the real world.That is, the structure of the software design should (whenever possible)mimic the structure of the problem domain.• The design should exhibit uniformity and integration. A design is uniformif it appears that one person developed the entire thing. Rules of styleand format should be defined for a design team before design work begins. Adesign is integrated if care is taken in defining interfaces between designComponents.• The design should be structured to accommodate change. The designconcepts discussed in the next section enable a design to achieve this principle.• The design should be structured to degrade gently, even when aberrantdata, events, or operating conditions are encountered. Welldesignedsoftware should never “bomb.” It should be designed toaccommodate unusual circumstances, and if it must terminate processing, doso in a graceful manner.• Design is not coding, coding is not design. Even when detailed proceduraldesigns are created for program components, the level of abstraction ofthe design model is higher than source code. The only design decisions madeat the coding level address the small implementation details that enable theprocedural design to be coded.• The design should be assessed for quality as it is being created, notafter the fact.A variety of design concepts (Section 13.4) and design measures(Chapters 19 and 24) are available to assist the designer in assessing quality.• The design should be reviewed to minimize conceptual (semantic)errors. There is sometimes a tendency to focus on minutiae when the design isreviewed, missing the forest for the trees. A design team should ensure thatmajor conceptual elements of the design (omissions, ambiguity, inconsistency)have been addressed before worrying about the syntax of the design model.When these design principles are properly applied, the software engineer creates a designthat exhibits both external and internal quality factors . External quality factors are those properties of the software that can be readily observed by users (e.g., speed,reliability, correctness, usability).Internal quality factors are of importance to softwareengineers. They lead to a high-quality design from the technical perspective. To achieveinternal quality factors, the designer must understand basic design concepts.13.4 DESIGN CONCEPTSA set of fundamental software design concepts has evolved over the past four decades.Although the degree of interest in each concept has varied over the years, each hasstood the test of time. Each provides the software designer with a foundation fromwhich more sophisticated design methods can be applied. Each helps the softwareengineer to answer the following questions:• What criteria can be used to partition software into individual components?• How is function or data structure detail separated from a conceptual representationof the software?• What uniform criteria define the technical quality of a software design?M. A. Jackson once said: "The beginning of wisdom for a [software engineer] is torecognize the difference between getting a program to work, and getting it right". Fundamental software design concepts provide the necessary frameworkfor "getting it right."13.4.1 AbstractionWhen we consider a modular solution to any problem, many levels of abstraction canbe posed. At the highest level of abstraction, a solution is stated in broad terms usingthe language of the problem environment. At lower levels of abstraction, a more proceduralorientation is taken. Problem-oriented terminology is coupled with implementation-oriented terminology in an effort to state a solution. Finally, at the lowestlevel of abstraction, the solution is stated in a manner that can be directly implemented.Wasserman provides a useful definition:The psychological notion of "abstraction" permits one to concentrate on a problem atsome level of generalization without regard to irrelevant low level details; use of abstractionalso permits one to work with concepts and terms that are familiar in the problem environmentwithout having to transform them to an unfamiliar structure . . .Each step in the software process is a refinement in the level of abstraction of the software solution. During system engineering, software is allocated as an element ofa computer-based system. During software requirements analysis, the software solutionis stated in terms "that are familiar in the problem environment." As we movethrough the design process, the level of abstraction is reduced. Finally, the lowestlevel of abstraction is reached when source code is generated.As we move through different levels of abstraction, we work to create proceduraland data abstractions. A procedural abstraction is a named sequence of instructionsthat has a specific and limited function. An example of a procedural abstraction wouldbe the word open for a door. Open implies a long sequence of procedural steps (e.g.,walk to the door, reach out and grasp knob, turn knob and pull door, step away frommoving door, etc.).A data abstraction is a named collection of data that describes a data objectChapter12). In the context of the procedural abstraction open, we can define a data abstractioncalled door. Like any data object, the data abstraction for door would encompassa set of attributes that describe the door (e.g., door type, swing direction, peningmechanism, weight, dimensions). It follows that the procedural abstraction open wouldmake use of information contained in the attributes of the data abstraction door.Many modern programming languages provide mechanisms for creating abstractdata types. For example, the Ada package is a programming language mechanismthat provides support for both data and procedural abstraction. The original abstractdata type is used as a template or generic data structure from which other data structurescan be instantiated.Control abstraction is the third form of abstraction used in software design. Likeprocedural and data abstraction, control abstraction implies a program control mechanismwithout specifying internal details. An example of a control abstraction is the synchronization semaphore used to coordinate activities in an operating system.The concept of the control abstraction is discussed briefly in Chapter 14.13.4.2 RefinementStepwise refinement is a top-down design strategy originally proposed by Niklaus Wirth. A program is developed by successively refining levels of procedural detail.A hierarchy is developed by decomposing a macroscopic statement of function (aprocedural abstraction) in a stepwise fashion until programming language statementsare reached. An overview of the concept is provided by Wirth: In each step (of the refinement), one or several instructions of the given program are decomposedinto more detailed instructions. This successive decomposition or refinement of specificationsterminates when all instructions are expressed in terms of any underlying computeror programming language . . . As tasks are refined, so the data may have to be refined,decomposed, or structured, and it is natural to refine the program and the data specificationsin parallel.Every refinement step implies some design decisions. It is important that . . . the programmerbe aware of the underlying criteria (for design decisions) and of the existence ofalternative solutions . . .The process of program refinement proposed by Wirth is analogous to the process of refinement and partitioning that is used during requirements analysis. The differenceis in the level of implementation detail that is considered, not the approach.Refinement is actually a process of elaboration.We begin with a statement offunction(or description of information) that is defined at a high level of abstraction. Thatis, the statement describes function or information conceptually but provides no informationabout the internal workings of the function or the internal structure of theinformation. Refinement causes the designer to elaborate on the original statement,providing more and more detail as each successive refinement (elaboration) occurs.Abstraction and refinement are complementary concepts. Abstraction enables adesigner to specify procedure and data and yet suppress low-level details. Refinementhelps the designer to reveal low-level details as design progresses. Both conceptsaid the designer in creating a complete design model as the design evolves.《软件工程-实践者的研究方法》Roger S. Pressman博士(340页-343页)13.3 设计原则软件设计是一个过程也是一个模型。
成都东软学院外文资料和译文格式要求一、译文必须采用计算机输入、打印,幅面A4。
外文资料原文(复印或打印)在前,译文在后,于左侧装订。
二、具体要求1、至少翻译一篇内容与所选课题相关的外文文献。
2、译文汉字字数不少于4000字。
3、正文格式要求:宋体五号字。
译文格式参见《译文格式要求》,宋体五号字,单倍行距。
纸张纸张为A4纸,页边距上2.54cm、下2.54cm、左3.17cm、右3.17cm。
装订外文资料原文(复印或打印)在前,译文在后封面封面的专业、班级、姓名、学号等信息要全部填写正确。
封面指导教师必须为讲师以上职称,若助教则需要配备一名讲师协助指导。
讲师在前,助教在后。
指导教师姓名后面空一个中文空格,加职称。
页眉页眉说明宋体小五,左端“XX学院毕业设计(论文)”,右端“译文”。
页眉中的学院名称要与封面学院名称一致。
字数本科4000字。
附:外文资料和译文封面、空白页成都东软学院外文资料和译文专业:软件工程移动互联网应用开发班级:2班姓名:罗荣昆学号:12310420216指导教师:2015年 12月 8日Android page layoutUsing XML-Based LayoutsW hile it is technically possible to create and attach widgets to our activity purely through Java code, the way we did in Chapter 4, the more common approach is to use an XML-based layout file. Dynamic instantiation of widgets is reserved for more complicated scenarios, where the widgets are not known at compile-time (e g., populating a column of radio buttons based on data retrieved off the Internet).With that in mind, it’s time to break out the XML and learn how to lay out Android activities that way.What Is an XML-Based Layout?As the name suggests, an XML-based layout is a specification of widgets’ relationships to each other—and to their containers (more on this in Chapter 7)—encoded in XML format. Specifi cally, Android considers XML-based layouts to be resources, and as such layout files are stored in the res/layout directory inside your Android project.Each XML file contains a tree of elements specifying a layout of widgets and their containers that make up one view hierarchy. The attributes of the XML elements are properties, describing how a widget should look or how a container should behave. For example, if a Button element has an attribute value of android:textStyle = "bold", that means that the text appearing on the face of the button should be rendered in a boldface font style.Android’s SDK ships with a tool (aapt) which uses the layouts. This tool should be automatically invoked by your Android tool chain (e.g., Eclipse, Ant’s build.xml). Of particular importance to you as a developer is that aapt generates the R.java source file within your project, allowing you to access layouts and widgets within those layouts directly from your Java code. Why Use XML-Based Layouts?Most everything you do using XML layout files can be achieved through Java code. For example, you could use setTypeface() to have a button render its textin bold, instead of using a property in an XML layout. Since XML layouts are yet another file for you to keep track of, we need good reasons for using such files.Perhaps the biggest reason is to assist in the creation of tools for view definition, such as a GUI builder in an IDE like Eclipse or a dedicated Android GUI designer like DroidDraw1. Such GUI builders could, in principle, generate Java code instead of XML. The challenge is re-reading the UI definition to support edits—that is far simpler if the data is in a structured format like XML than in a programming language. Moreover, keeping generated XML definitions separated from hand-written Java code makes it less likely that somebody’s custom-crafted source will get clobbered by accident when the generated bits get re-generated. XML forms a nice middle ground between something that is easy for tool-writers to use and easy for programmers to work with by hand as needed.Also, XML as a GUI definition format is becoming more commonplace. Microsoft’s XAML2, Adobe’s Flex3, and Mozilla’s XUL4 all take a similar approach to that of Android: put layout details in an XML file and put programming smarts in source files (e.g., JavaScript for XUL). Many less-well-known GUI frameworks, such as ZK5, also use XML for view definition. While “following the herd” is not necessarily the best policy, it does have the advantage of helping to ease the transition into Android from any other XML-centered view description language. OK, So What Does It Look Like?Here is the Button from the previous chapter’s sample application, converted into an XMLlayout file, found in the Layouts/NowRedux sample project. This code sample along with all others in this chapter can be found in the Source Code area of .<?xml version="1.0" encoding="utf-8"?><Button xmlns:android="/apk/res/android"android:id="@+id/button"android:text=""android:layout_width="fill_parent"android:layout_height="fill_parent"/>The class name of the widget—Button—forms the name of the XML element. Since Button is an Android-supplied widget, we can just use the bare class name. If you create your own widgets as subclasses of android.view.View, you would need to provide a full package declara tion as well.The root element needs to declare the Android XML namespace:xmlns:android="/apk/res/android"All other elements will be children of the root and will inherit that namespace declaration.Because we want to reference this button from our Java code, we need to give it an identifier via the android:id attribute. We will cover this concept in greater detail later in this chapter.The remaining attributes are properties of this Button instance:• android:text indicates the initial text to be displayed on the button face (in this case, an empty string)• android:layout_width and android:layout_height tell Android to have the button’swidth and height fill the “parent”, in this case the entire screen—these attributes will be covered in greater detail in Chapter 7.Since this single widget is the only content in our activity, we only need this single element. Complex UIs will require a whole tree of elements, representing the widgets and containers that control their positioning. All the remaining chapters of this book will use the XML layout form whenever practical, so there are dozens of other examples of more complex layouts for you to peruse from Chapter 7 onward.What’s with the @ Signs?Many widgets and containers only need to appear in the XML layout file and do not need to be referenced in your Java code. For example, a static label (TextView) frequently only needs to be in the layout file to indicate where it should appear. These sorts of elements in the XML file do not need to have the android:id attribute to give them a name.Anything you do want to use in your Java source, though, needs an android:id.The convention is to use @+id/... as the id value, where the ... represents your locally unique name for the widget in question. In the XML layout example in the preceding section, @+id/button is the identifier for the Button widget.Android provides a few special android:id values, of the form @android:id/.... We will see some of these in various chapters of this book, such as Chapters 8 and 10.We Attach These to the Java How?Given that you have painstakingly set up the widgets and containers in an XML layout filenamed main.xml stored in res/layout, all you need is one statement in your activity’s onCreate() callback to use that layout:setContentView(yout.main);This is the same setContentView() we used earlier, passing it an instance of a View subclass (in that case, a Button). The Android-built view, constructed from our layout, is accessed from that code-generated R class. All of the layouts are accessible under yout, keyed by the base name of the layout file—main.xml results in yout.main.To access our identified widgets, use findViewById(), passing in the numeric identifier of the widget in question. That numeric identifier was generated by Android in the R class asR.id.something (where something is the specific widget you are seeking). Those widgets are simply subclasses of View, just like the Button instance we created in Chapter 4.The Rest of the StoryIn the original Now demo, the button’s face would show the current time, which would reflect when the button was last pushed (or when the activity was first shown, if the button had not yet been pushed).Most of that logic still works, even in this revised demo (NowRedux). However,rather than instantiating the Button in our activity’s onCreate() callback, we can reference the one from the XML layout:package youts;import android.app.Activity;import android.os.Bundle;import android.view.View;import android.widget.Button; import java.util.Date;public class NowRedux extends Activity implements View.OnClickListener { Button btn;@Overridepublic void onCreate(Bundle icicle) { super.onCreate(icicle);setContentView(yout.main);btn=(Button)findViewById(R.id.button);btn.setOnClickListener(this);upd ateTime();}public void onClick(View view) { updateTime();}private void updateTime() {btn.setText(new Date().toString()); }}The first difference is that rather than setting the content view to be a view we created in Java code, we set it to reference the XML layout (setContentView(yout.main)). The R.java source file will be updated when we rebuild this project to include a reference to our layout file (stored as main.xml in our project’s res/l ayout directory).The other difference is that we need to get our hands on our Button instance, for which we use the findViewById() call. Since we identified our button as @+id/button, we can reference the button’s identifier as R.id.button. Now, with the Button instance in hand, we can set the callback and set the label as needed.As you can see in Figure 5-1, the results look the same as with the originalNow demo.Figure 5-1. The NowRedux sample activity Employing Basic WidgetsE very GUI toolkit has some basic widgets: fields, labels, buttons, etc. Android’s toolkit is no different in scope, and the basic widgets will provide a good introduction as to how widgets work in Android activities.Assigning LabelsThe simplest widget is the label, referred to in Android as a TextView. Like in most GUI toolkits, labels are bits of text not editable directly by users. Typically, they are used to identify adjacent widgets (e.g., a “Name:” label before a field where one fills in a name).In Java, you can create a label by creating a TextView instance. More commonly, though, you will create labels in XML layout files by adding a TextView element to the layout, with an android:text property to set the value of the label itself. If you need to swap labels based on certain criteria, such as internationalization, you may wish to use a resource reference in the XML instead, as will be described in Chapter 9. TextView has numerous other properties of relevance for labels, such as:• android:typeface to set the typeface to use for the label (e.g., monospace) • android:textStyle to indicate that the typeface should be made bold (bold), italic (italic),or bold and italic (bold_italic)• android:textColor to set the color of the label’s text, in RGB hex format (e.g., #FF0000 for red)For example, in the Basic/Label project, you will find the following layout file:<?xml version="1.0" encoding="utf-8"?><TextView xmlns:android=/apk/res/androidandroid:layout_width="fill_parent"android:layout_height="wrap_content"android:text="You were expecting something profound?" />As you can see in Figure 6-1, just that layout alone, with the stub Java source provided by Android’s p roject builder (e.g., activityCreator), gives you the application.Figure 6-1. The LabelDemo sample applicationButton, Button, Who’s Got the Button?We’ve already seen the use of the Button widget in Chapters 4 and 5. As it turns out, Button is a subclass of TextView, so everything discussed in the preceding section in terms of formatting the face of the button still holds. Fleeting ImagesAndroid has two widgets to help you embed images in your activities: ImageView and ImageButton. As the names suggest, they are image-based analogues to TextView and Button, respectively.Each widget takes an android:src attribute (in an XML layout) to specify what picture to use. These usually reference a drawable resource, described in greater detail in the chapter on resources. You can also set the image content based on a Uri from a content provider via setImageURI().ImageButton, a subclass of ImageView, mixes in the standard Button behaviors, for responding to clicks and whatnot.For example, take a peek at the main.xml layout from the Basic/ImageView sample project which is found along with all other code samples at : <?xml version="1.0" encoding="utf-8"?><ImageView xmlns:android=/apk/res/androidandroid:id="@+id/icon"android:layout_width="fill_parent"android:layout_height="fill_parent"android:adjustViewBounds="true"android:src="@drawable/molecule" />The result, just using the code-generated activity, is shown in Figure 6-2.Figure 6-2. The ImageViewDemo sample applicationFields of Green. Or Other Colors.Along with buttons and labels, fields are the third “anchor” of most GUI toolkits. In Android, they are implemented via the EditText widget, which is a subclass of the TextView used for labels.Along with the standard TextView properties (e.g., android:textStyle), EditText has many others that will be useful for you in constructing fields, including:• android:autoText, to control if the fie ld should provide automatic spelling assistance• android:capitalize, to control if the field should automatically capitalize the first letter of entered text (e.g., first name, city) • android:digits, to configure the field to accept only certain digi ts • android:singleLine, to control if the field is for single-line input or multiple-line input (e.g., does <Enter> move you to the next widget or add a newline?)Beyond those, you can configure fields to use specialized input methods, such asandroid:numeric for numeric-only input, android:password for shrouded password input,and android:phoneNumber for entering in phone numbers. If you want to create your own input method scheme (e.g., postal codes, Social Security numbers), you need to create your own implementation of the InputMethod interface, then configure the field to use it via android: inputMethod.For example, from the Basic/Field project, here is an XML layout file showing an EditText:<?xml version="1.0" encoding="utf-8"?><EditTextxmlns:android=/apk/res/androidandroid:id="@+id/field"android:layout_width="fill_parent"android:layout_height="fill_parent"android:singleLine="false" />Note that android:singleLine is false, so users will be able to enter in several lines of text. For this project, the FieldDemo.java file populates the input field with some prose:package monsware.android.basic;import android.app.Activity;import android.os.Bundle;import android.widget.EditText;public class FieldDemo extends Activity { @Overridepublic void onCreate(Bundle icicle) { super.onCreate(icicle);setContentView(yout.main);EditText fld=(EditText)findViewById(R.id.field);fld.setText("Licensed under the Apache License, Version 2.0 " + "(the \"License\"); you may not use this file " + "except in compliance with the License. You may " + "obtain a copy of the License at " +"/licenses/LICENSE-2.0");}}The result, once built and installed into the emulator, is shown in Figure 6-3.Figure 6-3. The FieldDemo sample applicationNote Android’s emulator only allows one application in the launcher per unique Java package. Since all the demos in this chapter share the monsware.android.basic package, you will only see one of these demos in your emulator’s launcher at any one time.Another flavor of field is one that offers auto-completion, to help users supply a value without typing in the whole text. That is provided in Android as the AutoCompleteTextView widget and is discussed in Chapter 8.Just Another Box to CheckThe classic checkbox has two states: checked and unchecked. Clicking the checkbox toggles between those states to indicate a choice (e.g., “Ad d rush delivery to my order”). In Android, there is a CheckBox widget to meet this need. It has TextView as an ancestor, so you can use TextView properties likeandroid:textColor to format the widget. Within Java, you can invoke: • isChecked() to determi ne if the checkbox has been checked• setChecked() to force the checkbox into a checked or unchecked state • toggle() to toggle the checkbox as if the user checked itAlso, you can register a listener object (in this case, an instance of OnCheckedChangeListener) to be notified when the state of the checkbox changes.For example, from the Basic/CheckBox project, here is a simple checkbox layout:<?xml version="1.0" encoding="utf-8"?><CheckBox xmlns:android="/apk/res/android"android:id="@+id/check"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="This checkbox is: unchecked" />The corresponding CheckBoxDemo.java retrieves and configures the behavior of the checkbox:public class CheckBoxDemo extends Activityimplements CompoundButton.OnCheckedChangeListener { CheckBox cb;@Overridepublic void onCreate(Bundle icicle) { super.onCreate(icicle);setContentView(yout.main);cb=(CheckBox)findViewById(R.id.check);cb.setOnCheckedChangeListener(this);}public void onCheckedChanged(CompoundButton buttonView,boolean isChecked) {if (isChecked) {cb.setText("This checkbox is: checked");}else {cb.setText("This checkbox is: unchecked");}}}Note that the activity serves as its own listener for checkbox state changes since it imple ments the OnCheckedChangeListener interface (via cb.setOnCheckedChangeListener(this)). The callback for the listener is onCheckedChanged(), which receives the checkbox whose state has changed and what the new state is. In this case, we update the text of the checkbox to reflect what the actual box contains.The result? Clicking the checkbox immediately updates its text, as you can see in Figures 6-4 and 6-5.Figure 6-4. The CheckBoxDemo sample application, with the checkbox uncheckedFigure 6-5. The same application, now with the checkbox checkedTurn the Radio UpAs with other implementations of radio buttons in other toolkits, Android’s radio buttons are two-state, like checkboxes, but can be grouped such that only one radio button in the group can be checked at any time.Like CheckBox, RadioButton inherits from CompoundButton, which in turn inherits fromTextView. Hence, all the standard TextView properties for font face, style, color, etc., are available for controlling the look of radio buttons. Similarly, you can call isChecked() on a RadioButton to see if it is selected, toggle() to select it, and so on, like you can with a CheckBox.Most times, you will want to put your RadioButton widgets inside of aRadioGroup. The RadioGroup indicates a set of radio buttons whose state is tied, meaning only one button out of the group can be selected at any time. If you assign an android:id to your RadioGroup in your XML layout, you can access the group from your Java code and invoke:• check() to check a specific radio button via its ID (e.g., group.check(R.id.radio1))• clearCheck() to clear all radio buttons, so none in the group are checked• getCheckedRadioButtonId() to get the ID of the currently-checked radio button (or -1 if none are checked)For example, from the Basic/RadioButton sample application, here is an XML layout showing a RadioGroup wrapping a set of RadioButton widgets: <?xml version="1.0" encoding="utf-8"?> <RadioGroupxmlns:android=/apk/res/androidandroid:orientation="vertical"android:layout_width="fill_parent"android:layout_height="fill_parent" ><RadioButton android:id="@+id/radio1"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Rock" /><RadioButton android:id="@+id/radio2"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Scissors" /><RadioButton android:id="@+id/radio3"android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="Paper" /></RadioGroup>Figure 6-6 shows the result using the stock Android-generated Java forthe project and this layout.Figure 6-6. The RadioButtonDemo sample application Note that the radio button group is initially set to be completely unchecked at the outset. To pre-set one of the radio buttons to be checked, use either setChecked() on the RadioButton or check() on the RadioGroup from within your onCreate() callback in your activity.It’s Quite a ViewAll widgets, including the ones previously shown, extend View, and as such give all widgets an array of useful properties and methods beyond those already described.Useful PropertiesSome of the properties on View most likely to be used include:• Controls the focus sequence:• android:nextFocusDown• android:nextFocusLeft• android:nextFocusRight• android:nextFocusUp• android:visibility, which controls wheth er the widget is initially visible• android:background, which typically provides an RGB color value (e.g., #00FF00 for green) to serve as the background for the widgetUseful MethodsYou can toggle whether or not a widget is enabled via setEnabled() and see if it is enabled via isEnabled(). One common use pattern for this is to disable some widgets based on a CheckBox or RadioButton selection.You can give a widget focus via requestFocus() and see if it is focused via isFocused(). You might use this in concert with disabling widgets as previously mentioned, to ensure the proper widget has the focus once your disabling operation is complete.To help navigate the tree of widgets and containers that make up an activity’s overall view, you can use:• get Parent() to find the parent widget or container• findViewById() to find a child widget with a certain ID• getRootView() to get the root of the tree (e.g., what you provided to the activity via setContentView())Android 页面布局使用XML进行布局虽然纯粹通过Java代码在activity上创建和添加部件,在技术上是可行的,我们在第4章中做的一样,更常见的方法是使用一种基于XML的布局文件。
毕业论文外文翻译要求
外国文献翻译是撰写毕业论文的重要环节之一,下面是一份要求700字的毕业论文外文翻译要求:
1. 翻译时间: 需在规定时间内完成翻译任务,以确保毕业论文
后续工作的顺利进行。
2. 原文准确性: 翻译必须准确无误,不得对原文进行任何删节、增补或变动。
3. 语言流畅度: 翻译应当具有良好的语言流畅度,不得过于生
硬或呆板。
4. 专业术语准确性: 翻译时要确保专业术语的准确性,避免词
义的混淆。
5. 语法错误及标点符号: 翻译应符合英文的语法规范,避免语
法错误和标点符号的错误使用。
6. 翻译风格: 翻译应当符合学术论文的要求,措辞恰当,语气
客观中立。
7. 格式要求: 翻译部分应与论文正文的格式一致,包括字体、
字号、行间距等。
8. 校对: 完成翻译后,需要进行一次仔细的校对工作,确保翻
译的正确性。
9. 原文附录: 翻译部分要同时附上原文,以便审查人员对翻译的准确性进行核对。
10. 翻译文档: 翻译文档要以电子文档的形式提交,确保方便审查人员查看。
以上要求旨在保证翻译的质量和准确性,对于撰写毕业论文非常重要。
翻译过程中,建议使用专业的翻译工具,如翻译记忆软件、专业词典等,以提高翻译的效率和准确性。
同时,积极与导师和专业领域的人进行交流和讨论,以解决翻译中的问题和困惑。
外文原文ANALYSIS OF DATABASE PROGRAMMING IN VB VB (Visual Basic) is a visualization programming environment that Microsoft Corporation promotes based on the Basic language.It is simple and easy to study.It has formidable function so that many computer amateurs really like it.A lot of application softwares all use VB as the software development platform.When we use VB to develop the application software,how to use the database and carry on the management of the database is concerned by all exploiters.VB has provided many tools and methods for database programming.What method is used to visit the database depends on users’different demands,a simple analysis of the VB database programming is explained as followings.1.DAO TechnologyBy using Microsoft company’s Jet Database Engine (Jet database engine),DAO (Data Access Object) the technology mainly provides visit to ISAM (smooth index search method) type database,such as the realization of the visit to database like FoxPro,Access, Dbase.1.1 Use Data ControlsData controls are produced by using “Data” button in the toolbox.It has 3 basic attributes:Connect,Database Name and RecordSource.Connect attribute specifys the database type that data controls visit,the default database is the Access database.The value of the Database Name attribute is the database filename which contains the complete path.The Record Source attribute is the recordset that we visit,also can be tables or SQL sentences.If we will visit table stud of database file teacher mdb of TEMP folder under D plate,then Data controls’s Connect attribute is null,and the Database Name attribute is “D: \temp \ teacher mdb”,the value of the Record Source attribute is “stud”.This can accomplish the binding between Data controls and database records. Through the methods of Data controls like Add new,Update,Delete, Move last,we can visit the database as every request.When we browse the content in database,Data controlls is used frequently with DBGrid,it provides data inquiry in grid way.1.2 Use DAO Object StorehouseThe model of the DAO object storehouse is mainly using hierarchical structure, Dentine is the object in the topmost story,below it are two object sets,Errors and workspace, under the workspace object,is the Databases set.When the applicationprocedure quotes the DAO object storehouse,it produces only a Dentine object,and produces a default automatical working space object named workspace.When not mentioned,all database operations are all work in workspace(0),which is a default work area.But we must pay attention:The Jet engine will not starts automatically after VB has been loaded. Only when we choose References in the menu of Project can we select Microsoft DAO 3.5 Object Library to use.We create databases with the method “Create Database” in DAO,use “CreateTable” method to bulid tables,use the “Open Database ” to open the database ,use “Open recordset”method to open recordset,use Add new,Update,Delete,Move first,Edit methods to realize each kind of operations about tables.2.RDO TechnologyRDO provides a connection to related ODBC data pool.When we need to visit other databases like SQL Server,Oracle,especially to establish the customer/server application procedure,we may use the long range data controls RDC (Remote Data Control) and long range data objects RDO (Remote Data Control) to realize the visit to the database through the ODBC driver.By using ODBC to visit some database we must first install the corresponding drivers,like establish a data pool,through assigned data pool to visit corresponding database.To establish the ODBC data pool is open the window of “the control panel”, double-clicks the icon of ODBC executive program,single-click “Add” butt on to create the data pool of the opening ODBC data pool supervisor dialog box,and choose corresponding database.2.1 Use RDC ControlsSimilar to the use of DATA Controls, we use Data source name attributes to assign the data source name that controls bind,and we use SQL attributes to assign the recordset, The difference is that,we have to use the SQL sentences to assign the SQL attribute in RDC Controls . When we browse the database we may find it is used with DBGrid frequently.2.2 Use RDO Object StorehouseBefore we use RDO object,we should choose References in the menu of Project, click”Microsoft Remote Data Object 2.0”,then we can continue.The step we use RDO to visit the ODBC data pool is:(1) Set a RDO environment object.(2) Open an ODBC data pool with the method of Open connection.(3) Establish a result object with the method of Open Result set.(4) Use assigned method to operate the records of resultset.After founds the as this result collection object,is similar with the DAO object storehouse use,may through transfer method realizations and so on its Add new,Update, Delete visit to assign the data pool each kind of request.3.ADO TechnologyADO (ActiveX Data Objects) is the latest data access technology of Microsoft,It uses data accessing connection UDA (Universal Data Access),to standard all datas as a kind of data pool,through the filtration of OLEDB connection,transforms as a kind of general data format in the same way,enables the application procedure to visit this kind of datas.OLEDB is an underlying level of the data accessing connection,with it we may visit kinds of data pools,including traditional related databases,as well as electronic mail system and self-definition commercial object.3.1 Use ADO ControlsSingle-click the Components command in the menu of the Project,select “Microsoft ADO Data Control in the Components dialog box 6.0 (OLE DB)”,we may add ADO controls to the box of controls.We set the OLEDB Provider and assigned database file by setting the Connection string attribute of ADO,and we set the Record Source attribute as record source that ADO connected.Similar to DAO and RDO, with it, we are able to visit all kinds of database fastly.3.2 Use The ADO Object StorehouseSingle click the References orders in the Project menu, select “Microsoft ActiveX Data Objects 2.0 Library” in the References dialog box, you may add ADO object.Old object models, like DAO and RDO, are look like levels,a lower data object like Recordset is the sub-object of higher level objects like Environment and the Queried. But ADO is actually different, it defined a group of plane top object, the most importantADO objects are Connection, Recordset and Command.The Connection object is used to establish the connection of application procedure and the data pool.The Command object is used in defining a SQL sentence, a memory process or other commands that operates the datas.Recordset object preserves recordsets after executions.By using alternative means of the recordset object, we can modify,delete and inquire the recordset.4 ConclusionsVB provides many methods to accomplish the operation to the database, in which DAO mainly finish the visit to ISAM database, RDO provides connection to the ODBC data pool, both RDO and DAO have developed as matured technology.Before VB 6.0 ,the main technology is about database visit, however,the Active Data Objects(ADO) ,as new generation of database interface which is promoted by Microsoft, is designed to work with new data accessing level OLEDB, so that it provides general data accessing (Universal Data Access), it provides quite a lot advantages to the programmers, including easy use, the familiar contact surface, high velocity ,as well as the lower memory. As a result of above reasons, ADO will gradually replace other data accessing connections, and will becomes the fundamental mode of the VB of visit database.中文译文VB的数据库编程分析VB(Visual Basic)是微软公司推出的基于Basic语言的可视化编程环境,以其简单易学、功能强大而倍受广大电脑爱好者的青睐。
毕业设计外文翻译范例引言在大学生的学习生涯中,毕业设计是一项重要的任务。
它是对学生在大学期间所学知识的综合运用,也是对学生能力的一次全面考核。
外文翻译作为毕业设计的一部分,对于提高学生的英语水平和跨文化交流能力有着重要的作用。
本文将探讨毕业设计外文翻译的重要性、挑战以及解决方法。
毕业设计外文翻译的重要性外文翻译在毕业设计中具有重要的地位和作用。
首先,外文翻译可以帮助学生扩大知识面,并且了解国际上的研究动态和前沿技术。
通过翻译外文文献,学生可以学习到最新的研究成果和方法,为毕业设计提供参考和借鉴。
其次,外文翻译能够提高学生的英语水平。
通过翻译外文文献,学生可以锻炼自己的听、说、读、写能力,提高对英语的理解和应用能力。
在全球化的背景下,具备良好的英语能力对于学生的就业和未来发展具有重要意义。
最后,外文翻译可以培养学生的跨文化交流能力。
在进行外文翻译的过程中,学生需要了解不同文化背景下的表达方式和思维方式,从而更好地与其他文化背景的人进行沟通和交流。
这对于提高学生的跨文化合作能力和全球视野具有重要意义。
毕业设计外文翻译的挑战尽管毕业设计外文翻译具有重要的作用,但也面临一些挑战。
首先,外文翻译需要学生具备良好的英语水平和专业知识。
许多外文文献使用专业术语和复杂的句式,对学生的英语能力和专业知识提出了较高的要求。
同时,外文翻译还要求学生具备良好的分析能力和逻辑思维能力,能够准确理解和表达文献中的内容。
其次,外文翻译需要花费大量的时间和精力。
翻译一篇外文文献需要学生仔细阅读和理解原文,然后进行翻译和校对。
这个过程需要反复推敲和修正,耗费了学生大量的时间和精力。
在繁重的学业任务中,学生可能面临时间不足的问题,影响翻译质量和效率。
最后,外文翻译还可能面临文化差异和语言障碍。
不同的语言和文化有着不同的表达方式和思维方式,学生需要充分理解和融入到原文的语言和文化中,才能进行准确和恰当的翻译。
这对学生的跨文化交流能力提出了较高的要求。
软件工程专业毕业设计外文文献翻译A HISTORICAL PERSPECTIVEFrom the earliest days of computers, storing and manipulating data have been a major application focus. The first general-purpose DBMS was designed by Charles Bachman at General Electric in the early 1960s and was called the Integrated Data Store. It formed the basis for the network data model, which was standardized by the Conference on Data Systems Languages (CODASYL) and strongly influenced database systems through the 1960s. Bachman was the first recipient of A CM’s Turing Award (the computer science equivalent of a Nobel prize) for work in the database area; he received the award in 1973. In the late 1960s, IBM developed the Information Management System (IMS) DBMS, used even today in many major installations. IMS formed the basis for an alternative data representation framework called the hierarchical data model. The SABRE system for making airline reservations was jointly developed by American Airlines and IBM around the same time, and it allowed several people to access the same data through computer network. Interestingly, today the same SABRE system is used to power popular Web-based travel services such as Travelocity!In 1970, Edgar Codd, at IBM’s San Jose Research Laboratory, proposed a new datarepresentation framework called the relational data model. This proved to be a watershed in the development of database systems: itsparked rapid development of several DBMSs based on the relational model, along with a rich body of theoretical results that placed the field on a firm foundation. Codd won the 1981 Turing Award for his seminal work. Database systems matured as an academic discipline, and the popularityof relational DBMSs changed the commercial landscape. Their benefits were widely recognized, and the use of DBMSs for managing corporate data became standard practice.In the 1980s, the relational model consolidated its position as the dominant DBMS paradigm, and database systems continued to gain widespread use. The SQL query language for relational databases, developed as part of IBM’s System R project, is now the standard query language.SQL was standardized in the late 1980s, and the current standard,SQL-92, was adopted by the American National Standards Institute (ANSI) and 1International Standards Organization (ISO). Arguably, the mostwidely used form of concurrent programming is the concurrent executionof database programs (called transactions). Users write programs as if they are to be run by themselves, and the responsibility for running them concurrently is given to the DBMS. James Gray won the 1999 Turing award for his contributions to the field of transaction management in a DBMS.In the late 1980s and the 1990s, advances have been made in manyareas of database systems. Considerable research has been carried outinto more powerful query languages and richer data models, and there has been a big emphasis on supporting complex analysis of data from all parts of an enterprise. Several vendors (e.g., IBM’s DB2, Oracle 8, Informix UDS) have extended theirsystems with the ability to store new data types such as images and text, and with the ability to ask more complex queries. Specialized systems have been developed by numerous vendors for creating data warehouses, consolidating data from several databases, and for carrying out specialized analysis.An interesting phenomenon is the emergence of several enterprise resource planning(ERP) andmanagement resource planning (MRP) packages, which add a substantial layer ofapplication-oriented features on top of a DBMS. Widely used packages include systems from Baan, Oracle, PeopleSoft, SAP, and Siebel. These packages identify a set of common tasks (e.g., inventory management, human resources planning, financial analysis) encountered by a large number of organizations and provide a general application layer to carry out these tasks. The data is stored in a relational DBMS, and the application layer can be customized to different companies, leading to lower Introduction to Database Systems overall costs for the companies, compared to the cost of building the application layer from scratch. Most significantly, perhaps, DBMSs have entered the Internet Age. While the first generation of Web sites stored their data exclusively inoperating systems files, the use of a DBMS to store data that is accessed through a Web browser is becoming widespread. Queries are generated through Web-accessible forms and answers are formatted using a markup language such as HTML, in order to be easily displayed in a browser. All the database vendors are adding features to their DBMS aimed at making it more suitable for deployment over the Internet. Database management continues to gain importance as more and more datais brought on-line, and made ever more accessible 2through computer networking. Today the field is being driven by exciting visions such as multimedia databases, interactive video,digital libraries, a host of scientific projects such as the human genome mapping effort and NASA’s Earth Observation System project, and the desire ofcompanies to consolidate their decision-making processes and mine their data repositories for useful information about their businesses. Commercially, database manage- ment systems represent one of the largest and most vigorous market segments. Thusthes- tudy of database systems could prove to be richly rewarding in more ways than one!INTRODUCTION TO PHYSICAL DATABASE DESIGNLike all other aspects of database design, physical design must be guided by the nature of the data and its intended use. In particular, it is important to understand the typical workload that the database must support; the workload consists of a mix of queries and updates. Users also have certain requirements about how fast certain queries or updatesmust run or how many transactions must be processed per second. The workload description and users’ performance requirements are the basis on which a number of decisions have to be made during physical database design.To create a good physical database design and to tune the system for performance in response to evolving user requirements, the designer needs to understand the workings of a DBMS, especially the indexing and query processing techniques supported by the DBMS. If the database is expected to be accessed concurrently by many users, or is a distributed database, the task becomes more complicated, and other features of a DBMS come into play.DATABASE WORKLOADSThe key to good physical design is arriving at an accurate description of the expected workload. A workload description includes the following elements:1. A list of queries and their frequencies, as a fraction of all queries and updates.2. A list of updates and their frequencies.33. Performance goals for each type of query and update.For each query in the workload, we must identify:Which relations are accessed.Which attributes are retained (in the SELECT clause).Which attributes have selection or join conditions expressed on them (in the WHERE clause) and how selective these conditions are likely to be. Similarly, for each update in the workload, we must identify: Which attributes have selection or join conditions expressed on them (in the WHERE clause) and how selective these conditions are likely to be.The type of update (INSERT, DELETE, or UPDATE) and the updated relation. For UPDATE commands, the fields that are modified by the update.Remember that queries and updates typically have parameters, for example, a debit or credit operation involves a particular account number. The values of these parameters determine selectivity ofselection and join conditions.Updates have a query component that is used to find the target tuples. This component can benefit from a good physical design and the presence of indexes. On the other hand, updates typically require additional work to maintain indexes on the attributes that they modify. Thus, while queries can only benefit from the presence of an index, an index may either speed up or slow down a given update. Designers should keep this trade-offer in mind when creating indexes.NEED FOR DATABASE TUNINGAccurate, detailed workload information may be hard to come by while doing the initial design of the system. Consequently, tuning a database after it has been designed and deployed is important—we must refine theinitial design in the light of actual usage patterns to obtain the best possible performance.The distinction between database design and database tuning is somewhat arbitrary. We could consider the design process to be over once an initial conceptual schema is designed and a set of indexing and clustering decisions is made. Any subsequent changes 4to the conceptual schema or the indexes, say, would then be regarded as a tuning activity. Alternatively, we could consider some refinementof the conceptual schema (and physical design decisions affected by this refinement) to be part of the physical design process.Where we draw the line between design and tuning is not very important.OVERVIEW OF DATABASE TUNINGAfter the initial phase of database design, actual use of the database provides a valuable source of detailed information that can be used to refine the initial design. Many of the original assumptionsabout the expected workload can be replaced by observed usage patterns; in general, some of the initial workload specification will be validated, and some of it will turn out to be wrong. Initial guesses about the size of data can be replaced with actual statistics from the system catalogs (although this information will keep changing as the system evolves). Careful monitoring of queries can reveal unexpected problems; for example, the optimizer may not be using some indexes as intended to produce good plans.Continued database tuning is important to get the best possible performance.TUNING THE CONCEPTUAL SCHEMAIn the course of database design, we may realize that our current choice of relation schemas does not enable us meet our performance objectives for the given workload with any (feasible) set of physical design choices. If so, we may have to redesign our conceptual schema (and re-examinephysical design decisions that are affected by the changes that we make).We may realize that a redesign is necessary during the initialdesign process or later, after the system has been in use for a while. Once a database has been designed and populated with data, changing the conceptual schema requires a significant effort in terms of mapping the contents of relations that are affected. Nonetheless, it may sometimes be necessary to revise the conceptual schema in light of experience with the system. We now 5consider the issues involved in conceptual schema (re)design fromthe point of view of performance.Several options must be considered while tuning the conceptual schema:We may decide to settle for a 3NF design instead of a BCNF design.If there are two ways to decompose a given schema into 3NF or BCNF, our choice should be guided by the workload.Sometimes we might decide to further decompose a relation that is already in BCNF. In other situations we might denormalize. That is, we might choose to replace a collection of relations obtained by a decomposition from a larger relation with the original (larger) relation, even though it suffers from some redundancy problems. Alternatively, we might choose to add some fields to certain relations to speed up some important queries, even if this leads to a redundant storage of some information (and consequently, a schema that is in neither 3NF nor BCNF).This discussion of normalization has concentrated on the techniqueof decomposition, which amounts to vertical partitioning of a relation. Another technique to consider is horizontal partitioning of a relation, which would lead to our having two relations with identical schemas.Note that we are not talking about physically partitioning the cuples ofa single relation; rather, we want to create two distinct relations (possibly with different constraints and indexes on each).Incidentally, when we redesign the conceptual schema, especially ifwe are tuning an existing database schema, it is worth considering whether we should create views to mask these changes from users for whom the original schema is more natural.TUNING QUERIES AND VIEWSIf we notice that a query is running much slower than we expected,we have to examine the query carefully to end the problem. Somerewriting of the query, perhaps in conjunction with some index tuning,can often ?x the problem. Similar tuning may be called for if queries on some view run slower than expected.When tuning a query, the first thing to verify is that the system is using the plan that 6you expect it to use. It may be that the system is not finding the best plan for a variety of reasons. Some common situations that are not handled efficiently by many optimizers follow:A selection condition involving null values.Selection conditions involving arithmetic or string expressions or conditions using the or connective. For example, if we have a condition E.age = 2*D.age in the WHERE clause, the optimizer may correctly utilize an available index on E.age but fail to utilize an available index on D.age. Replacing the condition by E.age/2=D.age would reverse the situation.Inability to recognize a sophisticated plan such as an index-only scan for an aggregation query involving a GROUP BY clause.If the optimizer is not smart enough to and the best plan (using access methods and evaluationstrategies supported by the DBMS), some systems allow users to guide the choice of a plan by providing hints to the optimizer; for example, users might be able to force the use of a particular index or choose the join order and join method. A user who wishes to guide optimization in this manner should have a thorough understanding of both optimization and the capabilities of the given DBMS.(8)OTHER TOPICSMOBILE DATABASESThe availability of portable computers and wireless communications has created a new breed of nomadic database users. At one level these users are simply accessing a database through a network, which is similar to distributed DBMSs. At another level the network as well as data and user characteristics now have several novel properties, which affect basic assumptions in many components of a DBMS, including the query engine, transaction manager, and recovery manager.Users are connected through a wireless link whose bandwidth is ten times less than Ethernet and 100 times less than ATM networks. Communication costs are therefore significantly higher in proportion to I/O and CPU costs.Users’ lo cations are constantly changing, and mobile computers have a limited battery life. Therefore, the true communication costs is connection time and battery usage in addition to bytes transferred, and change constantly depending on location. Data is 7frequently replicated to minimize the cost of accessing it from different locations.As a user moves around, data could be accessed from multiple database servers within a single transaction. The likelihood of losing connections is also much greater than in a traditional network. Centralized transaction management may therefore be impractical, especially if some data is resident at the mobile computers. We may infact have to give up on ACID transactions and develop alternativenotions of consistency for user programs. MAIN MEMORY DATABASES The price of main memory is now low enough that we can buy enough main memory to hold the entire database for many applications; with 64-bit addressing, modern CPUs also have very large address spaces. Some commercial systems now have several gigabytes of main memory. This shift prompts a reexamination of some basic DBMS design decisions, since disk accesses no longer dominate processing time for a memory-resident database:Main memory does not survive system crashes, and so we still have to implement logging and recovery to ensure transaction atomicity and durability. Log records must be written to stable storage at commit time, and this process could become a bottleneck. To minimize this problem, rather than commit each transaction as it completes, we can collect completed transactions and commit them in batches; this is called group commit. Recovery algorithms can also be optimized since pages rarely have to be written out to make room for other pages.The implementation of in-memory operations has to be optimized carefully since disk accesses are no longer the limiting factor for performance.A new criterion must be considered while optimizing queries, namely the amount of space required to execute a plan. It is important to minimize the space overhead because exceeding available physical memory would lead to swapping pages to disk (through the operating system’svirtual memory mechanisms), greatly slowing down execution.Page-oriented data structures become less important (since pages are no longer the unit of data retrieval), and clustering is not important (since the cost of accessing any region of main memoryis uniform).8(一)从历史的角度回顾从数据库的早期开始,存储和操纵数据就一直是主要的应用焦点。