计算机专业毕业设计论文用中英文翻译自己原创,临近毕业答辩的童鞋,可以拿去用了.doc_第1页
计算机专业毕业设计论文用中英文翻译自己原创,临近毕业答辩的童鞋,可以拿去用了.doc_第2页
计算机专业毕业设计论文用中英文翻译自己原创,临近毕业答辩的童鞋,可以拿去用了.doc_第3页
计算机专业毕业设计论文用中英文翻译自己原创,临近毕业答辩的童鞋,可以拿去用了.doc_第4页
计算机专业毕业设计论文用中英文翻译自己原创,临近毕业答辩的童鞋,可以拿去用了.doc_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

中英文翻译C#设计模式之抽象工厂模式介绍C#介绍C#(C Sharp)是微软(Microsoft)为.NET Framework量身定做的程序语言,C#拥有C/C+的强大功能以及Visual Basic简易使用的特性,是第一个组件向导(Component-oriented)的程序语言,和C+与Java一样亦为对象导向程序语言。C Sharp(C#)是微软公司在2000年6月发布的一种新的编程语言,并定于在微软职业开发论坛(PDC)上登台亮相。C#是微软公司研究员Anders Hejlsberg的最新成果。C#看起来与Java有着惊人的相似;它包括了诸如单一继承,界面,与Java几乎同样的语法,和编译成中间代码再运行的过程。但C#与Java有着明显的不同,它借鉴了Delphi的一个特点,与COM(组件对象模块)是直接集成的,而且它是微软公司.NET windows网络框架的主角。C#从C/C+继承的特点主要有以下几个方面:编译:程序直接编译成标准的二进制可执行形式,如果前面的Hello Word陈旭被保存成一个文本文件并被命名为Hello.cs,它可以被编译成命名Hello.exe的可执行程序。结构体:一个C#的结构体与C+的结构体相似,因为它能够包含数据声明和方法,但是又和C+是不同的,C#的结构体与类是不同的而且不支持继承.但是,与Java相同的是,一个结构体可以实现界面。预编译:C#中存在预编译指令支持条件编译,警告,错误报告和编译行控制.可用的预编译指令有:#define、#undef、#if #elif、#else、#endif #warning、#error、#line ,没有了#include 伪指令.你无法再用#define 语句对符号赋值,所以就不存在源代码替换的概念-这些符号只能用在#if和#elif伪指令里.在#line伪指令里的数字(和可选的名字)能够修改行号还有#warning和#error输出结果的文件名。抽象工厂模式在百科中对抽象工厂模式的解释是:抽象工厂模式是所有形态的工厂模式中最为抽象和最具一般性的一种形态。抽象工厂模式是指当有多个抽象角色时,使用的一种工厂模式。抽象工厂模式可以向客户端提 供一个接口,使客户端在不必指定产品的具体的情况下,创建多个产品族中的产品对象。根据LSP原则,任何接受父类型的地方,都应当能够接受子类型。因此, 实际上系统所需要的,仅仅是类型与这些抽象产品角色相同的一些实例,而不是这些抽象产品的实例。换言之,也就是这些抽象产品的具体子类的实例。工厂类负责 创建抽象产品的具体子类的实例。在.NET中,抽象工厂模式(Abstract Factory)是用来应对下述问题:在软件系统中,经常面临着“一系列相互依赖的对象”的创建工作;同时由于需求的变化,往往存在着更多系列对象的创建工作。如何应对这种变化?如何绕过常规的对象的创建方法(new),提供一种“封装机制”来避免客户程序和这种“多系列具体对象创建工作”的紧耦合?这就是我们要说的抽象工厂模式。抽象工厂模式的意图是提供一个创建一系列相关或相互依赖对象的接口,而无需指定它们具体的类。抽象工厂模式的实现要点是:1、抽象工厂将产品对象的创建延迟到它的具体工厂的子类。2、如果没有应对“多系列对象创建”的需求变化,则没有必要使用抽象工厂模式,这时候使用简单的静态工厂完全可以。3、系列对象指的是这些对象之间有相互依赖、或作用的关系,例如游戏开发场景中的“道路”与“房屋”的依赖,“道路”与“地道”的依赖。4、抽象工厂模式经常和工厂方法模式共同组合来应对“对象创建”的需求变化。5、通常在运行时刻创建一个具体工厂类的实例,这一具体工厂的创建具有特定实现的产品对象,为创建不同的产品对象,客户应使用不同的具体工厂。6、把工厂作为单件,一个应用中一般每个产品系列只需一个具体工厂的实例,因此,工厂通常最好实现为一个单件模式。7、创 建产品,抽象工厂仅声明一个创建产品的接口,真正创建产品是由具体产品类创建的,最通常的一个办法是为每一个产品定义一个工厂方法,一个具体的工厂将为每 个产品重定义该工厂方法以指定产品,虽然这样的实现很简单,但它确要求每个产品系列都要有一个新的具体工厂子类,即使这些产品系列的差别很小。使用抽象工厂模式的优点主要有:1、分离了具体的类。抽象工厂模式帮助你控制一个应用创建的对象的类,因为一个工厂封装创建产品对象的责任和过程。它将客户和类的实现分离,客户通过他们的抽象接口操纵实例,产品的类名也在具体工厂的实现中被分离,它们不出现在客户代码中。2、它使得易于交换产品系列。一个具体工厂类在一个应用中仅出现一次即在它初始化的时候。这使得改变一个应用的具体工厂变得很容易。它只需改变具体的工厂即可使用不同的产品配置,这是因为一个抽象工厂创建了一个完整的产品系列,所以整个产品系列会立刻改变。3、它有利于产品的一致性。当一个系列的产品对象被设计成一起工作时,一个应用一次只能使用同一个系列中的对象,这一点很重要,而抽象工厂很容易实现这一点。The introduction to Abstract Factory in C#About C#C # (C Sharp) is the Microsoft (Microsoft) Framework tailored programming languages, C # has the strong function of C/C + + and Visual Basic simple use of characteristic, is the first Component oriented guide (Component - programming languages, and of C + + and Java as object-oriented programming language also.C Sharp (C #) is Microsoft released in June 2000 a new programming language, and is scheduled to Microsoft professional development in the BBS (PDC) on stage. C # is Anders Hejlsberg researcher at Microsoft is the latest results. C # looks and Java striking is similar; It includes such as single inheritance, interface, and Java almost equally grammar, and compile and run into the process of middle code. But c # and Java, it is quite different from a characteristic, and Delphi COM (component object module) is a direct integration, and its M Windows network framework protagonist.C # from C/C + + inherited characteristic mainly in the following aspects:Compiler: program directly compiled into standard binary executable form, if the front ChenXu Hello Word was preserved into a text file and was named Hello. Cs, it can be compiled into the naming of hello.exe executable.Structures: a c # structures and c + + structures similar, because it can contain data declaration and method, but also and c + + is different, the c # structures and class is different and does not support inherited. However, the same with Java is, a structures can realize interface.Pre-compiled: existing in c # compiler directive gets support conditional compilation, warning, error report and compile line control. Available pre-compiled instructions: #define、#undef、#if #elif、#else、#endif 、#warning、#error、#line , without the # include pseudo instructions. You cannot reoccupy # create evaluates the symbols assignment, so nonexistent source replace concept - these symbols can only be used on # if false instructions and # elif in line. And in the # of pseudo instructions of digital (and optional name) could modify the line Numbers and # warning and output filename # as freely.Abstract FactoryIn the abstract factory pattern of wikipedia, the explanation is: abstract factory pattern is all forms of factory model of the most abstract and most general a form. Abstract factory model refers to the abstract character when more than one, using a factory model. Abstract factory model can ask to the client for an interface, make the client without specific specified products, create multiple product family of product object. According to the principle that any accept father LSP type of place, should be able to accept the son type. Therefore, in fact system needed, just type and these abstract product role some of the same example, rather than the abstract product examples. In other words, that is, the abstract subclass product specific examples. Factory class responsible for creating the abstract product specific subtype examples.In .NET, Abstract Factory modelis used to deal with Abstract the problem: in the software system, often faced a series of interdependent object create jobs; At the same time because the change of demand, usually exist more series object. Established How to deal with the change? How to bypass the conventional object create method (new), provide a packaging mechanism to avoid customer programs and the concrete object to create more series of tightly coupled work? This is what we say abstract factory model.The intention for Abstract factory model is to provide a create a series of related or dependent objects interface, without specifying their concrete classes.The realization of the abstract factory pattern point is: 1, the product object abstract factory will create delay to its specific factory subclasses. 2, if no deal with more series object creation changing needs, then there is no need to use the abstract factory model, this time use simple static factory can completely. 3, series object refers to these objects are interdependent and between the relationship or function, such as game development scene in the road and houses dependence, the road and authentic dependence. 4, abstract factory model often and factory method combined mode together to respond to object creation changing needs. 5, usually at runtime create a specific factory class instance, this one specific factory to create strong particular implementation in order to create the product objects of different products object, the client shall use different specific factory. 6, the factory units, and an application as general each product series examples of only one specific factory, therefore, factories are best implemented as a singleton. 7, and abstract factory building products, the only statement a create products, really create product is interface by specific product categories created, the most often a way is for each product definition a factory method, a concrete factories will for each a product redefined the factory method to specify products, though this implementation is simple, but it really requirement for each product series will have a new concrete factories, even if these product series subclass the difference is small.Use the advantages of abstract factory pattern mainly are: 1, separated from the concrete classes. Abstract factory model to help you control an application created classes of objects, because a factory encapsulation create product objects responsibility and process. It will customers and kin

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论