面向对象中外文翻译
Java编程语言外文翻译、英汉互译、中英对照
文档从互联网中收集,已重新修正排版,word格式支持编辑,如有帮助欢迎下载支持。
外文翻译原文及译文学院计算机学院专业计算机科学与技术班级学号姓名指导教师负责教师Java(programming language)Java is a general-purpose, concurrent, class-based, object-oriented computer program- -ming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java applications are typically compiled to byte code (class file) that can run on any Java virtual machine(JVM) regardless of computer architecture. Java is, as of 2012, one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them.The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1991 and first released in 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.Java is a set of several computer software products and specifications from Sun Microsystems (which has since merged with Oracle Corporation), that together provide a system for developing application software and deploying it in across-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones on the low end, to enterprise servers and supercomputers on the high end. While less common, Java appletsare sometimes used to provide improved and secure functions while browsing the World Wide Web on desktop computers.Writing in the Java programming language is the primary way to produce code that will be deployed as Java bytecode. There are, however, byte code compilers available forother languages such as Ada, JavaScript, Python, and Ruby. Several new languages have been designed to run natively on the Java Virtual Machine (JVM), such as Scala, Clojure and Groovy.Java syntax borrows heavily from C and C++, but object-oriented features are modeled after Smalltalk and Objective-C. Java eliminates certain low-level constructs such as pointers and has a very simple memory model where every object is allocated on the heap and all variables of object types are references. Memory management is handled through integrated automatic garbage collection performed by the JVM.An edition of the Java platform is the name for a bundle of related programs from Sun that allow for developing and running programs written in the Java programming language. The platform is not specific to any one processor or operating system, but rather an execution engine (called a virtual machine) and a compiler with a set of libraries that are implemented for various hardware and operating systems so that Java programs can run identically on all of them. The Java platform consists of several programs, each of which provides a portion of its overall capabilities. For example, the Java compiler, which converts Java source code into Java byte code (an intermediate language for the JVM), is provided as part of the Java Development Kit (JDK). The Java Runtime Environment(JRE), complementing the JVM with a just-in-time (JIT) compiler, converts intermediate byte code into native machine code on the fly. An extensive set of libraries are also part of the Java platform.The essential components in the platform are the Java language compiler, the libraries, and the runtime environment in which Java intermediate byte code "executes" according to the rules laid out in the virtual machine specification.In most modern operating systems (OSs), a large body of reusable code is provided to simplify the programmer's job. This code is typically provided as a set of dynamically loadable libraries that applications can call at runtime. Because the Java platform is not dependent on any specific operating system, applications cannot rely on any of the pre-existing OS libraries. Instead, the Java platform provides a comprehensive set of its own standard class libraries containing much of the same reusable functions commonly found in modern operating systems. Most of the system library is also written in Java. For instance, Swing library paints the user interface and handles the events itself, eliminatingmany subtle differences between how different platforms handle even similar components.The Java class libraries serve three purposes within the Java platform. First, like other standard code libraries, the Java libraries provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing. Second, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily intertwined with the distinctive implementations of each platform. The and java.io libraries implement an abstraction layer in native OS code, then provide a standard interface for the Java applications to perform those tasks. Finally, when some underlying platform does not support all of the features a Java application expects, the class libraries work to gracefully handle the absent components, either by emulation to provide a substitute, or at least by providing a consistent way to check for the presence of a specific feature.The success of Java and its write once, run anywhere concept has led to other similar efforts, notably the .NET Framework, appearing since 2002, which incorporates many of the successful aspects of Java. .NET in its complete form (Microsoft's implementation) is currently only fully available on Windows platforms, whereas Java is fully available on many platforms. .NET was built from the ground-up to support multiple programming languages, while the Java platform was initially built to support only the Java language, although many other languages have been made for JVM since..NET includes a Java-like language called Visual J# (formerly named J++) that is incompatible with the Java specification, and the associated class library mostly dates to the old JDK 1.1 version of the language. For these reasons, it is more a transitional language to switch from Java to the .NET platform, than a first class .NET language. Visual J# was discontinued with the release of Microsoft Visual Studio 2008. The existing version shipping with Visual Studio 2005will be supported until 2015 as per the product life-cycle strategy.In June and July 1994, after three days of brainstorming with John Gage, the Director of Science for Sun, Gosling, Joy, Naughton, Wayne Rosing, and Eric Schmidt, the team re-targeted the platform for the World Wide Web. They felt that with the advent of graphical web browsers like Mosaic, the Internet was on its way to evolving into the samehighly interactive medium that they had envisioned for cable TV. As a prototype, Naughton wrote a small browser, Web Runner (named after the movie Blade Runner), later renamed Hot Java.That year, the language was renamed Java after a trademark search revealed that Oak was used by Oak Technology. Although Java 1.0a was available for download in 1994, the first public release of Java was 1.0a2 with the Hot Java browser on May 23, 1995, announced by Gage at the Sun World conference. His announcement was accompanied by a surprise announcement by Marc Andreessen, Executive Vice President of Netscape Communications Corporation, that Netscape browsers would be including Java support. On January 9, 1996, the Java Soft group was formed by Sun Microsystems to develop the technology.Java编程语言Java是一种通用的,并发的,基于类的并且是面向对象的计算机编程语言,它是为实现尽可能地减少执行的依赖关系而特别设计的。
Java语言与面向对象思想翻译(中英文)
Java语言与面向对象思想翻译(中英文)Java语言与面向对象思想Java,是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java的总称。
用Java实现的Hot Java 浏览器(支持Java applet)显示了Java的魅力:跨平台、动态的Web、Internet计算。
从此,Java被广泛接受并推动了Web的迅速发展,常用的浏览器现在均支持Java applet。
1 Java语言的特点Java语言适用于Internet环境,是一种被广泛使用的网络编程语言,它具有如下的一些特点: 简单Java语言的语法规则和C++类似,但Java语言取消了指针和多重继承,统一使用引用来指示对象(C++中有两种形式,实际上是两种产生对象的途径,而Java 中只有一种),通过自动垃圾收集免去了程序设计人员对于内存块的释放工作。
面向对象(近于完全)Java语言为了提高效率,定义了几个基本的数据类型以非类的方式实现,余下的所有数据类型都以类的形式进行封装,程序系统的构成单位也是类。
因而几乎可以认为是完全面向对象。
平台无关性(可移植、跨平台)Java虚拟机(JVM)是在各种体系结构真实机器中用软件模拟实现的一种想象机器,必要时候可以用硬件实现。
当然,这些虚拟机内部实现各异,但其功能是一致的——执行统一的Java虚拟机指令。
Java编译器将Java 应用程序的源代码文件(.java)翻译成Java字节码文件(.class),它是由Java虚拟机指令构成的。
由于是虚拟机器,因而Java虚拟机执行Java程序的过程一般称为解释。
依赖于虚拟机技术,Java语言具有与机器体系结构无关的特性,即Java程序一旦编写好之后,不需进行修改就可以移植到任何一台体系结构不同的机器上。
从操作系统的角度看,执行一次Java程序的过程就是执行一次Java 虚拟机进程的过程。
面向网络编程Java语言产生之初就面向网络,在JDK中包括了支持TCP/IP、HTTP和FTP等协议的类库。
【计算机专业文献翻译】面向对象编程具有多方面的吸引力
英文文摘Why has object-oriented programming had such a sweeping impact on the software development community?Object-oriented programming appeals at multiple levels. For managers, it promises faster and cheaper development and maintenance. For analysts and designers, the modeling process becomes simpler and produces a clear, manageable design. For programmers, the elegance and clarity of the object model and the power of object-oriented tools and libraries makes programming a much more pleasant task, and programmers experience an increase in productivity. Everybody wins, it would seem.If there’s a downside, it is the expense of the learning curve. Thinking in objects is a dramatic departure from thinking procedurally, and the process of designing objects is much more challenging than procedural design, especially if you’re trying to create reusable objects.In the past, a novice practitioner of object-oriented programming was faced with a choice between two daunting tasks:1.Choose a language such as Smalltalk in which you had to learn a largelibrary before becoming productive.2.Choose C++ with virtually no libraries at all,and struggle through thedepths of the language in order to write your own libraries of objects.It is, in fact, difficult to design objects well –for that matter, it’s hard to design anything well. But the intent is that a relatively few experts design the best objects for others to consume. Successful OOP languages incorporate not just language syntax and a compiler, but an entire development environment including a significant library of well-designed, easy to use objects. Thus, the primary job of most programmers is to use existing objects to solve their application problems. The goal of this chapter is to show you whatobject-oriented programming is and how simple it can be.This chapter will introduce many of the ideas of Java and object-orientedpr ogramming on a conceptual level, but keep in mind that you’re not expected to be able to write full-fledged Java programs after reading this chapter. All the detailed descriptions and examples will follow throughout the course of this book.The progress of abstractionAll programming languages provide abstractions. It can be argued that the complexity of the problems you can solve is directly related to the kind and quality of abstraction. By “kind” I mean: what is it that you are abstracting? Assembly language is a small abstraction of the underlying machine. Manyso-called “imperative” languages that followed (such as FORTRAN, BASIC, and C) were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requires you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model (in the “solution space”) and the model of the problem that is actually being solved (in the “problem space”). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to maintain, and as a side effect created the entire “programming methods” industry.The alternative to modeling the machine is to model the problem you’re trying to solve. Early languages such as LISP and APL chose particular views of the world (“all problems are ultimately lists” or “all problems are algorithmic”). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the particular class of problem they’re designed to solve, but when you step outside of that domain they become awkward.The object-oriented approach takes a step farther by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. We refer to the elements in the problem space and their representations in the s olution space as “objects.” (Of course, you will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, so when you read the code d escribing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus OOP allows you to describe the problem in terms of the problem, rather than in the terms of the solution. There’s still a connection back to the computer, though. Each object looks quite a bit like a little computer; it has a state, and it has operations you can ask it to perform. However, this doesn’t seem like such a bad analogy to objects in the real world; they all have characteristics and behaviors.译文为什么面向对象的编程会在软件开发领域造成如此震憾的影响?面向对象编程具有多方面的吸引力。
Java的面向对象编程外文资料翻译
毕业设计(论文)外文资料翻译系:计算机系专业:计算机科学与技术姓名:学号:外文出处: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实现许多通过多重继承才能实现的优点而没有关联的问题。
我们将在本章讨论的接口的详细内容。
我们会给出创建和使用接口的一般规律和具体实例。
一个子类通常添加自己的实例变量和自己的实例方法,因此子类通常比父类大。
一个子类比它的父类更具体并且代表一组更小、更专业的对象。
通过单一继承,子类在开始时拥有父类的所有特性。
继承性真正的力量在于它可以在定义子类时增加或取代从超类中继承来的特征。
面向对象百度百科
理论历史1967年挪威计算中心的Kisten Nygaard和Ole Johan Dahl开发了Simula67语言,它提供了比子程序更高一级的抽象和封装,引入了数据抽象和类的概念,它被认为是第一个面向对象语言。
20世纪70年代初,Palo Alto研究中心的Alan Kay所在的研究小组开发出Smalltalk语言,之后又开发出Smalltalk-80,Smalltalk-80被认为是最纯正的面向对象语言,它对后来出现的面向对象语言,如Object-C,C++,Self,Eiffl 都产生了深远的影响。
随着面向对象语言的出现,面向对象程序设计也就应运而生且得到迅速发展。
之后,面向对象不断向其他阶段渗透,1980年Grady Booch 提出了面向对象设计的概念,之后面向对象分析开始。
1985年,第一个商用面向对象数据库问世。
1990年以来,面向对象分析、测试、度量和管理等研究都得到长足发展。
实际上,“对象”和“对象的属性”这样的概念可以追溯到20世纪50年代初,它们首先出现于关于人工智能的早期著作中。
但是出现了面向对象语言之后,面向对象思想才得到了迅速的发展。
过去的几十年中,程序设计语言对抽象机制的支持程度不断提高:从机器语言到汇编语言,到高级语言,直到面向对象语言。
汇编语言出现后,程序员就避免了直接使用0-1,而是利用符号来表示机器指令,从而更方便地编写程序;当程序规模继续增长的时候,出现了Fortran、C、Pascal 等高级语言,这些高级语言使得编写复杂的程序变得容易,程序员们可以更好地对付日益增加的复杂性。
但是,如果软件系统达到一定规模,即使应用结构化程序设计方法,局势仍将变得不可控制。
作为一种降低复杂性的工具,面向对象语言产生了,面向对象程序设计也随之产生。
编辑本段基本概念面向对象程序设计中的概念主要包括:对象、类、数据抽象、继承、动态绑定、数据封装、多态性、消息传递。
通过这些概念面向对象的思想得到了具体的体现。
OO(Object–Oriented )面向对象
OOOO(Object–Oriented )面向对象OO方法(Object-Oriented Method,面向对象方法,面向对象的方法)是一种把面向对象的思想应用于软件开发过程中,指导开发活动的系统方法,简称OO (Obje ct-Oriented)方法,是建立在“对象”概念基础上的方法学。
对象是由数据和容许的操作组成的封装体,与客观实体有直接对应关系,一个对象类定义了具有相似性质的一组对象。
而每继承性是对具有层次关系的类的属性和操作进行共享的一种方式。
所谓面向对象就是基于对象概念,以对象为中心,以类和继承为构造机制,来认识、理解、刻画客观世界和设计、构建相应的软件系统。
面向对象方法作为一种新型的独具优越性的新方法正引起全世界越来越广泛的关注和高度的重视,它被誉为"研究高技术的好方法",更是当前计算机界关心的重点。
十多年来,在对OO方法如火如荼的研究热潮中,许多专家和学者预言:正象70年代结构化方法对计算机技术应用所产生的巨大影响和促进那样,90年代OO方法会强烈地影响、推动和促进一系列高技术的发展和多学科的综合。
一、面向对象方法的由来与发展回顾历史可激励现在,以规划将来。
OO方法起源于面向对象的编程语言(简称为OOPL)。
50年代后期,在用FO RTRAN语言编写大型程序时,常出现变量名在程序不同部分发生冲突的问题。
鉴于此,ALGOL语言的设计者在ALGOL60中采用了以"Begin……End"为标识的程序块,使块内变量名是局部的,以避免它们与程序中块外的同名变量相冲突。
这是编程语言中首次提供封装(保护)的尝试。
此后程序块结构广泛用于高级语言如Pascal 、Ad a、C之中。
60年代中后期,Simula语言在ALGOL基础上研制开发,它将ALGOL的块结构概念向前发展一步,提出了对象的概念,并使用了类,也支持类继承。
70年代,Sm alltalk语言诞生,它取Simula的类为核心概念,它的很多内容借鉴于Lisp语言。
面向对象的方法有哪些
面向对象的方法有哪些面向对象编程(Object-Oriented Programming,简称OOP)是一种编程范式,它将问题分解为对象,并通过对象之间的交互来解决问题。
在面向对象编程中,我们使用类(class)和对象(object)来组织和管理代码,从而实现代码的封装、继承和多态。
面向对象的方法有以下几种:1. 封装(Encapsulation):封装是面向对象编程的基本特征之一。
它指的是将相关的属性和行为(方法)组合在一起,形成一个对象。
封装可以隐藏对象的内部细节,只提供一些外部接口,从而提高代码的可维护性和重用性。
2. 继承(Inheritance):继承是面向对象编程的另一个重要特征。
它通过创建一个新的类(子类)来继承已有类(父类)的属性和方法。
子类可以继承父类的所有非私有成员,并且可以添加自己的成员。
继承可以实现代码的重用和扩展。
3. 多态(Polymorphism):多态是面向对象编程的核心概念之一。
它指的是同一个类的实例在不同的情况下表现出不同的行为。
多态的实现方式包括函数重载和函数重写。
多态可以提高代码的灵活性和可扩展性。
4. 抽象(Abstraction):抽象是将具体的事物抽象成一般性的概念或模板。
在面向对象编程中,抽象是通过接口(interface)和抽象类(abstract class)来实现的。
接口定义了一组方法的签名,抽象类则提供了部分或者完整的方法实现。
抽象可以帮助我们定义通用的行为,并且使得程序具有更高的可复用性。
5. 组合(Composition):组合是指通过将一个类的对象作为另一个类的成员来组合两个类的关系。
组合可以实现部分和整体之间的关系,从而提高代码的灵活性和可维护性。
6. 封装(Encapsulation):封装是将对象的属性和方法封装起来,以隐藏内部实现的细节。
通过封装,对象对外只暴露有限的接口,隐藏了实现的细节,并且可以添加必要的验证和保护机制,提高代码的可靠性和安全性。
软件工程中英对照术语表
abstract class 抽象类,提供一组子类共有行为的类,但它本身并不具有实例。
抽象类表示一个概念,从中派生的类代表对这一概念的实施。
Abstraction 抽象,对视图或模型的创建,其中忽略了不必要的细节,以便专注于一组特定的相关细节。
access modifier存取权限,对类、方法或属性进行访问控制的关键字。
Java 中的存取权限可以是公有、私有、保护和包装(默认)。
accessor methods存取器方法,由对象提供的、用于定义连接该对象实例变量的方法。
用来返回实例变量值的存取器方法被称为获取方法;用来为实例变量指定值的存取器方法被称为设置方法。
acceptance验收,客户接受软件产品(作为部分或完整履行合同的结果)所有权的操作。
action动作,对构成计算过程抽象的可执行语句的规范。
动作通常会导致系统状态发生变化,这是通过向一个对象发送消息或是更改链接或属性值来实现。
action sequence动作序列,解析为一系列先后发生的动作的表达式。
action state动作状态,表示不可分动作的执行状态,通常指的是调用一个操作。
activation激活,动作的执行active class主动类,表示系统中控制线程的类。
请参见主动对象。
activity活动,要求角色执行的工作单元。
active object主动对象,拥有线程并可发起控制活动的对象。
主动类的实例。
activity graph活动图,状态机的特例,用于对涉及一个或多个分类器的进程建模。
对比:状态图(statechart diagram)。
同义词:活动图(activity diagram)。
actor主角,系统之外与系统交互的某人或某事物。
actor class主角类,定义一组主角实例,其中每个主角实例相对于系统而言都担任着同样的角色。
在与用例交互时这些用例的用户所担任的一组紧密相关的角色。
主角为每个要与其通信的用例都准备了一个角色。
java中英文对照
abstra ct 抽象的抽象的abs tract ion 抽象体、抽象物、抽象性抽象体、抽象物、抽象性a ccess存取、取用存取、访问a ccess leve l 存取级别访问级别ac cessfunct ion 存取函式访问函数activ ate 活化激活acti ve 作用中的a dapte r 配接器适配器addr ess 位址地址addr ess s pace位址空间,定址空间addr ess-o f ope rator取址运算子取地址操作符aggre gatio n 聚合algo rithm演算法算法a lloca te 配置分配alloc ator(空间)配置器分配器ap plica tion应用程式应用、应用程序a pplic ation fram ework应用程式框架、应用框架应用程序框架arch itect ure 架构、系统架构体系结构ar gumen t 引数(传给函式的值)。
叁见 para meter叁数、实质叁数、实叁、自变量arr ay 阵列数组arrow oper atorarrow(箭头)运算子箭头操作符assem bly 装配件a ssemb ly la nguag e 组合语言汇编语言as sert(ion)断言a ssign指派、指定、设值、赋值赋值ass ignme nt 指派、指定赋值、分配assi gnmen t ope rator指派(赋值)运算子 = 赋值操作符assoc iated相应的、相关的相关的、关联、相应的asso ciati ve co ntain er 关联式容器(对应 seq uenti al co ntain er)关联式容器atom ic 不可分割的原子的a ttrib ute 属性属性、特性a udio音讯音频A.I. 人工智慧人工智能ba ckgro und 背景背景(用於图形着色)後台(用於行程)b ackwa rd co mpati ble 回溯相容向下兼容bandw idth频宽带宽bas e cla ss 基础类别基类bas e typ e 基础型别 (等同於 bas e cla ss) batch批次(意思是整批作业)批处理be nefit利益收益be st vi ablefunct ion 最佳可行函式最佳可行函式(从 via ble f uncti ons 中挑出的最佳吻合者)bina ry se arch二分搜寻法二分查找bin ary t ree 二元树二叉树bi naryfunct ion 二元函式双叁函数binar y ope rator二元运算子二元操作符b indin g 系结绑定b it 位元位b it fi eld 位元栏位域bit map 位元图位图bit wise以 bit为单元逐一┅b itwis e cop y 以b it 为单元进行复制;位元逐一复制位拷贝bl ock 区块,区段块、区块、语句块boole an 布林值(真假值,true或 fa lse)布尔值borde r 边框、框线边框bra ce(cu rly b race)大括弧、大括号花括弧、花括号br acket(squa re br akcet) 中括弧、中括号方括弧、方括号b reakp oint中断点断点bu ild 建造、构筑、建置(MS用语)buil d-in内建内置bus汇流排总线b usine ss 商务,业务业务bu ttons按钮按钮by te 位元组(由8 bits组成)字节c ache快取高速缓存c all 呼叫、叫用调用c allba ck 回呼回调callopera tor c all(函式呼叫)运算子调用操作符(同 fun ction call oper ator)can didat e fun ction候选函式候选函数(在函式多载决议程序中出现的候选函式)ch ain 串链(例c hainof fu nctio n cal ls)链cha racte r 字元字符check box核取方块(i.e. chec k but ton)复选框check ed ex cepti on 可控式异常(J ava)chec k but ton 方钮 (i.e. ch eck b ox) 复选按钮child clas s 子类别(或称为d erive d cla ss, s ubtyp e)子类cla ss 类别类c lassbody类别本体类体c lassdecla ratio n 类别宣告、类别宣告式类声明cl ass d efini tion类别定义、类别定义式类定义clas s der ivati on li st 类别衍化列类继承列表clas s hea d 类别表头类头clas s hie rarch y 类别继承体系,类别阶层类层次体系cla ss li brary类别程式库、类别库类库class temp late类别模板、类别范本类模板class temp lateparti al sp ecial izati ons 类别模板偏特化类模板部分特化cla ss te mplat e spe ciali zatio ns类别模板特化类模板特化cl eanup清理、善後清理、清除c lient客端、客户端、客户客户clien t-ser ver 主从架构客户/服务器cli pboar d 剪贴簿剪贴板clon e 复制克隆c ollec tion群集集合com bo bo x 复合方块、复合框组合框comm and l ine 命令列命令行(系统文字模式下的整行执行命令)comm unica tion通讯通讯com patib le 相容兼容compi le ti me 编译期编译期、编译时comp iler编译器编译器c ompon ent 组件组件comp ositi on 复合、合成、组合组合comp uter电脑、计算机计算机、电脑conce pt 概念概念concr ete 具象的实在的co ncurr ent 并行并发conf igura tion组态配置con necti on 连接,连线(网络,资料库)连接cons train t 约束(条件)const ruct构件构件con taine r 容器容器(存放资料的某种结构如 list, vec tor...)c ontai nment内含包容co ntext背景关系、周遭环境、上下脉络环境、上下文c ontro l 控制元件、控件控件c onsol e 主控台控制台cons t 常数(const ant 的缩写,C++ 关键字)co nstan t 常数(相对於v ariab le)常量co nstru ctor(ctor)建构式构造函数(与cl ass 同名的一种membe r fun ction s)c opy (v) 复制、拷贝拷贝co py (n) 复件,副本cover涵盖覆盖cr eate创建、建立、产生、生成创建crea tion产生、生成创建curso r 游标光标c ustom订制、自定定制data资料数据da tabas e 资料库数据库data baseschem a 数据库结构纲目data memb er 资料成员、成员变数数据成员、成员变量d ata s truct ure 资料结构数据结构datag ram 资料元数据报文d ead l ock 死结死锁debu g 除错调试d ebugg er 除错器调试器dec larat ion 宣告、宣告式声明deduc tion推导(例:templ ate a rgume nt de ducti on)推导、推断defa ult 预设缺省、默认d efer延缓推迟def ine 定义预定义defi nitio n 定义、定义区、定义式定义del egate委派、委托、委任委托d elega tion(同上)dema rshal反编列散集d erefe rence提领(取出指标所指物体的内容)解叁考der efere nce o perat or de refer ence(提领)运算子 * 解叁考操作符der ivedclass衍生类别派生类desi gn by cont ract契约式设计des ign p atter n 设计范式、设计样式设计模式※最近我比较喜欢「设计范式」一词des troy摧毁、销毁des truct or 解构式析构函数de vice装置、设备设备dialo g 对话窗、对话盒对话框direc tive指令(例:using dire ctive) (编译)指示符dire ctory目录目录di sk 碟盘di spatc h 分派分派d istri buted comp uting分布式计算 (分布式电算)分布式计算分散式计算 (分散式电算)doc ument文件文档do t ope rator dot(句点)运算子 . (圆)点操作符dr iver驱动程式驱动(程序)dy namic bind ing 动态系结动态绑定effic iency效率效率ef ficie nt 高效高效end u ser 终端用户entit y 物体实体、物体enc apsul ation封装封装en closi ng cl ass 外围类别(与巢状类别neste d cla ss 有关)外围类enum (enu merat ion)列举(一种 C++资料型别)枚举enume rator s 列举元(enum型别中的成员)枚举成员、枚举器e qual相等相等equ ality相等性相等性equal ity o perat or eq ualit y(等号)运算子== 等号操作符e quiva lence等价性、等同性、对等性等价性eq uival ent 等价、等同、对等等价esc ape c ode 转义码转义码ev aluat e 评估、求值、核定评估event事件事件e ventdrive n 事件驱动的事件驱动的excep tion异常情况异常e xcept ion d eclar ation异常宣告(ref. C++Prime r 3/e, 11.3)异常声明e xcept ion h andli ng 异常处理、异常处理机制异常处理、异常处理机制ex cepti on sp ecifi catio n 异常规格(ref. C++ Prim er 3/e, 11.4)异常规范exit退离(指离开函式时的那一个执行点)退出exp licit明白的、明显的、显式显式expo rt 汇出引出、导出ex press ion 运算式、算式表达式faci lity设施、设备设施、设备fe ature特性field栏位,资料栏(Ja va)字段, 值域(Java)fi le 档案文件firmw are 韧体固件flag旗标标记fl ash m emory快闪记忆体闪存flex ibili ty 弹性灵活性flus h 清理、扫清刷新fon t 字型字体f orm 表单(pro gramm ing 用语)窗体for mal p arame ter 形式叁数形式叁数forwa rd de clara tion前置宣告前置声明forw ardin g 转呼叫,转发转发fo rward ing f uncti on 转呼叫函式,转发函式转发函数fract al 碎形分形frame work框架框架ful l spe ciali zatio n 全特化(ref. part ial s pecia lizat ion)func tion函式、函数函数funct ion c all o perat or 同callopera tor funct ion o bject函式物件(ref. C++Prime r 3/e, 12.3)函数对象f uncti on ov erloa ded r esolu tion函式多载决议程序函数重载解决(方案)fun ction ality功能、机能功能func tiontempl ate 函式模板、函式范本函数模板funct or 仿函式仿函式、函子game游戏游戏gen erate生成gener ic 泛型、一般化的一般化的、通用的、泛化g eneri c alg orith m 泛型演算法通用算法g etter (相对於 sett er) 取值函式globa l 全域的(对应於local)全局的glo bal o bject全域物件全局对象glo bal s coperesol ution oper ator全域生存空间(范围决议)运算子 ::全局范围解析操作符grou p 群组grou p box群组方块分组框guar d cla use 卫述句 (R efact oring, p250) 卫语句GU I 图形介面图形界面ha nd sh aking握手协商han dle 识别码、识别号、号码牌、权柄句柄ha ndler处理常式处理函数har d-cod ed 编死的硬编码的ha rd-co py 硬拷图屏幕截图ha rd di sk 硬碟硬盘hardw are 硬体硬件hash tabl e 杂凑表哈希表、散列表heade r fil e 表头档、标头档头文件heap堆积堆hier archy阶层体系层次结构(体系)hook挂钩钩子hy perli nk 超链结超链接ico n 图示、图标图标IDE整合开发环境集成开发环境iden tifie r 识别字、识别符号标识符if a nd on ly if若且唯若当且仅当Ill inois伊利诺伊利诺斯imag e 影像图象i mmedi ate b ase 直接的(紧临的)上层baseclass。
Java语言概述与面向对象思想中英文翻译
Java语言概述与面向对象思想Java,是由Sun Microsystems公司于1995年5月推出的Java程序设计语言和Java的总称。
用Java实现的Hot Java 浏览器(支持Java applet)显示了Java的魅力:跨平台、动态的Web、Internet计算。
从此,Java被广泛接受并推动了Web的迅速发展,常用的浏览器现在均支持Java applet。
平台Java平台由Java虚拟机(Java Virtual Machine)和Java 应用编程接口(Application Programming Interface、简称API)构成。
Java 应用编程接口为Java应用提供了一个独立于操作系统的标准接口,可分为基本部分和扩展部分。
在硬件或操作系统平台上安装一个Java平台之后,Java应用程序就可运行。
现在Java平台已经嵌入了几乎所有的操作系统。
这样Java程序可以只编译一次,就可以在各种系统中运行。
Java应用编程接口已经从1.1x版发展到1.2版。
目前常用的Java平台基于Java1.5,最近版本为Java1.7。
Java分为三个体系JavaSE(Java2 Platform Standard Edition,java 平台标准版),JavaEE(Java 2 Platform,Enterprise Edition,java平台企业版),JavaME(Java 2 Platform Micro Edition,java平台微型版)。
Java SEJAVA* Java SE(Java Platform,Standard Edition)。
Java SE 以前称为J2SE。
它允许开发和部署在桌面、服务器、嵌入式环境和实时环境中使用的Java 应用程序。
Java SE 包含了支持Java Web 服务开发的类,并为Java Platform,Enterprise Edition(Java EE)提供基础。
面向对象程序设计外文翻译2
附录1. 外文文献Introduction To Objects1、The progress of abstractionAll programming languages provide abstractions. It can be argued that the complexity of the problems you’re able to solve is directly related to the kind and quality of abstraction. By “kind〞I mean, “What is it that you are abstracting?〞Assembly language is a small abstraction of the underlying machine. Many so-called “imperative〞languages that followed (such as FORTRAN, BASIC, and C) were abstractions of assembly language. These languages are big improvements over assembly language, but their primary abstraction still requires you to think in terms of the structure of the computer rather than the structure of the problem you are trying to solve. The programmer must establish the association between the machine model (in the “solution space,〞which is the place where you’re modeling that problem, such as a computer) and the model of the problem that is actually being solved (in the “problem space,〞which is the place where the problem exists). The effort required to perform this mapping, and the fact that it is extrinsic to the programming language, produces programs that are difficult to write and expensive to maintain, and as a side effect created the entire “programming methods〞industry.The alternative to modeling the machine is to model the problem you’re trying to solve. Early languages such as LISP and APL chose particular views of the world (“All problems are ultimately lists〞or “All problems are algorithmic,〞respectively). PROLOG casts all problems into chains of decisions. Languages have been created for constraint-based programming and for programming exclusively by manipulating graphical symbols. (The latter proved to be too restrictive.) Each of these approaches is a good solution to the particular class of problem they’re designed to solve, but when you step outside of that domain they become awkward.The object-oriented approach goes a step further by providing tools for the programmer to represent elements in the problem space. This representation is general enough that the programmer is not constrained to any particular type of problem. Werefer to the elements in the problem space and their representations in the solution space as “objects.〞(You will also need other objects that don’t have problem-space analogs.) The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects, so when you read the code describing the solution, you’re reading words that also express the problem. This is a more flexible and powerful language abstraction than what we’ve had before. Thus, OOP allows you to describe the problem in terms of the problem, rather than in terms of the computer where the solution will run. There’s still a connection back to the computer: each object looks quite a bit like a little computer—it has a state, and it has operations that you can ask it to perform. However, this doesn’t seem like such a bad analogy to objects in the real world—they all have characteristics and behaviors.Alan Kay summarized five basic characteristics of Smalltalk, the first successful object-oriented language and one of the languages upon which Java is based. These characteristics represent a pure approach to object-oriented programming: Everything is an object. Think of an object as a fancy variable; it stores data, but you can “make requests〞to that object, asking it to perform operations on itself. In theory, you can take any conceptual component in the problem you’re trying to solve (dogs, buildings, services, etc.) and represent it as an object in your program.A program is a bunch of objects telling each other what to do by sending messages. To make a request of an object, you “send a message〞to that object. More concretely, you can think of a message as a request to call a method that belongs to a particular object.Each object has its own memory made up of other objects. Put another way, you create a new kind of object by making a package containing existing objects. Thus, you can build complexity into a program while hiding it behind the simplicity of objects.Every object has a type. Using the parlance, each object is an instance of a class, in which “class〞is synonymous with “type.〞The most important distinguishing characteristic of a class is “What messages can you send to it?〞All objects of a particular type can receive the same messages. This is actually a loaded statement, as you will see later. Because an object of type “circle〞is also an object of type “shape,〞a circle is guaranteed to accept shape messages. This means you can write code that talks to shapes and automatically handle anything that fits the description of a shape. This substitutability is one of the powerful concepts in OOP.Booch offers an even more succinct description of an object:An object has state, behavior and identity.This means that an object can have internal data (which gives it state), methods (to produce behavior), and each object can be uniquely distinguished from every other object—to put this in a concrete sense, each object has a unique address in memory.2、An object has an interfaceAristotle was probably the first to begin a careful study of the concept of type; he spoke of “the class of fishes and the class of birds.〞The idea that all objects, while being unique, are also part of a class of objects that have characteristics and behaviors in common was used directly in the first object-oriented language, Simula-67, with its fundamental keyword class that introduces a new type into a program.Simula, as its name implies, was created for developing simulations such as the classic “bank teller problem.〞In this, you have a bunch of tellers, customers, accounts, transactions, and units of money—a lot of “objects.〞Objects that are identical except for their state during a program’s execution are grouped together into “classes of objects〞and that’s where the keyword class came from. Creating abstract data types (classes) is a fundamental concept in object-oriented programming. Abstract data types work almost exactly like built-in types: You can create variables of a type (called objects or instances in object-oriented parlance) and manipulate those variables (called sending messages or requests; you send a message and the object figures out what to do with it). The members (elements) of each class share some commonality: every account has a balance, every teller can accept a deposit, etc. At the same time, each member has its own state: each account has a different balance, each teller has a name. Thus, the tellers, customers, accounts, transactions, etc., can each be represented with a unique entity in the computer program. This entity is the object, and each object belongs to a particular class that defines its characteristics and behaviors.So, although what we really do in object-oriented programming is create new data types, virtually all object-oriented programming languages use the “class〞keyword. When you see the word “type〞think “class〞and vice versa.Since a class describes a set of objects that have identical characteristics (data elements) and behaviors (functionality), a class is really a data type because a floating point number, for example, also has a set of characteristics and behaviors. The difference is that a programmer defines a class to fit a problem rather than beingforced to use an existing data type that was designed to represent a unit of storage in a machine. You extend the programming language by adding new data types specific to your needs. The programming system welcomes the new classes and gives them all the care and type-checking that it gives to built-in types.The object-oriented approach is not limited to building simulations. Whether or not you agree that any program is a simulation of the system you’re designing, the use of OOP techniques can easily reduce a large set of problems to a simple solution.Once a class is established, you can make as many objects of that class as you like, and then manipulate those objects as if they are the elements that exist in the problem you are trying to solve. Indeed, one of the challenges of object-oriented programming is to create a one-to-one mapping between the elements in the problem space and objects in the solution space.But how do you get an object to do useful work for you? There must be a way to make a request of the object so that it will do something, such as complete a transaction, draw something on the screen, or turn on a switch. And each object can satisfy only certain requests. The requests you can make of an object are defined by its interface, and the type is what determines the interface. A simple example might beLight lt = new Light();();The interface establishes what requests you can make for a particular object. However, there must be code somewhere to satisfy that request. This, along with the hidden data, comprises the implementation. From a procedural programming standpoint, it’s not that complicated. A type has a method associated with each possible request, and when you make a particular request to an object, that method is called. This process is usually summarized by saying that you “send a message〞(make a request) to an object, and the object figures out what to do with that message (it executes code).Here, the name of the type/class is Light, the name of this particular Light object is lt, and the requests that you can make of a Light object are to turn it on, turn it off,make it brighter, or make it dimmer. You create a Light object by defining a “reference〞(lt) for that object and calling new to request a new object of that type. To send a message to the object, you state the name of the object and connect it to the message request with a period (dot). From the standpoint of the user of a predefined class, that’s pretty much all there is to programming with objects.The preceding diagram follows the format of the Unified Modeling Language (UML). Each class is represented by a box, with the type name in the top portion of the box, any data members that you care to describe in the middle portion of the box, and the methods (the functions that belong to this object, which receive any messages you send to that object) in the bottom portion of the box. Often, only the name of the class and the public methods are shown in UML design diagrams, so the middle portion is not shown. If you’re interested only in the class name, then the bottom portion doesn’t need to be shown, either3、An object provides services.While you’re trying to develop or understand a program design, one of the best ways to think about objects is as “service providers.〞Your program itself will provide services to the user, and it will accomplish this by using the services offered by other objects. Your goal is to produce (or even better, locate in existing code libraries) a set of objects that provide the ideal services to solve your problem.A way to start doing this is to ask “if I could magically pull them out of a hat, what objects would solve my problem right away?〞For example, suppose you are creating a bookkeeping program. You might imagine some objects that contain pre-defined bookkeeping input screens, another set of objects that perform bookkeeping calculations, and an object that handles printing of checks and invoices on all different kinds of printers. Maybe some of these objects already exist, and for the ones that don’t, what would they look like? What services would those objects provide, and what objects would they need to fulfill their obligations? If you keep doing this, you will eventually reach a point where you can say either “that object seems simple enough to sit down and write〞or “I’m sure that object must exist already.〞This is a reasonable way to decompose a problem into a set of objects.Thinking of an object as a service provider has an additional benefit: it helps to improve the cohesiveness of the object. High cohesion is a fundamental quality of software design: It means that the various aspects of a software component (such as an object, although this could also apply to a method or a library of objects) “fittogether〞well. One problem people have when designing objects is cramming too much functionality into one object. For example, in your check printing module, you may decide you need an object that knows all about formatting and printing. You’ll probably discover that this is too much for one object, and that what you need is three or more objects. One object might be a catalog of all the possible check layouts, which can be queried for information about how to print a check. One object or set of objects could be a generic printing interface that knows all about different kinds of printers (but nothing about bookkeeping—this one is a candidate for buying rather than writing yourself). And a third object could use the services of the other two to accomplish the task. Thus, each object has a cohesive set of services it offers. In a good object-oriented design, each object does one thing well, but doesn’t try to do too much. As seen here, this not only allows the discovery of objects that might be purchased (the printer interface object), but it also produces the possibility of an object that might be reused somewhere else (the catalog of check layouts).Treating objects as service providers is a great simplifying tool, and it’s very useful not only during the design process, but also when someone else is trying to understand your code or reuse an object—if they can see the value of the object based on what service it provides, it makes it much easier to fit it into the design.附录2. 中文翻译对象入门1、抽象的进步所有编程语言的最终目的都是提供一种“抽象〞方法。
软件开发中常用语中英文对照
A。
A.I。
人工智能A2A integration A2A整合abstract 抽象的abstract base class (ABC)抽象基类abstract class 抽象类abstraction 抽象、抽象物、抽象性access 存取、访问access function 访问函数access level访问级别account 账户action 动作activate 激活active 活动的actual parameter 实参adapter 适配器add-in 插件address 地址address space 地址空间address-of operator 取地址操作符ADL (argument-dependent lookup)ADO(ActiveX Data Object)ActiveX数据对象advanced 高级的aggregation 聚合、聚集algorithm 算法alias 别名align 排列、对齐allocate 分配、配置allocator分配器、配置器angle bracket 尖括号annotation 注解、评注API (Application Programming Interface) 应用(程序)编程接口app domain (application domain)应用域appearance 外观append 附加application 应用、应用程序application framework 应用程序框架Approximate String Matching 模糊匹配Arbitrary Precision Arithmetic 高精度计算architecture 架构、体系结构archive file 归档文件、存档文件argument引数(传给函式的值)。
参见parameterarrow operator 箭头操作符ASP(Active Server Page)活动服务器页面 worker process 工作者进程assembly 装配件、配件assembly language 汇编语言assembly manifest 装配件清单assert(ion)断言assign 赋值assignment 赋值、分配assignment operator 赋值操作符associated 相关的、相关联的associative container 关联式容器(对应sequential container)asynchronous 异步的atomic 原子的atomic operation 原子操作attribute 特性、属性audio 音频authentication service 验证服务authorization 授权B.B2B integration B2B整合、B2B集成(business-to—business integration)background 背景、后台(进程)backup 备份backup device备份设备backup file 备份文件backward compatible 向后兼容、向下兼容bandwidth 带宽Bandwidth Reduction 带宽压缩base class 基类base type 基类型batch 批处理BCL (base class library)基类库Bin Packing 装箱问题binary 二进制binary function 双参函数binary large object二进制大对象binary operator 二元操作符binary search 二分查找binary tree 二叉树binding 绑定bit 位bitwise 按位…bitwise copy 为单元进行复制;位元逐一复制,按位拷bitwise operation 按位运算block 块、区块、语句块bookkeeping 簿记boolean 布林值(真假值,true或false)border 边框bounds checking 边界检查boxing 装箱、装箱转换brace (curly brace)大括号、花括号bracket (square brakcet) 中括号、方括号breakpoint 断点browser applications 浏览器应用(程序)browser—accessible application 可经由浏览器访问的应用程序bug 臭虫build 编连(专指编译和连接built—in 内建、内置bus 总线business 业务、商务(看场合)business Logic 业务逻辑business rules 业务规则buttons 按钮by/through 通过byte 位元组(由8 bits组成)C。
计算机毕业论文外文翻译---面向对象和C++
面向对象和C++C++是目前所使用的众多编程语言中的一种。
为什么会有那么多的语言?为什么总会有新的语言不断出现?编程语言可以帮助程序员方便实现从设计到实现。
第一个编程语言对基本的机器结构有很大的依赖性。
这时程序的细节很笨重。
只有硬件设计师了解如何在其他成分之外建立计算机体系,语言设计者同样认识到程序可以在一个高水平的环境编写,因而是程序员可以不必了解机器的细节。
为什么有这么多高水平的编程语言?有很多语言可以访问大型数据库,格式化金融报告,控制机器人在工厂工作,处理机件,控制卫星实时模拟核反应堆,预测变化的大气层状况,下棋和绘制电路图。
每一个问题都需要不同的数据结构和算法。
程序语言作为一种工具帮助我们解决这些问题。
然而,并不是一种程序语言可以最好的解决所有问题。
新的语言被开发来更好的解决一类特定的问题。
其他语言可以用来解决不同的问题领域和多方面的用途。
每个程序语言固定一个特定的程序体系或设计程序原理。
使用多种多样的语言建立不同的设计方案。
这些方案被叫做程序范例,帮助我们思考问题,规范解决。
通过范例设计软件当设计一个小的计算机程序或大的软件系统是,我们要思考问题的解决模式。
怎样去设计一个模式?程序范例提供了许多不同的方法去设计和思考软件系统。
一个范例可以被认为是一个模式或者一个框架来设计和描述软件结构。
这个模式帮助我们去思考和规范解决。
我们可以选择一种语言,使用范例独立的完成。
当所选择的语言提供的结构和机制符合范例时,就很容易完成。
一般来说,几种语言可能属于同一种范例。
因此,一种范例可以被看作一种语言的类。
一种语言不仅要符合一种范例,而且能够使用多种范例提供的特性和特征。
混合语言,如C++,综合了两到三种范例。
C++包括了命令和程序范例的特性,例如,其前身—C,和面向对象范例。
命令范例:命令范例的特性是计算机的抽象模型和巨大的内存存储。
这是计算机体系的von Neumann模型。
计算命令,由一系列的命令组成,以代码形式存储。
C C++术语中英文对照
class head 类别表头 类头 ?
class hierarchy 类别继承体系 ?
argument 引数(传给函式的值). 叁见 parameter 叁数
array 阵列 数组
arrow operator arrow(箭头)运算子 -> 箭头运算符
enclosing class 外围类别(与巢状类别 nested class 有关)?
assignment operator assignment(指派)运算子 = 赋值运算符
associated 相应的、相关的 相关的、关联、相应的
associative container 关联式容器(对应 sequential container) 关联式容器
command line 命令行 命令行
(系统文字模式提示号之後所下的整行命令)
compiler 编译器 编译器
(存放资料的某种结构如 list, vector...)
context 背景关系、周遭环境、上下脉络 环境、上下文
const 常数(constant 的缩写,C++ 关键字)
derived class 衍生类别 派生类
destructor(dtor) 解构式 析构函数、析构器
device 装置 设备
cleanup 清理、善後 清理、清除
candidate function 候选函式 候选函数
(在函式多载决议程序中出现的候选函式)
chain 串链(例 chain of function calls) 链
child class 子类别(或称为derived class, subtype) 子类
面向对象系统设计
面向对象系统设计目录OOD循序渐进 ..................................................................... 错误!未定义书签。
前言..................................................................................... 错误!未定义书签。
目录 (1)面向对象的概念与UML概述 (2)第一章、面向对象的概念与UML概述 (2)1.1分析与设计概述 (2)1.2面向对象的概念 (4)1.3UML概述 (7)第二章、UML语言 (8)2.1UML语言的体系结构 (8)2.2符号与图形 (8)面向对象系统设计 (13)第三章、架构设计 (13)3.1架构设计原则 (13)3.2信息系统的架构设计 (14)第四章、类设计 (20)4.1类设计指南 (20)4.2通用日记帐财务系统-系统分析模型 (20)4.3通用日记帐财务系统-类图 (24)第五章、数据库设计 (26)5.1映射原则 (26)5.2映射 (27)5.3ER 图 (27)第六章、其他资料.......................................................... 错误!未定义书签。
面向对象的概念与UML概述第一章、面向对象的概念与UML概述1.1分析与设计概述当接触一个新事物时,就会问这个东西是干什么用的?进一步的,怎么使用呢?它需要改进吗?要改进什么?如何改进呢?从接触新事物到要改进什么,可以总结为是对事物的分析。
如何改进可以总结为是对目标(改进后)事物的设计。
这个事物是一个对象。
再来看看我们开发软件的分析、设计过程:当接触到一个系统时,首先了解当前系统提供什么服务、当前系统的服务如何操作,再分析目标系统必须提供什么服务,目标系统提供的这些服务如何操作,进而考虑如何实现这些服务(这里的实现是逻辑上的,指系统设计,程序设计是指物理上的实现)。
python的面向对象中的术语
python的面向对象中的术语面向对象编程是一种程序设计方法,通过面向对象的方式可以更加清晰地描述事物之间的关系,将程序划分成一个个相互独立的对象并通过对象之间的交互实现程序的功能。
在Python语言中,面向对象编程是其中最重要的特性之一,因此掌握Python中的面向对象术语非常重要。
类(Class)在面向对象编程中,类是描述对象属性和方法的一个蓝图。
Python中的类是通过class关键字定义的,并且类中的方法中必须包含一个self参数来表示实例本身。
例如:class Person:def __init__(self, name, age): = nameself.age = age对象(Object)在面向对象编程中,对象是类的一个具体实例。
例如,创建一个Person类的对象可以使用下面的代码:p1 = Person("Tom", 25)p2 = Person("Jerry", 29)这里p1和p2都是Person类的对象。
属性(Attribute)属性是描述对象状态的一种方式。
在Python中,属性是类中的变量,通常会和对象一起使用。
例如,在上面的Person类中,name和age就是该类的属性。
class Person:def __init__(self, name, age): = nameself.age = age方法(Method)方法是类中描述对象行为的一种方式。
在Python中,方法是类中的函数,其中第一个参数必须是self,表示对象本身。
例如,在Person类中,下面的walk方法就是该类的方法:class Person:def __init__(self, name, age): = nameself.age = agedef walk(self):print( + " is walking.")继承(Inheritance)继承是一种描述类之间关系的方式。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
学院(部):计算机科学与工程学院专业班级:计算机09-2班学生姓名:指导教师:2013年 5 月 29 日Object-oriented analysis and designThe basic concept of object-oriented technology and the basic method1.1 software development methodComputer after birth, computer technology has been developing in high speed condition, the development of computer science and technology by original only depends on the development of hardware to relying more on software development. In fact, the development of software technology has experienced more than generation process.First generation (50 to 60 s of the 20th century), in programming languages such as FORTRAN and ALGOL technology marked by algorithmGeneration to generation. At that time, the program design on people all creative talents, all rely on tips and tricks. Software productivity is very low, based on the algorithm procedure is very difficult to understand, programmers write their own program over a period of time even after oneself also look not to understand, this to the software modifications, maintenance bring great difficulties. So at the end of the 60 s in the "software crisis".Second generation (in the late 1970 s to 80 s prevailing), such as PASCAL, and COBOL programming language and relational database management system for a structured system analysis and design techniques. In order to overcome the software crisis, people made efforts to mainly from the following two directions: Methods from the Angle of the management to improve the software development, software engineering method is proposed, and greatly improve the quality and maintainability of the software.Second is to focus on the analysis in the software development process and design method of research and improvement. Important achievements in this field is developed in the 70 s the rage of structured development method of structured system analysis and design techniques.Third generation (in the 80 s is still prevalent) represented by Smalltalk, c + + object-oriented software development methods.Question 1: what is on the development dynamics of object-oriented software development methods?Traditional structured programming algorithm as the core, the original is closely related to the data and separate to the operation of the data, it is difficult to maintain the consistency of data and operation, its software development method also does not conform to the natural thinking habits, the designed software system solution space and the problem space, the expanded, difficult to understand, modify, and lead to problems in terms of program complexity and software crisis. In order to transcend program complexity barrier, overcome the software crisis, object-oriented software development methods are put forward.Question 2: what are the advantages of the object-oriented software development method?Object-oriented development method to change the past traditional on the basis of function analysis and function decomposition of process oriented structural analysis and design method of object-oriented development method to simulate the way people understand and deal with the objective world to analyze the problem, the system as a series of collections of objects, its object-oriented design and analysis of results is mapped to a structure of object-oriented implementation tool, has a more direct correspondence to mapping process, the analysts, designers, and programmers can use the same concept, so that the object oriented software development can simulate more naturally to the activities of the objective world, making the problem space and solution space on the structure as soon as possible. Therefore, adopting the object-oriented method can more effectively developing large software systems. Object-oriented method of encapsulation, inheritance and polymorphism mechanism not only to support software reuse, and the software maintenance, reliable and efficient software system which can realize flexible manufacturing, better to overcome the software crisis. Therefore, it has become a mature method widely used in software development. By the end of the 20th century, object oriented software engineering development gradually mature, especially the formation of the unified modeling language (UML) standard and widely used, the object-oriented software development methods have become the mainstream of the software development technology.1.2 the basic concept of object-orientedObject: (1) abstract representations of the objects is an objective entity attributes of the object is described by the data and the data for the operation of the behavior of two parts.(2)class: class is a collection of objects with the same properties and behavior of abstract description; Internal including attributes and behavior of two main parts.(3)example: classes is to have the same properties and behavior of a set of abstract descriptions of objects. Therefore, classes can be used as a user-defined typeand create the object model, and according to the model created by the actual example of a specific object is a class, often referred to as examples.(4)the message: the message is to request an object it contains a processing operation on the instruction information. Essence is to the operation of the object of a class function call, the call to a method.For example, student S1; S1. The display () is a message.A news generally consists of three parts: receiving a message object name, the parameters of the function name, function, operation.(5)the three basic characteristics of object-oriented technology: encapsulation, inheritance, and polymorphism(6)encapsulation: the so-called encapsulation is the object's properties and behavior combined into a single unit, to the outside world cannot directly access or modify the data and code, the outside world only through object provides the interface function to change the attributes of the object or obtaining data, it is realized the message is hidden.(7)inheritance: if in a defined on the class, add some special attribute or operation, can form a new class, this class is not only inherited the former all characteristics of a class, and with new features, so as a special case of the class before, is in front of a class to inherit. A class known as the parent class, before the new class is called a subclass. Through inheritance relationship can form a type hierarchy, called inheritance structure.Polymorphism (8) : in different classes, the same function name to realize functions of different functions available. Polymorphisms of the advantages: high-level code (algorithm) write it only once and the lower can be reused for many times, can improve the programming flexibility and efficiency.Object-oriented programming1.three major mechanisms of object oriented technology (characteristics) :(1)encapsulation mechanism and the design of the class: the so-called encapsulated object attribute data and operation method is allowed to be combined into a single unit, to the outside world cannot directly access or modify the data and code, the outside world only through object provides the interface function to change the attributes of the object or obtaining data, it implements the message hidden; In c + +, class is to support the data encapsulation tool, allowing design class descriptions to abstract a set with the same properties and behavior of the object, namely canencapsulate a set of objects in the class of common properties and methods. Thus, class is the tool to realize data encapsulation, object is the realization of data encapsulation. No package, no object-oriented technology.Class members to access the principle is: (1) define a class, the data members and member functions is the default access private members. (2) a member function can be direct access to the members of the same variables and calls to members of the same function, need not add object name before the function name. (3) members of the private or protected member is limited to the scope of the class that the body and the class member functions; Nonmember functions should be defined as a class of friends to access the private members of a class member function. (4) members of the public scope not only includes the class body, also includes the use of the object which it belongs. Can access to public members outside class, but must be before the member name plus the object name.(2)the inheritance mechanism and derived class definition:the so-called inheritance is allowed on an existing class, add some special attributes or operations, to derive a new class. Not only can the derived class inherits a base class member, and can define new member, so can be as special class of a class before. A class known as the parent class, before the new class is called a subclass. Through inheritance relationship can form a type hierarchy, called inheritance structure. Inheritance is one of the Shared properties between classes and service mechanism.class person //The base class{ protected:char name[11];char sex;int age;public:person(){ cout<<“person”<<endl;}~ person(){ cout<<“delete person”<<endl;}int Getage() { return 20; } }class Student:public person{ private:char id[9];float score;public:student() {cout<<“student”<<endl;}~ student(){ cout<<“delete student”<<endl;}float GetScore{ return score; }}void F(person *q) { q->Getage(); }void main(){ person *p;student s;p=&s;F(p); // p-> Getage();}The results:personstudent20delete studentdelete person2.The definition of mechanism of polymorphism and virtual functions:Polymorphism refers to the class hierarchy in the same class or different classes, can use the same function name different operating functionality, which you can use the same call way to invoke these functions with the same name with different functions, such as p - > display ().Runtime polymorphism: the class inheritance hierarchy, classes may have different levels of the same name but different functions, the need to run stages according to which class level to determine the call object belongs to the same function.Will only function with the same specification as the virtual function, through object pointer or reference object to call virtual functions, to achieve the runtime polymorphism.UML and its application1,.the system described in the UML model is composed of one or more views. UML provides 9 kinds of views: use case diagram, class diagram, object diagram, component diagram and configuration diagram, sequence diagram, collaboration diagram, state diagram and activity diagram. The 9 kinds of diagrams can be divided into a use case diagram, static view and dynamic view.2, can also view is divided into five class diagram of UML, UML content is defined by the five class diagram:The first type is a use case diagram, describe system functionality from the user Angle, and points out the function of the operator.The second type is Static diagram (Static diagram), describe the Static structure of system, including the class diagram, object diagram.The third kind is Behavior diagrams (behaviors diagram) describing the dynamic Behavior of the system and to participate in the activities of the interaction relationship between objects, including activity diagrams and state diagrams.The fourth class is interaction diagrams (Interactive diagram) to describe the interaction relationship between objects, including the sequence diagram and collaboration diagram.The fifth class is Implementation diagram (Implementation diagram). Figure - the view include the component diagram and configuration.3, use case diagramDefinition of the definition of a use case diagram: use case diagram from the Angle of the user use the system describes the system function of graphical representation methods.A Use Case (Use Case) is used to describe a function of the system requirements, it can accurately express the activists of interaction with the system and the system to provide a service.The Use Case of the contact: Use Case except contact activists have the Use Case .There is a certain link between, including: The generalization relationship:(a) a special Use Case with another, more general Use Case(b) Use contact: refers to a Use Case with another Use Case of functional behavior.(c) contain contact: a basic Use Case includes another public behavior of a Use Case.(d) expand contact: refers to a basic Use Case can be made by another functional behavior of the Use Case to expand.4, the definition of a class diagramSystem class diagram is an expression of graphic class and its related logic (logic view).Class diagram is the core of object-oriented design, establishes the state diagram, collaboration diagram and other figure.Class and class relationships: the main related, aggregation/composition, generalization/specialized, dependence, etc.5, the definition of the sequence diagramSequence diagram describes the dynamic collaboration between a group of interacting objects, which represents the complete oneOperating behavior of passing messages between objects and the objects time sequence. The sequence diagram By the object class character, lifeline, activation period and message.6, the definition of collaboration diagramsBehavior of a system is implemented by a group of objects, these objects aredone through interaction and collaboration service system. Used to describe the implementation of certain services involving the relationship between objects and their dynamic views (including communication) are called Collaboration diagrams (Collaboration). Available UML collaboration diagrams to describe the business process. Collaboration diagram is different from the sequence diagram.7, state diagram (StatechartDiagram) state diagram describes the definition of certain object may have in the process of system operationStatus, and jump between different states and external trigger the jumpEvents. State diagram focuses on describe objects dynamically in its life cycle Behavior. Can also be used for the reaction type object modeling.8, activity diagramsDefinition: activity diagrams are used to describe business process or workflow system. Activity diagramsIs composed of a series of motion state, the movement state of the control can be switched from one state to another and the adjacent state. Activity diagram can also be said that decision state, condition, action of parallel execution and message specification, etc. Available strips of lane put the activity into several groups, let an object is responsible for a group, the object must perform the activities contained within the group.9, the definition of the component diagramComponents are provides a set of interface functions of physical implementation module, it can be the products of the software development process, such as source code and binary code and an executable code, etc. Classes, interfaces, etc. They are the logical model of the physical implementation. Interface is used to describe a class or component of a service operation. Component diagram constitutes the physical components of the system and the link between each other. Component diagrams can be according to the source code, database, system, but does not represent some sort of physical things. Components must be configured on a node, performed by the node.10, the object oriented system development method based on UML can also be divided into the following steps:(1)the system requirements analysis: (a) captured or describe the functional requirements and non-functional requirements; (b) tectonic system use case model; (c) detail the use case(2) systems analysis: convert the use case model, analysis model for describing the system basic structure. Analysis model is a series of classes and class instances and their mutual relations. Analysis in the model class is also called analysis class. Commonly used method is to use a noun/verb analysis method to find analysis class. There are three kinds of analysis classes: entity, boundary and control classes.(3) System design: (a) augment and refine class. Further expand class defined in the analysis phase, and to define new classes to deal with technical issues, including handle nonfunctional requirements. (b) for each use case establish dynamic model, including sequence diagrams, collaboration diagrams, etc., to describe how to implement case through collaboration of objects in the class diagram of the function.(c) through dynamic modeling to revise and improve the class diagram. (d) design subsystem. Is the unit organization in the design model into manageable function module, which is one way to implement componentization model.(4)System implementation:(a)The class diagram of the logic model elements (such as class, interface, etc.) grouped packaging form each component is easy to implement, and to establish the connection between the components, constitute a component diagram. Component diagrams can represent a system's components and their connection, clearly describe the software architecture of the system. (b) implementation component. With programming realization of components has to implement component in the component diagram, programming programming can also be used for the components in the component diagram, finally realizes the system can run.11, based on UML of relational database design is divided into four stages:Business Use Case model design: is the database demand analysis, establish business model using Use Case diagrams, etc.The logical data model design: the main application is to determine the system needed to persistent data. Using class diagram and database logic model is set up. If it is a relational database design, you may need to design express persistent data entity classes and their contacts, and map them into a relational database Table (Table), View (View), etc.The physical data model design: using the component diagram, configuration diagram, etc., physical model of database design.Physical implementation design: to transform the physical data model to the actual database environment. Combined with the actual database environment, constitute the base tables of the database, file organization and indexing, etc.面向对象分析与设计面向对象技术的基本概念和基本方法1.1 软件开发方法的发展计算机诞生之后,计算机技术一直处于高速发展状态,计算机科学技术的发展由原来只依靠硬件的发展逐渐变为更多地依靠软件的发展。