第一篇:畢業設計(論文)外文文獻翻譯要求
畢業設計(論文)外文文獻翻譯要求
根據《浙江省教育廳高教處關于對高等學校2004屆本專科學生畢業設計(論文)進行抽查的通知》的評審要求,“本科畢業論文要求翻譯外文文獻2篇以上”。為提高畢業論文(設計)的質量,并與教育廳評審要求相一致,經研究決定,2005屆畢業論文(設計)要求翻譯2篇外文文獻,外文字符不少于1.5萬, 每篇外文文獻翻譯的中文字數一般要求2000-3000左右。
翻譯的外文文獻應主要選自學術期刊、學術會議的文章、有關著作及其他相關材料,應與畢業論文(設計)主題相關,并作為外文參考文獻列入畢業論文(設計)的參考文獻。并在每篇中文譯文首頁用“腳注”形式注明原文作者及出處,中文譯文后應附外文原文。中文譯文的基本撰寫格式為題目采用小三號黑體字居中打印,正文采用宋體五號字,行間距一般為固定值20磅,標準字符間距。
湖州師范學院(求真學院)
畢業設計(論文)外文文獻翻譯
畢業設計(論文)題目
翻譯(1)題目
翻譯(2)題目
學院 專業 姓名 班級 學號 指導教師
第二篇:4畢業設計(論文)外文文獻翻譯范文
黃石理工學院畢業設計(論文)外文文獻翻譯
模糊控制理論
摘自 維基百科 2011年11月20日
概述
模糊邏輯廣泛適用于機械控制。這個詞本身激發一個一定的懷疑,試探相當于“倉促的邏輯”或“虛假的邏輯”,但“模糊”不是指一個部分缺乏嚴格性的方法,而這樣的事實,即邏輯涉及能處理的概念,不能被表達為“對”或“否”,而是因為“部分真實”。雖然遺傳算法和神經網絡可以執行一樣模糊邏輯在很多情況下,模糊邏輯的優點是解決這個問題的方法,能夠被鑄造方面接線員能了解,以便他們的經驗,可用于設計的控制器。這讓它更容易完成機械化已成功由人執行。
歷史以及應用
模糊邏輯首先被提出是有Lotfi在加州大學伯克利分校在1965年的一篇論文。他闡述了他的觀點在1973年的一篇論文的概念,介紹了語言變量”,在這篇文章中相當于一個變量定義為一個模糊集合。其他研究打亂了,第二次工業應用中,水泥窯建在丹麥,即將到來的在線1975。
模糊系統在很大程度上在美國被忽略了,因為他們更多關注的是人工智能,一個被過分吹噓的領域,尤其是在1980年中期年代,導致在誠信缺失的商業領域。
然而日本人對這個卻沒有偏見和忽略,模糊系統引發日立的Seiji Yasunobu和Soji Yasunobu Miyamoto的興趣。,他于1985年的模擬,證明了模糊控制系統對仙臺鐵路的控制的優越性。他們的想法是被接受了,并將模糊系統用來控制加速、制動、和停車,當線于1987年開業。
1987年另一項促進模糊系統的興趣。在一個國際會議在東京的模糊研究那一年,Yamakawa論證<使用模糊控制,通過一系列簡單的專用模糊邏輯芯片,在一個“倒立擺“實驗。這是一個經典的控制問題,在這一過程中,車輛努力保持桿安裝在頂部用鉸鏈正直來回移動。
這次展示給觀察者家們留下了深刻的印象,以及后來的實驗,他登上一Yamakawa酒杯包含水或甚至一只活老鼠的頂部的鐘擺。該系統在兩種情況下,保持穩定。Yamakawa最終繼續組織自己的fuzzy-systems研究實驗室幫助利用自己的專利在田地里的時候。
黃石理工學院畢業設計(論文)外文文獻翻譯
展示之后,日本工程師開發出了大范圍的模糊系統用于工業領域和消費領域的應用。1988年,日本建立了國際模糊工程實驗室,建立合作安排48公司進行模糊控制的研究。
松下吸塵器使用微控制器運行模糊算法去控制傳感器和調整吸塵力。日立洗衣機用模糊控制器Load-Weight,Fabric-Mix和塵土傳感器及自動設定洗滌周期來最佳利用電能、水和洗滌劑。
佳能研制出的一種上相機使用電荷耦合器件(CCD)測量中的圖像清晰的六個區域其視野和使用提供的信息來決定是否這個影像在焦點上(清晰)。它也可以追蹤變化的速率在鏡頭運動的重點,以及它的速度以防止控制超調。相機的模糊控制系統采用12輸入,6個輸入了解解現行清晰所提供的數據和其他6個輸入測量CCD鏡頭的變化率的運動。輸出的位置是鏡頭。模糊控制系統應用13條規則,需要1.1 千字節記憶信息。
另外一個例子是,三菱工業空調設計采用25加熱規則和25冷卻規則。溫度傳感器提供輸入,輸出一個控制逆變器,一個壓縮機氣閥,風扇電機。和以前的設計相比,新設計的模糊控制器增加五次加熱冷卻速度,降低能耗24%,增加溫度穩定性的一個因素兩個,使用較少的傳感器。
日本人對模糊邏輯的人情是反映在很廣泛的應用范圍上,他們一直在研究或實現:例如個性和筆跡識別光學模糊系統,機器人,聲控機器人直升飛機。
模糊系統的相關研究工作也在美國和歐洲進行著。美國環境保護署分析了模糊控制節能電動機,美國國家航空和宇宙航行局研究了模糊控制自動太空對接。仿真結果表明,模糊控制系統可大大降低燃料消耗。如波音公司、通用汽車、艾倫-布拉德利、克萊斯勒、伊頓,和漩渦了模糊邏輯用于低功率冰箱、改善汽車變速箱。在1995年美泰克公司推出的一個“聰明” 基于模糊控制器洗碗機,“一站式感應模塊”包括熱敏電阻器,用來溫度測量;電導率傳感器,用來測量離子洗滌劑水平存在于洗;分散和濁度傳感器用來檢測透射光測量失禁的洗滌,以及一個磁致伸縮傳感器來讀取旋轉速率。這個系統確定最優洗周期任何載荷,獲得最佳的結果用最少的能源、洗滌劑、和水。
研究和開發還繼續模糊應用軟件,作為反對固件設計,包括模糊專家系統模糊邏輯與整合神經網絡和所謂的自適應遺傳軟件系統,其最終目的是建立“自主學習”模糊控制系統。
黃石理工學院畢業設計(論文)外文文獻翻譯
模糊集
輸入變量在一個模糊控制系統是集映射到一般由類似的隸屬度函數,稱為“模糊集”。轉換的過程中,一個干脆利落的輸入值模糊值稱為“模糊化”。
一個控制系統也有各種不同的類型開關或“開關”,連同它的模擬輸入輸入,而這樣的開關輸入當然總有一個真實的價值等于要么1或0,但該方案能對付他們,簡單的模糊函數,要么發生一個值或另一個。
賦予了“映射輸入變量的隸屬函數和進入真理價值,單片機然后做出決定為采取何種行動基于一套“規則”,每一組的形式。
在一個例子里,有兩個輸入變量是“剎車溫度”和“速度”,定義為模糊集值。輸出變量,“制動壓力” ,也定義為一個模糊集,有價值觀像“靜”、“稍微增大” “略微下降”,等等。
這條規則本身很莫名其妙,因為它看起來好像可以使用,會干擾到與模糊,但要記住,這個決定是基于一套規則。
所有的規則都調用申請,使用模糊隸屬度函數和誠實得到輸入值,確定結果的規則。這個結果將被映射成一個隸屬函數和控制輸出變量的真值。
這些結果相結合,給出了具體的(“脆”)的答案,實際的制動壓力,一個過程被稱為解模糊化,結合了模糊操作規則 “推理“描述”模糊專家系統”。
傳統的控制系統是基于數學模型的控制系統,描述了使用一個或更多微分方程確定系統回應其輸入。這類系統通常被作為“PID控制器”他們是產品的數十年的發展建設和理論分析,是非常有效的。
如果PID和其他傳統的控制系統是如此的先進,何必還要模糊控制嗎?它有一些優點。在許多情況下,數學模型的控制過程可能不存在,或太“貴”的認識論的計算機處理能力和內存,與系統的基于經驗規則可能更有效。
此外,模糊邏輯都適合低成本實現基于廉價的傳感器、低分辨率模擬/數字轉換器,或8位單片機芯片one-chip 4比特。這種系統可以很容易地通過增加新的規則升級來提高性能或添加新功能。在許多情況下,模糊控制可以用來改善現有的傳統控制器系統通過增加了額外的情報電流控制方法。
模糊控的細節
模糊控制器是很簡單的理念上。它們是由一個輸入階段,一個處理階段,一個輸
黃石理工學院畢業設計(論文)外文文獻翻譯
出階段。地圖傳感器輸入級或其他輸入,比如開關等等,到合適的隸屬函數和真理的價值。每一個適當的加工階段調用規則和產生的結果對每個人來說,然后結合結果的規則。最后,將結果輸出階段相結合的具體控制輸出回他的價值。
最常見的形狀是三角形的隸屬度函數,盡管梯形和貝爾曲線也使用,但其形狀通常比數量更重要曲線及其位置。從三人至七人通常是適當的覆蓋曲線所需要的范圍的一個輸入值,或“宇宙的話語“在模糊術語。
作為討論之前,加工階段是基于規則的集合的形式邏輯IFThen規則。作為一個例子,解釋一個規則,因為如果(溫度是“冷”),那么(加熱器是“高”)由第一階表達式冷(x)→高(y)和假設r是一個輸入這樣冷(r)是假的。然后公式冷(r)→高(t)是適用于任何一個師,因此任何不正確的控制提供了一種給r。很明顯,如果我們考慮系統的先例的規則類定義一個分區這樣一個自相矛盾的現象不會出現。在任何情況下它有時是不考慮兩個變量x和y在一條規則沒有某種功能的依賴。嚴謹的邏輯正當化中給出的模糊控制Hajek的書,被描繪成一個模糊控制理論的基本Hajek邏輯。在2005 Gerla模糊控制邏輯方法,提出了一種基于以下的想法。f模糊函數表示的系統與模糊控制相結合,即:給定輸入r,s(y)?f(r,y)是模糊集合可能的輸出。然后給出一個可能的輸出的t,我們把f(r,t)為真理程度的表示。更多的是任何系統的If-Then規則可轉化為一個模糊的程序,在這種情況下模糊函數f模糊謂詞的解釋很好(x,y)在相關的最小模糊Herbrand
模型。以這樣一種方式成為一個章模糊控制的模糊邏輯編程。學習過程成為一個問題屬于歸納邏輯理論。
黃石理工學院畢業設計(論文)外文文獻翻譯
Fuzzy Control From Wikipedia November 2011
Overview
Fuzzy logic is widely used in machine control.The term itself inspires a certain skepticism, sounding equivalent to ”half-baked logic“ or ”bogus logic“, but the ”fuzzy“ part does not refer to a lack of rigour in the method, rather to the fact that the logic involved can deal with concepts that cannot be expressed as ”true“ or ”false“ but rather as ”partially true“.Although genetic algorithms and neural networks can perform just as well as fuzzy logic in many cases, fuzzy logic has the advantage that the solution to the problem can be cast in terms that human operators can understand, so that their experience can be used in the design of the controller.This makes it easier to mechanize tasks that are already successfully performed by humans.History and applications
Fuzzy logic was first proposed by Lotfi A.Zadeh of the University of California at Berkeley in a 1965 paper.He elaborated on his ideas in a 1973 paper that introduced the concept of ”linguistic variables“, which in this article equates to a variable defined as a fuzzy set.Other research followed, with the first industrial application, a cement kiln built in Denmark, coming on line in 1975.Fuzzy systems were largely ignored in the U.S.because they were associated with artificial intelligence, a field that periodically oversells itself, especially in the mid-1980s, resulting in a lack of credibility within the commercial domain.The Japanese did not have this prejudice.Interest in fuzzy systems was sparked by Seiji Yasunobu and Soji Miyamoto of Hitachi, who in 1985 provided simulations that demonstrated the superiority of fuzzy control systems for the Sendai railway.Their ideas were adopted, and fuzzy systems were used to control accelerating, braking, and stopping when the line opened in 1987.Another event in 1987 helped promote interest in fuzzy systems.During an international meeting of fuzzy researchers in Tokyo that year, Takeshi Yamakawa demonstrated the use of fuzzy control, through a set of simple dedicated fuzzy logic chips, in an ”inverted pendulum“ experiment.This is a classic control problem, in which a vehicle tries to keep a pole mounted on its top by a hinge upright by moving back and forth.Observers were impressed with this demonstration, as well as later experiments by Yamakawa in which he mounted a wine glass containing water or even a live mouse to the top of the pendulum.The system maintained stability in both cases.Yamakawa eventually went on to organize his own fuzzy-systems research lab to help exploit his patents in the field.Following such demonstrations, Japanese engineers developed a wide range of fuzzy systems for both industrial and consumer applications.In 1988 Japan established
黃石理工學院畢業設計(論文)外文文獻翻譯
the Laboratory for International Fuzzy Engineering(LIFE), a cooperative arrangement between 48 companies to pursue fuzzy research.Matsushita vacuum cleaners use micro controllers running fuzzy algorithms to interrogate dust sensors and adjust suction power accordingly.Hitachi washing machines use fuzzy controllers to load-weight, fabric-mix, and dirt sensors and automatically set the wash cycle for the best use of power, water, and detergent.Canon developed an autofocusing camera that uses a charge-coupled device(CCD)to measure the clarity of the image in six regions of its field of view and use the information provided to determine if the image is in focus.It also tracks the rate of change of lens movement during focusing, and controls its speed to prevent overshoot.The camera's fuzzy control system uses 12 inputs: 6 to obtain the current clarity data provided by the CCD and 6 to measure the rate of change of lens movement.The output is the position of the lens.The fuzzy control system uses 13 rules and requires 1.1 kilobytes of memory.As another example of a practical system, an industrial air conditioner designed by Mitsubishi uses 25 heating rules and 25 cooling rules.A temperature sensor provides input, with control outputs fed to an inverter, a compressor valve, and a fan motor.Compared to the previous design, the fuzzy controller heats and cools five times faster, reduces power consumption by 24%, increases temperature stability by a factor of two, and uses fewer sensors.The enthusiasm of the Japanese for fuzzy logic is reflected in the wide range of other applications they have investigated or implemented: character and handwriting recognition;optical fuzzy systems;robots, voice-controlled robot helicopters Work on fuzzy systems is also proceeding in the US and Europe.The US Environmental Protection Agency has investigated fuzzy control for energy-efficient motors, and NASA has studied fuzzy control for automated space docking: simulations show that a fuzzy control system can greatly reduce fuel consumption.Firms such as Boeing, General Motors, Allen-Bradley, Chrysler, Eaton, and Whirlpool have worked on fuzzy logic for use in low-power refrigerators, improved automotive transmissions, and energy-efficient electric motors.In 1995 Maytag introduced an ”intelligent“ dishwasher based on a fuzzy controller and a ”one-stop sensing module“ that combines a thermistor, for temperature measurement;a conductivity sensor, to measure detergent level from the ions present in the wash;a turbidity sensor that measures scattered and transmitted light to measure the soiling of the wash;and a magnetostrictive sensor to read spin rate.The system determines the optimum wash cycle for any load to obtain the best results with the least amount of energy, detergent, and water.Research and development is also continuing on fuzzy applications in software, as opposed to firmware, design, including fuzzy expert systems and integration of fuzzy logic with neural-network and so-called adaptive ”genetic“ software systems, with the ultimate goal of building ”self-learning“ fuzzy control systems.黃石理工學院畢業設計(論文)外文文獻翻譯
Fuzzy sets
The input variables in a fuzzy control system are in general mapped into by sets of membership functions similar to this, known as ”fuzzy sets“.The process of converting a crisp input value to a fuzzy value is called ”fuzzification“.A control system may also have various types of switch, or ”ON-OFF“, inputs along with its analog inputs, and such switch inputs of course will always have a truth value equal to either 1 or 0, but the scheme can deal with them as simplified fuzzy functions that happen to be either one value or another.Given ”mappings“ of input variables into membership functions and truth values, the microcontroller then makes decisions for what action to take based on a set of ”rules“, each of the form.In one example, the two input variables are ”brake temperature“ and ”speed“ that have values defined as fuzzy sets.The output variable, ”brake pressure“, is also defined by a fuzzy set that can have values like ”static“, ”slightly increased“, ”slightly decreased“, and so on.This rule by itself is very puzzling since it looks like it could be used without bothering with fuzzy logic, but remember that the decision is based on a set of rules:
All the rules that apply are invoked, using the membership functions and truth values obtained from the inputs, to determine the result of the rule.This result in turn will be mapped into a membership function and truth value controlling the output variable.These results are combined to give a specific(”crisp“)answer, the actual brake pressure, a procedure known as ”defuzzification“.This combination of fuzzy operations and rule-based ”inference“ describes a ”fuzzy expert system“.Traditional control systems are based on mathematical models in which the control system is described using one or more differential equations that define the system response to its inputs.Such systems are often implemented as ”PID controllers“(proportional-integral-derivative controllers).They are the products of decades of development and theoretical analysis, and are highly effective.If PID and other traditional control systems are so well-developed, why bother with fuzzy control? It has some advantages.In many cases, the mathematical model of the control process may not exist, or may be too ”expensive“ in terms of computer processing power and memory, and a system based on empirical rules may be more effective.Furthermore, fuzzy logic is well suited to low-cost implementations based on cheap sensors, low-resolution analog-to-digital converters, and 4-bit or 8-bit one-chip microcontroller chips.Such systems can be easily upgraded by adding new rules to improve performance or add new features.In many cases, fuzzy control can be used to improve existing traditional controller systems by adding an extra layer of intelligence to the current control method.黃石理工學院畢業設計(論文)外文文獻翻譯
Fuzzy control in detail
Fuzzy controllers are very simple conceptually.They consist of an input stage, a processing stage, and an output stage.The input stage maps sensor or other inputs, such as switches, thumbwheels, and so on, to the appropriate membership functions and truth values.The processing stage invokes each appropriate rule and generates a result for each, then combines the results of the rules.Finally, the output stage converts the combined result back into a specific control output value.The most common shape of membership functions is triangular, although trapezoidal and bell curves are also used, but the shape is generally less important than the number of curves and their placement.From three to seven curves are generally appropriate to cover the required range of an input value, or the ”universe of discourse“ in fuzzy jargon.As discussed earlier, the processing stage is based on a collection of logic rules in the form of IF-THEN statements, where the IF part is called the ”antecedent“ and the THEN part is called the ”consequent“.This rule uses the truth value of the ”temperature“ input, which is some truth value of ”cold“, to generate a result in the fuzzy set for the ”heater“ output, which is some value of ”high“.This result is used with the results of other rules to finally generate the crisp composite output.Obviously, the greater the truth value of ”cold“, the higher the truth value of ”high“, though this does not necessarily mean that the output itself will be set to ”high“ since this is only one rule among many.In some cases, the membership functions can be modified by ”hedges“ that are equivalent to adjectives.Common hedges include ”about“, ”near“, ”close to“, ”approximately“, ”very“, ”slightly“, ”too“, ”extremely“, and ”somewhat“.These operations may have precise definitions, though the definitions can vary considerably between different implementations.”Very“, for one example, squares membership functions;since the membership values are always less than 1, this narrows the membership function.”Extremely“ cubes the values to give greater narrowing, while ”somewhat“ broadens the function by taking the square root.In practice, the fuzzy rule sets usually have several antecedents that are combined using fuzzy operators, such as AND, OR, and NOT, though again the definitions tend to vary: AND, in one popular definition, simply uses the minimum weight of all the antecedents, while OR uses the maximum value.There is also a NOT operator that subtracts a membership function from 1 to give the ”complementary“ function.There are several ways to define the result of a rule, but one of the most common and simplest is the ”max-min“ inference method, in which the output membership function is given the truth value generated by the premise.Rules can be solved in parallel in hardware, or sequentially in software.The results of all the rules that have fired are ”defuzzified“ to a crisp value by one of several methods.There are dozens in theory, each with various advantages and drawbacks.The ”centroid“ method is very popular, in which the ”center of mass“ of the result provides the crisp value.Another approach is the ”height“ method, which takes the value of the biggest contributor.The centroid method favors the rule with the output of
黃石理工學院畢業設計(論文)外文文獻翻譯
greatest area, while the height method obviously favors the rule with the greatest output value.The diagram below demonstrates max-min inferring and centroid defuzzification for a system with input variables ”x“, ”y“, and ”z“ and an output variable ”n“.Note that ”mu“ is standard fuzzy-logic nomenclature for ”truth value“:
Fuzzy control system design is based on empirical methods, basically a methodical approach to trial-and-error.The general process is as follows:
1.Document the system's operational specifications and inputs and outputs.2.Document the fuzzy sets for the inputs.3.Document the rule set.4.Determine the defuzzification method.5.Run through test suite to validate system, adjust details as required.6.Complete document and release to production.Logical interpretation of fuzzy control In spite of the appearance there are several difficulties to give a rigorous logical interpretation of the IF-THEN rules.As an example, interpret a rule as IF(temperature is ”cold“)THEN(heater is ”high“)by the first order formula Cold(x)→High(y)and assume that r is an input such that Cold(r)is false.Then the formula Cold(r)→High(t)is true for any t and therefore any t gives a correct control given r.Obviously, if we consider systems of rules in which the class antecedent define a partition such a paradoxical phenomenon does not arise.In any case it is sometimes unsatisfactory to consider two variables x and y in a rule without some kind of functional dependence.A rigorous logical justification of fuzzy control is given in Hájek's book ,where fuzzy control is represented as a theory of Hájek's basic logic.Also in Gerla 2005 a logical approach to fuzzy control is proposed based on the following idea.Denote by f the fuzzy function associated with the fuzzy control system, i.e., given the input r, s(y)= f(r,y)is the fuzzy set of possible outputs.Then given a possible output 't', we interpret f(r,t)as the truth degree of the claim ”t is a good answer given r".More formally, any system of IF-THEN rules can be translate into a fuzzy program in such a way that the fuzzy function f is the interpretation of a vague predicate Good(x,y)in the associated least fuzzy Herbrand model.In such a way fuzzy control becomes a chapter of fuzzy logic programming.The learning process becomes a question belonging to inductive logic theory.
第三篇:畢業設計(論文)外文文獻翻譯要求及封面
畢業設計(論文)外文文獻翻譯要求
根據《普通高等學校本科畢業設計(論文)指導》的內容,特對外文文獻翻譯提出以下要求:
一、翻譯的外文文獻一般為1~2篇,外文字符要求不少于1.5萬(或翻譯成中文后至少在3000字以上)。
二、翻譯的外文文獻應主要選自學術期刊、學術會議的文章、有關著作及其他相關材料,應與畢業論文(設計)主題相關,并作為外文參考文獻列入畢業論文(設計)的參考文獻。并在每篇中文譯文首頁用“腳注”形式注明原文作者及出處,中文譯文后應附外文原文。
三、中文譯文的基本撰寫格式為題目采用小三號黑體字居中打印,正文采用宋體小四號字,行間距一般為固定值20磅,標準字符間距。頁邊距為左3cm,右2.5cm,上下各2.5cm,頁面統一采用A4紙。
四、封面格式由學校統一制作(注:封面上的“翻譯題目”指中文譯文的題目,附件1為一篇外文翻譯的封面格式,附件二為兩篇外文翻譯的封面格式),若有兩篇外文文獻,請按“封面、譯文
一、外文原文
一、譯文
二、外文原文二”的順序統一裝訂。
教務處
2006年2月27日
杭州電子科技大學
畢業設計(論文)外文文獻翻譯
畢業設計(論文)題目
翻譯題目
學院
專業
姓名
班級
學號
指導教師
杭州電子科技大學
畢業設計(論文)外文文獻翻譯
畢業設計(論文)題目
翻譯(1)題目 翻譯(2)題目
學院
專業
姓名
班級
學號
指導教師
第四篇:畢業設計(論文)外文翻譯(原文)
畢業設計(論文)——外文翻譯(原文)
NEWAPPLICATIONOFDATABASE
Relational databases have been in use for over two decades.A large portion of the applications of relational databases have been in the commercial world, supporting such tasks as transaction processing for banks and stock exchanges, sales and reservations for a variety of businesses, and inventory and payroll for almost of all companies.We study several new applications, which have become increasingly important in recent years.First.Decision-support system
As the online availability of data has grown, businesses have begun to exploit the available data to make better decisions about increase sales.We can extract much information for decision support by using simple SQL queries.Recently however, people have felt the need for better decision support based on data analysis and data mining, or knowledge discovery, using data from a variety of sources.Database applications can be broadly classified into transaction processing and decision support.Transaction-processing systems are widely used today, and companies have accumulated a vast amount of information generated by these systems.The term data mining refers loosely to finding relevant information, or “discovering knowledge,” from a large volume of data.Like knowledge discovery in artificial intelligence, data mining attempts to discover statistical rules and patterns automatically from data.However, data mining differs from machine learning in that it deals with large volumes of data, stored primarily on disk.Knowledge discovered from a database can be represented by a set of rules.We can discover rules from database using one of two models:
In the first model, the user is involved directly in the process of knowledge discovery.In the second model, the system is responsible for automatically discovering knowledge from the database, by detecting patterns and correlations in the data.Work on automatic discovery of rules has been influenced strongly by work in the artificial-intelligence community on machine learning.The main differences lie in the volume of data handled in databases, and in the need to access disk.Specialized data-mining algorithms have been developed to handle large volumes of disk-resident data efficiently.The manner in which rules are discovered depends on the class of data-mining application.We illustrate rule discovery using two application classes: classification and associations.Second.Spatial and Geographic Databases
Spatial databases store information related to spatial locations, and provide support for efficient querying and indexing based on spatial locations.Two types of spatial databases are particularly important:
Design databases, or computer-aided-design(CAD)databases, are spatial databases used to store design information about how objects---such as buildings, cars or aircraft---are constructed.Other important examples of computer-aided-design databases are integrated-circuit and electronic-device layouts.Geographic databases are spatial databases used to store geographic information, such as maps.Geographic databases are often called geographic information systems.Geographic data are spatial in nature, but differ from design data in certain ways.Maps and satellite images are typical examples of geographic data.Maps may provide not only location information-such
as boundaries, rivers and roads---but also much more detailed information associated with locations, such as elevation, soil type, land usage, and annual rainfall.Geographic data can be categorized into two types: raster data(such data consist a bit maps or pixel maps, in two or more dimensions.), vector data(vector data are constructed from basic geographic objects).Map data are often represented in vector format.Third.Multimedia Databases
Recently, there has been much interest in databases that store multimedia data, such as images, audio, and video.Today multimedia data typically are stored outside the database, in files systems.When the number of multimedia objects is relatively small, features provided by databases are usually not important.Database functionality becomes important when the number of multimedia objects stored is large.Issues such as transactional updates, querying facilities, and indexing then become important.Multimedia objects often have descriptive attributes, such as those indicating when they were created, who created them, and to what category they belong.One approach to building a database for such multimedia objects is to use database for storing the descriptive attributes, and for keeping track of the files in which the multimedia objects are stored.However, storing multimedia outside the database makes it harder to provide database functionality, such as indexing on the basis of actual multimedia data content.It can also lead to inconsistencies, such a file that is noted in the database, but whose contents are missing, or vice versa.It is therefore desirable to store the data themselves in the database.Forth.Mobility and Personal Databases
Large-scale commercial databases have traditionally been stored in central computing facilities.In the case of distributed database applications, there has usually been strong central database and network administration.Two technology trends have combined to create applications in which this assumption of central control and administration is not entirely correct:
1.The increasingly widespread use of personal computers, and, more important, of laptop or “notebook” computers.2.The development of a relatively low-cost wireless digital communication infrastructure, base on wireless local-area networks, cellular digital packet networks, and other technologies.Wireless computing creates a situation where machines no longer have fixed locations and network addresses.This complicates query processing, since it becomes difficult to determine the optimal location at which to materialize the result of a query.In some cases, the location of the user is a parameter of the query.A example is a traveler’s information system that provides data on hotels, roadside services, and the like to motorists.Queries about services that are ahead on the current route must be processed based on knowledge of the user’s location, direction of motion, and speed.Energy(battery power)is a scarce resource for mobile computers.This limitation influences many aspects of system design.Among the more interesting consequences of the need for energy efficiency is the use of scheduled data broadcasts to reduce the need for mobile system to transmit queries.Increasingly amounts of data may reside on machines administered by users, rather than by database administrators.Furthermore, these machines may, at times, be disconnected from the network.Summary
Decision-support systems are gaining importance, as companies realize the value of the on-line data collected by their on-line transaction-processing systems.Proposed extensions to SQL, such as the cube operation, help to support generation of summary data.Data mining seeks to discover
knowledge automatically, in the form of statistical rules and patterns from large databases.Data visualization systems help humans to discover such knowledge visually.Spatial databases are finding increasing use today to store computer-aided design data as well as geographic data.Design data are stored primarily as vector data;geographic data consist of a combination of vector and raster data.Multimedia databases are growing in importance.Issues such as similarity-based retrieval and delivery of data at guaranteed rates are topics of current research.Mobile computing systems have become common, leading to interest in database systems that can run on such systems.Query processing in such systems may involve lookups on server database.畢業設計(論文)——外文翻譯(譯文)
數據庫的新應用
我們使用關系數據庫已經有20多年了,關系數據庫應用中有很大一部分都用于商業領域支持諸如銀行和證券交易所的事務處理、各種業務的銷售和預約,以及幾乎所有公司都需要的財產目錄和工資單管理。下面我們要研究幾個新的應用,近年來它們變得越來越重要。
1、決策支持系統
由于越來越多的數據可聯機獲得,企業已開始利用這些可獲得的數據來對自己的行動做出更好的決策,比如進什么貨,以及如何最好的吸引顧客以提高銷售額。我們可以通過使用簡單的SQL查詢語句提供大量用于決策支持的信息。但是,人們最近感到需要使用多種數據源的數據,以便在數據分析和數據挖掘(或知識發現)的基礎上,更好的來做決策支持。
數據庫應用從廣義上可分為事務處理和決策支持兩類。事務處理系統現在正被廣泛使用,并且公司已經積累了大量由這類系統產生的信息。
數據挖掘這個概念廣義上講是指從大量數據中發現有關信息,或“發現知識”。與人工智能中的知識發現類似,數據挖掘試圖自動從數據中發現統計規則和模式。但是,數據挖掘和機器學習的不同在于它處理的是大量數據,它們主要存儲在磁盤上。
從數據庫中發現的知識可以用一個規則集表示。我們用如下兩個模型之一從數據庫中發現規則:
● 在第一個模型中,用戶直接參與知識發現的過程
● 在第二個模型中,系統通過檢測數據的模式和相互關系,自動從數據庫中發現知識。有關自動發現規則的研究很大程度上是受人工智能領域在知識學習方面研究的影響。其主要的區別在于數據庫中處理的數據量,以及是否需要訪問磁盤。已經有一些具體的數據挖掘算法用于高效地處理放在磁盤上的大量數據。
規則發現的方式依賴于數據挖掘應用的類型。我們用兩類應用闡述規則發現:分類和關聯。
2、空間和地理數據庫
空間數據庫存儲有關空間位置的信息,并且對高效查詢和基于空間位置的索引提供支持。有兩種空間數據庫特別重要:
● 設計數據庫或計算機輔助設計(CAD)數據庫是用于存儲設計信息的空間數據庫,這些信息主要是關于物體(如建筑、汽車或是飛機)是如何構造的。另一個計算機輔助設計數據庫的重要例子是整合電路和電子設備設計圖。
● 地理數據庫是用于存儲地理信息(如地圖)的空間數據庫。地理數據庫常稱為地理信息系統。
地理數據本質上是空間的,但與設計數據相比在幾個方面有所不同。地圖和衛星圖像是地理數據的典型例子。地圖不僅可提供位置信息,如邊界、河流和道路,而且還可以提供許多和位置相關的詳細信息,如海拔、土壤類型、土地使用和年降雨量。地理數據可以分為兩類:光柵數據(這種數據由二維或更高維的位圖或像素圖組成)、矢量數據(由基本幾何對象構成)。地圖數據常以矢量形式表示。
3、多媒體數據庫
最近,有關多媒體數據(如圖像、聲音和視頻)的數據庫的研究很熱門。現在多媒體數據通常存儲在數據庫以外的文件系統中。當多媒體對象的數目相對較少時,數據庫提供的特點往往不那么重要。但是當存儲的多媒體對象數目較多時,數據庫的功能就變得重要起來。總之,事務更新、查詢機制和索引也開始變的很重要。多媒體對象常常有描述屬性,如指明它們是何時創建的、誰創建的,以及它們屬于哪一類。構造這種多媒體對象的數據庫的方法之一是用數據存儲描述屬性,并且跟蹤存儲這些媒體對象的文件。
但是,將多媒體數據存儲在數據庫之外,使得難于提供數據庫的功能,譬如基于實際多媒體數據內容的索引。此外這種情況還會造成不一致,譬如一個文件在數據庫中做了記錄,但其內容卻丟失了;或其相反情況。因此我們更希望將數據本身存儲在數據庫中。
4、移動性和個人數據庫
大型商用數據庫傳統上是存儲在中央計算設備上的。在分布式數據庫應用中,通常有強大的中央數據庫和網絡管理。然而以下這兩個技術趨勢的結合產生了一些應用,這些應用使中央控制和管理不再完全正確:
● 個人計算機越來越廣泛的使用,其中更重要的 是便攜式或“筆記本”計算機的使用。● 基于無限局域網、蜂窩數字包網絡,以及其他技術成本相對低廉的無線數字通信基礎設
施的發展。
無線計算使得計算機不必有固定的位置和網絡地址這使得查詢處理更加復雜,因為它難于決定實體化查詢結果的最佳位置。某些情況下,用戶的位置是一個查詢參數。例如,一個旅客信息系統提供關于酒店、路邊服務的信息及類似信息給乘車的旅客。有關當前道路前放服務的查詢必須根據用戶的位置、移動的方向及速度進行處理。
能源(電池能源)對應動計算機來說是有限的資源,這一限制影響了系統設計的許多方面。能源效率需求最有趣的結果之一的使用計劃的數據廣播來減少傳輸查詢中移動系統的需求。越來越多的數據會放在由用戶管理、而不是由數據庫管理員管理的計算機上,并且這些計算機有時可能與網絡斷開連接。
5、總結
隨著企業認識到聯機事務處理系統收集的聯機數據的價值,決策支持系統也越發變得重要了。現已提出SQL擴展,如cube操作,能幫助系統生成匯總數據。數據挖掘致力于從大數據庫中自動發現統計規律和模式等知識。數據可視化系統幫助人們從視覺上發現這些知識。
目前,空間數據庫正越來越多的被應用于存儲計算機輔助設計數據和地理數據。設計數據基本上是以矢量數據的形式存儲,而地理數據則包含矢量數據和光柵數據。
多媒體數據庫正變得越來越重要。基于相似性的查詢以及按可以確保的速率傳送數據是當前研究的重要課題。
移動計算系統的普及使人們對這類系統上運行的數據庫產生了濃厚的興趣。在這類系統上的查詢處理可能會設計在服務器端數據庫上的查找。
第五篇:畢業設計外文翻譯
外文原文
Overview of JSp Technology
Benefits of JSp
JSp pages are translated into servlets.So, fundamentally, any task JSp pages can perform could also be accomplished by servlets.However, this underlying equivalence does not mean that servlets and JSp pages are equally appropriate in all scenarios.The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other.After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language.But it still matters which you choose.JSp provides the following benefits over servlets alone:
?It is easier to write and maintain the HTML.Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.?You can use standard Web-site development tools.Even HTML tools that know nothing about JSp can be used because they simply ignore the JSp tags.?You can divide up your development team.The Java programmers can work on the dynamic code.The Web developers can concentrate on the presentation layer.On large projects, this division is very important.Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSp instead.By no means.Almost all projects will use both.For some requests in your project, you will use servlets.For others, you will use JSp.For still others, you will combine them with the MVC architecture.You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit.Advantages of JSp Over Competing Technologies
A number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology.Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language.Sitting several seats away was a high-level manager from a very large software company in Redmond, Washington.During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology.The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea.He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual “embrace and extend” strategy.At this point, Gosling lightheartedly interjected “You mean disgrace and distend.”
Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes.But guess what? The shoe is on the other foot here.The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags.For example, ColdFusion did it years earlier.Even ASp(a product from the very software company of the aforementioned manager)popularized this approach before JSp came along and decided to jump on the bandwagon.In fact, JSp not only adopted the general idea, it even used many of the same special tags as ASp did.So, the question becomes: why use JSp instead of one of these other technologies? Our first response is that we are not arguing that everyone should.Several of those other technologies are quite good and are reasonable options in some situations.In other situations, however, JSp is clearly better.Here are a few of the reasons.Versus.NET and Active Server pages(ASp)
.NET is well-designed technology from Microsoft.ASp.NET is the part that directly competes with servlets and JSp.The advantages of JSp are twofold.First, JSp is portable to multiple operating systems and Web servers;you aren't locked into deploying on Windows and IIS.Although the core.NET platform runs on a few non-Windows platforms, the ASp part does not.You cannot expect to deploy serious ASp.NET applications on multiple servers and operating systems.For some applications, this difference does not matter.For others, it matters greatly.Second, for some applications the choice of the underlying language matters greatly.For example, although.NET's C# language is very well designed and is similar to Java, fewer programmers are familiar with either the core C# syntax or the many auxiliary libraries.In addition, many developers still use the original version of ASp.With this version, JSp has a clear advantage for the dynamic code.With JSp, the dynamic part is written in Java, not VBScript or another ASp-specific language, so JSp is more powerful and better suited to complex applications that require reusable components.You could make the same argument when comparing JSp to the previous version of ColdFusion;with JSp you can use Java for the “real code” and are not tied to a particular server product.However, the current release of ColdFusion is within the context of a J2EE server, allowing developers to easily mix ColdFusion and servlet/JSp code.Versus pHp
pHp(a recursive acronym for “pHp: Hypertext preprocessor”)is a free, open-source, HTML-embedded scripting language that is somewhat similar to both ASp and JSp.One advantage of JSp is that the dynamic part is written in Java, which already has an extensive ApI for networking, database access, distributed objects, and the like, whereas pHp requires learning an entirely new, less widely used language.A second advantage is that JSp is much more widely supported by tool and server vendors than is pHp.Versus pure Servlets
JSp doesn't provide any capabilities that couldn't, in principle, be accomplished with servlets.In fact, JSp documents are automatically translated into servlets behind the scenes.But it is more convenient to write(and to modify!)regular HTML than to use a zillion println statements to generate the HTML.plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.Does this mean that you can just learn JSp and forget about servlets? Absolutely not!JSp developers need to know servlets for four reasons:
1.JSp pages get translated into servlets.You can't understand how JSp works without understanding servlets.2.JSp consists of static HTML, special-purpose JSp tags, and Java code.What kind of Java code? Servlet code!You can't write that code if you don't understand servlet programming.3.Some tasks are better accomplished by servlets than by JSp.JSp is good at generating pages that consist of large sections of fairly well structured HTML or other character data.Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks(such as redirection)that involve little or no output.4.Some tasks are better accomplished by a combination of servlets and JSp than by either servlets or JSp alone.Versus JavaScript
JavaScript, which is completely distinct from the Java programming language, is normally used to dynamically generate HTML on the client, building parts of the Web page as the browser loads the document.This is a useful capability and does not normally overlap with the capabilities of JSp(which runs only on the server).JSp pages still include SCRIpT tags for JavaScript, just as normal HTML pages do.In fact, JSp can even be used to dynamically generate the JavaScript that will be sent to the client.So, JavaScript is not a competing technology;it is a complementary one.It is also possible to use JavaScript on the server, most notably on Sun ONE(formerly iplanet), IIS, and BroadVision servers.However, Java is more powerful, flexible, reliable, and portable.Versus WebMacro or Velocity
JSp is by no means perfect.Many people have pointed out features that could be improved.This is a good thing, and one of the advantages of JSp is that the specification is controlled by a community that draws from many different companies.So, the technology can incorporate improvements in successive releases.However, some groups have developed alternative Java-based technologies to try to address these deficiencies.This, in our judgment, is a mistake.Using a third-party tool like Apache Struts that augments JSp and servlet technology is a good idea when that tool adds sufficient benefit to compensate for the additional complexity.But using a nonstandard tool that tries to replace JSp is a bad idea.When choosing a technology, you need to weigh many factors: standardization, portability, integration, industry support, and technical features.The arguments for JSp alternatives have focused almost exclusively on the technical features part.But portability, standardization, and integration are also very important.For example, the servlet and JSp specifications define a standard directory structure for Web applications and provide standard files(.war files)for deploying Web applications.All JSp-compatible servers must support these standards.Filters can be set up to apply to any number of servlets or JSp pages, but not to nonstandard resources.The same goes for Web application security settings.Besides, the tremendous industry support for JSp and servlet technology results in improvements that mitigate many of the criticisms of JSp.For example, the JSp Standard Tag Library and the JSp 2.0 expression language address two of the most well-founded criticisms: the lack of good iteration constructs and the difficulty of accessing dynamic results without using either explicit Java code or verbose jsp:useBean elements.10.4 Misconceptions About JSp
Forgetting JSp Is Server-Side Technology
Here are some typical questions Marty has received(most of them repeatedly).?Our server is running JDK 1.4.So, how do I put a Swing component in a JSp page?
?How do I put an image into a JSp page? I do not know the proper Java I/O commands to read image files.?Since Tomcat does not support JavaScript, how do I make images that are highlighted when the user moves the mouse over them?
?Our clients use older browsers that do not understand JSp.What should we do?
?When our clients use “View Source” in a browser, how can I prevent them from seeing the JSp tags?
All of these questions are based upon the assumption that browsers know something about the server-side process.But they do not.Thus:
?For putting applets with Swing components into Web pages, what matters is the browser's Java version—the server's version is irrelevant.If the browser supports the Java 2 platform, you use the normal AppLET(or Java plug-in)tag and would do so even if you were using non-Java technology on the server.?You do not need Java I/O to read image files;you just put the image in the directory for Web resources(i.e., two levels up from WEB-INF/classes)and output a normal IMG tag.?You create images that change under the mouse by using client-side JavaScript, referenced with the SCRIpT tag;this does not change just because the server is using JSp.?Browsers do not “support” JSp at all—they merely see the output of the JSp page.So, make sure your JSp outputs HTML compatible with the browser, just as you would do with static HTML pages.?And, of course you need not do anything to prevent clients from seeing JSp tags;those tags are processed on the server and are not part of the output that is sent to the client.Confusing Translation Time with Request Time
A JSp page is converted into a servlet.The servlet is compiled, loaded into the server's memory, initialized, and executed.But which step happens when? To answer that question, remember two points:
?The JSp page is translated into a servlet and compiled only the first time it is accessed after having been modified.?Loading into memory, initialization, and execution follow the normal rules for servlets.Table 1 gives some common scenarios and tells whether or not each step occurs in that scenario.The most frequently misunderstood entries are highlighted.When referring to the table, note that servlets resulting from JSp pages use the _jspService method(called for both GET and pOST requests), not doGet or dopost.Also, for initialization, they use the jspInit method, not the init method.Table 1.JSp Operations in Various Scenarios
JSp page translated into servletServlet compiledServlet loaded into server's memoryjspInit called_jspService called
page first written
Request 1YesYesYesYesYes
Request 2NoNoNoNoYes
Server restarted
Request 3NoNoYesYesYes
Request 4NoNoNoNoYes
page modified
Request 5YesYesYesYesYes
Request 6NoNoNoNoYes
中文翻譯
JSp技術概述
一、JSp的好處
JSp頁面最終會轉換成servler。因而,從根本上,JSp頁面能夠執行的任何任務都可以用servler來完成。然而,這種底層的等同性并不意味著servler和JSp頁面對于所有的情況都等同適用。問題不在于技術的能力,而是二者在便利性、生產率和可維護性上的不同。畢竟,在特定平臺上能夠用Java編程語言完成的事情,同樣可以用匯編語言來完成,但是選擇哪種語言依舊十分重要。
和單獨使用servler相比,JSp提供下述好處:
?JSp中HTML的編寫與維護更為簡單。JSp中可以使用常規的HTML:沒有額外的反斜杠,沒有額外的雙引號,也沒有暗含的Java語法。
?能夠使用標準的網站開發工具。即使對那些對JSp一無所知的HTML工具,我們也可以使用,因為它們會忽略JSp標簽(JSp tags)。
?可以對開發團隊進行劃分。Java程序員可以致力于動態代碼。Web開發人員可以將經理集中在表示層(presentation layer)上。對于大型的項目,這種劃分極為重要。依據開發團隊的大小,及項目的復雜程度,可以對靜態HTML和動態內容進行弱分離(weaker separation)和強分離(stronger separation)。
在此,這個討論并不是讓您停止使用servlets,只使用JSp。幾乎所有的項目都會同時用到這兩種技術。針對項目中的某些請求,您可能會在MVC構架下組合使用這兩項技術。我們總是希望用適當的工具完成相對應的工作,僅僅是servlet并不能填滿您的工具箱。
二、JSp相對于競爭技術的優勢
許多年前,Marty受到邀請,參加一個有關軟件技術的小型(20個人)研討會.做在Marty旁邊的人是James Gosling---Java編程語言的發明者。隔幾個位置,是來自華盛頓一家大型軟件公司的高級經理。在討論過程中,研討會的主席提出了Jini的議題,這在當時是一項新的Java技術.主席向該經理詢問他的想法.他繼續說,他們會持續關注這項技術,如果這項技術變得流行起來,他們會遵循公司的“接受并擴充(embrace and extend)”的策略.此時, Gosling隨意地插話說“你的意思其實就是不接受且不擴充(disgrace and distend)。”
在此, Gosling的抱怨顯示出,他感到這個公司會從其他公司那里拿走技術,用于他們自己的目的.但你猜這次怎么樣?這次鞋子穿在了另一只腳上。Java社團沒有發明這一思想----將頁面設計成由靜態HTML和用特殊標簽標記的動態代碼混合組成.。ColdFusion多年前就已經這樣做了。甚至ASp(來自于前述經理所在公司的一項產品)都在JSp出現之前推廣了這種方式。實際上,JSp不只采用了這種通用概念,它甚至使用許多和ASp相同的特殊標簽。
因此,問題變成:為什么使用JSp,而不使用其他技術呢?我們的第一反應是我們不是在爭論所有的人應該做什么。其他這些技術中,有一些也很不錯,在某些情況下也的確是合情合理的選擇.然而,在其他情形中,JSp明顯要更好一些。下面給出幾個理由。
與.NET和Active Server pages(ASp)相比
.NET是Microsoft精心設計的一項技術。ASp.NET是與servlets和JSp直接競爭的技術。JSp的優勢體現在兩個方面。
首先,JSp可以移植到多種操作系統和Web服務器,您不必僅僅局限于部署在Windows 和IIS上盡管核心.NET平臺可以在好幾種非Windows平臺上運行,但ASp這一部分不可以。您不能期望可以將重要的ASp.NET應用部署到多種服務器和操作系統。對于某些應用,這種差異沒有什么影響。但有些應用,這種差異卻非常重要。
其次,對于某些應用,底層語言的選擇至關重要。例如,盡管.NET的C#語言設計優良,且和Java類似,但熟悉核心C#語法和眾多工具庫的程序員很少。此外,許多開發者依舊使用最初版本的ASp。相對于這個版本,JSp在動態代碼方面擁有明顯的優勢。使用JSp,動態部分是用Java編寫的,而非VBScript過其他ASp專有的語言,因此JSp更為強勁,更適合于要求組件重用的復雜應用。
當將JSp與之前版本的ColdFusion對比時,您可能會得到相同的結論。應用JSp,您可以使用Java編寫“真正的代碼”,不必依賴于特定的服務器產品。然而,當前版本的ColdFusion滿足J2EE服務器的環境,允許開發者容易的混合使用ColdFusion和Servlet/JSp代碼。
與pHp相比
pHp(“pHp:Hypertext preprocessor”的遞歸字母縮寫詞)是免費的、開放源代碼的、HTML嵌入其中的腳本語言,與ASp和JSp都有某種程度的類似。JSp的一項優勢是動態部分用Java編寫,而Java已經在聯網、數據庫訪問、分布式對象等方面擁有廣泛的ApI,而pHp需要學習全新的、應用相對廣泛的語言。JSp的第二項優勢是,和pHp相比,JSp擁有極為廣泛的工具和服務器提供商的支持。
與純Servlet相比
原則上,JSp并沒有提供Servlet不能完成的功能。實際上,JSp文檔在后臺被自動轉換成Servlet。但是編寫(和修改)常規的HTML,要比無數println語句生成HTML要方便得多。另外,通過將表示與內容分離,可以為不同的人分配不同的任務:網頁設計人員使用熟悉的工具構建HTML,要么為Servlet程序員留出空間插入動態內容,要么通過XML標簽間接調用動態內容。
這是否表示您只可以學習JSp,將Servlet丟到一邊呢?當然不是!由于以下4種原因,JSp開發人員需要了解Servlet:
(1)JSp頁面會轉換成Servlet。不了解Servlet就無法知道JSp如何工作。
(2)JSp由靜態HTML、專用的JSp標簽和Java代碼組成。哪種類型的Java代碼呢?當然是Servlet代碼!如果不了解Servlet編程,那么就無法編寫這種代碼。
(3)一些任務用Servlet完成比用JSp來完成要好。JSp擅長生成由大量組織有序的結構化HTML或其他字符數據組成的頁面。Servlet擅長生成二進制數據,構建結構多樣的頁面,以及執行輸出很少或者沒有輸出的任務(比如重定向)。
(4)有些任務更適合于組合使用Servlet和JSp來完成,而非單獨使用Servlet或JSp。
與JavaScript相比
JavaScript和Java編程語言完全是兩碼事,前者一般用于在客戶端動態生成HTML,在瀏覽器載入文檔時構建網頁的部分內容。這是一項有用的功能,一般與JSp的功能(只在服務器端運行)并不發生重疊。和常規HTML頁面一樣,JSp頁面依舊可以包括用于JavaScript的SCRIpT標簽。實際上,JSp甚至能夠用來動態生成發送到客戶端的JavaScript。因此,JavaScript不是一項競爭技術,它是一項補充技術。
JavaScript也可以用在服務器端,最因人注意的是SUN ONE(以前的iplanet)、IIS和BroadVision服務器。然而,Java更為強大靈活、可靠且可移植。
與WebMacro和Velocity相比
JSp決非完美。許多人都曾指出過JSp中能夠改進的功能。這是一件好事,JSp的優勢之一是該規范由許多不同公司組成的社團控制。因此,在后續版本中,這項技術能夠得到協調的改進。
但是,一些組織已經開發出了基于Java的替代技術,試圖彌補這些不足。據我們的判斷,這樣做是錯誤的。使用擴充JSp和Servlet技術的第三方工具,如Apache Structs,是一種很好的思路,只要該工具帶來的好處能夠補償工具帶來的額外復雜性。但是,試圖使用非標準的工具代替JSp則不理想。在選擇一項技術時,需要權衡許多方面的因素:標準化、可移植性、集成性、行業支持和技術特性。對于JSp替代技術的爭論幾乎只是集中在技術特性上,而可移植性、標準化和集成性也十分重要。例如,Servlet和JSp規范為Web應用定義了一個標準的目錄結構,并提供用于部署Web應用的標準文件(.war文件)。所有JSp兼容的服務器必須支持這些標準。我們可以建立過濾器作用到任意樹木的Servlet和JSp頁面上,但不能用于非標準資源。Web應用安全設置也同樣如此。
此外,業界對JSp和Servlet技術的巨大支持使得這兩項技術都有了巨大的進步,從而減輕了對JSp的許多批評。例如,JSp標準標簽庫和JSp 2.0表達式語言解決了兩種最廣泛的批評:缺乏良好的迭代結構;不使用顯式的Java代碼或冗長的jsp:useBean元素難以訪問動態結果。
三、對JSp的誤解
忘記JSp技術是服務器端技術
下面是Marty收到的一些典型問題(大部分問題不止一次的出現)。
?我們的服務器正在運行JDK1.4。我如何將Swing組件用到JSp頁面中呢?
?我如何將圖像放到JSp頁面中?我不知道讀取圖像文件應該使用哪些Java I/O命令。
?Tomcat不支持JavaScript,當用戶在圖像上移動鼠標時,我如何使圖像突出顯示呢?
?我們的客戶使用不理解JSp的舊瀏覽器。我應該怎么做?
?當我們的客戶在瀏覽器中使用“View Source”(查看源代碼)時,如何阻止他們看到JSp標簽?
所有這些問題都基于瀏覽器對服務器端的過程在有所了解的假定之上。但事實上瀏覽器并不了解服務器端的過程。因此:
?如果要將使用Swing組件的applet放到網頁中,重要的是瀏覽器的Java版本,和服務器的Java版本無關。如果瀏覽器支持Java 2平臺,您可以使用正常的AppLET(或Java插件)標簽,即使在服務器上使用了非Java技術也須如此。
?您不需要Java I/O來讀取圖像文件,您只需將圖像放在存儲Web資源的目錄中(即WEB-INF/classes向上兩級的目錄),并輸出一個正常的IMG標簽。
?您應該用SCRIpT標簽,使用客戶端JavaScript創建在鼠標下會更改的圖像,這不會由于服務器使用JSp而改變。
?瀏覽器根本不“支持”JSp----它們看到的只是JSp頁面的輸出。因此,如同對待靜態HTML頁面一樣,只需確保JSp輸出的HTML與瀏覽器兼容。
?當然,您不需要采取什么措施來阻止客戶看到JSp標簽,這些標簽在服務器上進行處理,發送給客戶的輸出中并不出現。
混淆轉換期間和請求期間
JSp頁面需要轉換成servlet。Servlet在編譯后,載入到服務器的內容中,初始化并執行。但是每一步發生在什么時候呢?要回答這個問題,要記住以下兩點:
?JSp頁面僅在修改后第一次被訪問時,才會被轉換成servlet并進行編譯;
?載入到內存中、初始化和執行遵循servlet的一般規則。
表1列出一些常見的情形,講述在該種情況下每一步是否發生。最常被誤解的項已經突出標示出來。在參考該表時,要注意,由JSp頁面生成的servlet使用_jspService方法(GET和pOST請求都調用該函數),不是doGet或dopost方法。同樣,對于初始化,它們使用jspInit方法,而非init方法。
表1 各種情況下的JSp操作
將JSp 頁面轉換成servlet編譯Servlet 將Servlet 載入到服務器內存中調用jspInit 調用_jspService
頁面初次創建
請求 1有有有有有
請求 2無無無無有
服務器重啟后
請求3無無有有有
請求 4無無無無有
頁面修改后
請求 5有有有有有
請求 6無無無無有