文件名称:
Design Pattern In Go[go语言设计模式].pdf
开发工具:
文件大小: 1mb
下载次数: 0
上传时间: 2019-07-16
详细说明:1) golang 的设计模式
GO is a new programming languages developed at Google by Robert Griesemer, Rob Pike, Ken Thompson, and others. GO was published in November 2009 and made open source; was “Language of the year” 2009 [7]; and was awarded the Bossie Award 2010 for “best open source application development software” [1]. GO deserves an evaluation.
Design patterns are records of idiomatic programming practice and inform programmers about good program design. Design patterns provide generic solutions for reoccurring problems and have been implemented in many programming languages. Every programming language has to solve the problems addressed by patterns. In this thesis we use design patterns to evaluate the innovative features of GO.Abstract
GO is a new object-oriented programming language developed at Google
by rob Pike, Ken Thompson, and others. Go has the potential to become a
major programming language go deserves an evaluation
Design patterns document reoccurring problems and their solutions
The problems presented are programming language independent. Their
solutions, however, are dependent on features programming languages
rovide
In this thesis we use design patterns to evaluate Go. We discuss go
features that help or hinder implementing design patterns, and present a
pattern catalogue of all 23 Gang-of-Four design patterns with Go specific
solutions
Furthermore, we present GoHotDraw, a Go port of the pattern dense
drawing application framework JHotDraw. We discuss design and im-
plementation differences between the two frameworks with regards to
Go
Acknowledgments
I would like to express my gratitude to my supervisors, James noble
and Nicholas Cameron, whose expertise, understanding, and patience
added considerably to my graduate experience. They provided timely and
instructive comments and evaluation at every stage of my thesis process,
allowing me to complete this project on schedule
I would also like to thank my family for the support they provided me
through my entire life and in particular, I owe my deepest gratitude to my
beautiful wife mary without whose love and moral support i would not
ave finished this thesis
4 Preliminary work for this thesis has been conducted in collaboration
ith my supervisors and published at the PLatEAU 2010 workshop [83
Frank schrager
IV
Contents
1 Introduction
1.1 Contributions
1.2 Outline
2 Background
2.1 GO
3
2.1.1 History of Go
2.1.2 Overview of Go
2.2 Design Patterns
12
2.2.1 Design patterns vs language features
2 Client-Specified Sel
14
2.3 Language evaluations
...15
2.3.1 Language Critiques.
2.3.2 Evaluation of Programming Languages for Students15
2.3.3 Empirical Evaluations
17
2.3.4 Publications on Go
3 Design Patterns in Go
21
3.1 Why patterns
3.2 Embedding or Composition
3.2.1 Observer
23
3.2.2 Adapter
24
3.2.3 Proxy
24
CONTENTS
3.2.4 Decorator
25
3.3 Abstract Classes
26
3.4 First Class Functions
27
3.5 Client-Specified Self
29
3.5.1 Template Method
29
3.6 Information Hiding
31
3.6.1 Singleton
31
3.6.2 Facade
32
Flyweight
33
3.6.4 Memento
4 Case Study: The GoHot Draw Framework
35
. 1 Methodology….·…∵··.
36
4.2 The Design of GoHotDraw
37
4.2.1 Model
39
2.2Ve
43
4.2.3 Controller
45
4. 3 Comparison of GoHot Draw and JHotDraw
49
4.3.1 Client-Specified Self in the Figure interface
49
4.3.2 GoHotDraw User Interface......
51
在.3.3 Event handling
55
在.34 Collections
56
valuation
59
5.1 Client-Specified Self
59
5. 2 Polymorphic Type Hierarchies
5.3 Embedding
61
5.3.1 Initialization
62
5.3.2 Multiple Embedding
2
5.4 Interfaces and Structural Subtyping
3
⑤5 Object Creation
64
5.6 Method and Function Overloading
65
CONTENTS
5.7 Source Code Organization
65
yntax
5.8.1 Explicit Receiver Naming
66
5.8.2 Built-in Data Structures
⑤83 Member visibility
67
5.8.4 Multiple return values
⑤8.5 Interface values.
68
6 Conclusions
6.1 Related Workl
.70
6.2 Future Work
6.3 Summar
ary
a Design Pattern Catalogu
A 1 Creational Patterns
74
A.1.1 Abstract Facto
ory
LA 1.2 Builder
80
A 1.3 Factory Methoc
83
A.I. 4 Prototype
87
A.1.5 Singleton
90
A2 Structural Patterns
94
A 2.1 Adapter
......94
A 2.2 Bridge
A 2.3 Composite
A 2.4 Decorator
107
A 2.5 Fa
adel
A 2.6 Flyweight
115
A 2.7 Prox
119
A 3 Behavioral Patterns
,,123
A.3.1 Chain of Responsibility
123
A 3.2 Command
.,,127
区A33 Interpreter
132
CONTENTS
A.3.4 Iterator
137
A 3.5 Mediator
143
A 3.6 Memento
148
A 3.7 Observer
152
A. 3. 8 State
,,,,..,.157
A 3.9 Strate
162
A.3.10 Template Method
166
A.3.11 Visitor
170
Bibliography
175
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.