没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
试读
340页
Groovy is an optionally typed, dynamic language for the Java platform with many features that are inspired by languages like Python, Ruby, and Smalltalk, making them available to Java developers using a Java-like syntax. Unlike other alternative languages, it is designed as a companion, not a replacement for Java.
资源推荐
资源详情
资源评论
Table of Contents
Part I: The Groovy language
1 Your way to Groovy
2 Overture: The Groovy basics
3 The simple Groovy datatypes
4 The collective Groovy datatypes
5 Working with closures
6 Groovy control structures
7 Object orientation, Groovy style
8 Dynamic programming with Groovy
9 Compile-time me
ta programming and AST Transformations
Part II: Around the Groovy library
10 Working with builders
11 Working with the GDK
12 Database programming with Groovy
13 Integrating Groovy
14 Working with XML
Part III: Everyday Groovy
15 Tips and tricks
16 Unit
testing with Groovy
17 Concurrent Groovy with GPars
18 Domain Specific Languages (DSLs)
19 The Groovy ecosystem
20 Groovy best practice patterns
©Manning Publications Co. Please post comments or corrections to the Author Online forum:
http://www.manning-sandbox.com/forum.jspa?forumID=571
Licensed to Charles Wise <ctwise@gmail.com>
1
Your way to Groovy
A smooth introduction to Groovy
What Groovy is all about
How it makes your programming life easier
How to start
Seek simplicity, and distrust it.
-- Alfred North Whitehead
You've heard of Groovy, maybe even installed the distribution and tried some
snippets f
rom the online tutorials. Perhaps your project has adopted Groovy as a
dynamic extension to Java and you now seek information about what you can do
with it. You may have been acquainted with Groovy from using the Grails web
application platform, the Griffon desktop application framework, the Gradle build
system or the the Spock testing facility and now look for background information
about the language that these tools are built upon. This book delivers to that
purpose but you can expect even more from learning Groovy.
Groovy will give you some quick wins, whether it's by making your Java code
simpler to
write, by automating recurring tasks, or by supporting ad-hoc scripting
for your daily work as a programmer. It will give you longer-term wins by making
your code simpler to read. Perhaps most important, it's a pleasure to use.
Learning Groovy is a wise investment. Groovy brings the power of advanced
language f
eatures such as closures, dynamic methods, and the meta object protocol
1
Licensed to Charles Wise <ctwise@gmail.com>
m
to the Java platform. Your Java knowledge will not become obsolete by walking
the Groovy path. Groovy will build on your existing experience and familiarity
with the Java platform, allowing you to pick and choose when you use which
tool--and when to combine the two seamlessly.
Groovy follows a pragmatic “no drama”
1
approach: it obeys the Java object
model and always keeps the perspective of a Java programmer. It doesn't force you
into any new programming paradigm but offers you those advanced capabilities
that you legitimately expect from a “top of stack” language.
Footnote 1 thanks to Mac Liaw for this wording
This first chapter provides background information about Groovy and
everything you need to know to get started. It starts with the Groovy story: why
Groovy was created, what considerations drive its design, and how it positions
itself in the landscape of languages and technologies. The next section expands on
Groovy's merits and how they can make life easier for you, whether you're a Java
programmer, a script aficionado, or an agile developer.
We strongly believe that there is only one way to learn a programming
language: b
y trying it. We present a variety of scripts to demonstrate the compiler,
interpreter, and shells, before listing some plug-ins available for widely used IDEs
and where to find the latest information about Groovy.
By the end of this chapter, you will have a basic understanding of what Groovy
is and how you can experiment with it.
We--the aut
hors, the reviewers, and the editing team--wish you a great time
programming Groovy and using this book for guidance and reference.
1.1 The Groovy story
At GroovyOne 2004--a gathering of Groovy developers in London--James
Strachan gave a keynote address telling the story of how he arrived at the idea of
inventing Groovy.
He and his wife were waiting for a late plane. While she went shopping, he
visited an Internet cafe and spontaneously decided to go to
the Python web site and
study the language. In the course of this activity, he became more and more
intrigued. Being a seasoned Java programmer, he recognized that his home
language lacked many of the interesting and useful features Python had invented,
such as native language support for common datatypes in an expressive syntax and,
more important, dynamic behavior. The idea was born to bring such features to
Java.
2
Licensed to Charles Wise <ctwise@gmail.com>
剩余339页未读,继续阅读
资源评论
- Like锐2018-06-17shit, this is groovy in action 1, not groovy in action 2
mydavidwang
- 粉丝: 1
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功