Groovy 2.4:动态编程的首选语言

需积分: 10 13 下载量 186 浏览量 更新于2024-07-18 收藏 15.03MB PDF 举报
"Groovy in Action 2nd Edition-Manning(2016)" 是一本由Dierk König、Paul King、Guillaume Laforge、Hamlet D’Arcy、Cédric Champeau和Erik Pragt等作者编著的书籍,其中包含Jon Skeet的前言。这本书是关于Groovy编程语言的第二版,覆盖了Groovy 2.4的最新特性。 Groovy是一种在Java平台上使用的动态编程语言,自2007年第一版发布以来,它已经引领了语言发展的趋势。Groovy以其简洁的语法、易于理解的特点以及对Java的友好性(作为Java的动态朋友)而受到欢迎。随着时间的推移,许多Groovy的功能,如数据类型的声明、简化的属性访问、空安全引用、闭包等,已经成为新语言的常见特性,并可能被引入到Java的新版本中。Groovy独特的可选类型策略(静态和动态行为并存)在其他语言中也得到了广泛采用。 本书的第一版因其每个代码清单都是可自测的特性而受到市场的热烈反响,成为Manning出版社十年间的畅销书之一。作者们收到了大量积极的反馈,感到非常骄傲和谦卑。Groovy自身的成功在于它以最符合Java习惯的方式提供了强大的功能,从1.0版本发展到2.4版本,填补了语法上的空白,添加了枚举、注解、泛型、经典for循环、嵌套类、变长参数、静态导入以及与Java 8的lambda表达式兼容的闭包等功能。 Groovy项目不仅核心部分发展迅速,周边生态系统也日益丰富。例如,编译时元编程的应用在Spock测试框架中得到体现,而Spock的“强断言”功能又回馈到了核心。社区活跃,新发展和活动层出不穷,使得保持与时俱进成为挑战。 第二版《Groovy in Action》(简称“ReGina”)响应了读者对更新版的需求,不仅更新了代码示例、API描述,还反映了市场的变化和生态系统的发展。Groovy已从利基语言发展为Java平台上默认的动态编程语言选择,被用于处理金融交易、航天任务、卫星实时数据流等多种场景。 书中涵盖了Groovy的各个方面,包括静态和动态类型、方法分发、GStrings、多行字符串、闭包、正则表达式、列表、映射、范围、字面量、星号操作符、空安全引用、自定义扩展、Elvis操作符、特质、运算符、类别、元类扩展、混合类、元编程方法等。此外,还涉及了Groovy的语法、运行时和编译时特性,如AST转换、元编程、GroovyBeans、GPath、可选值、命令链、隐式和显式转换及构造器。书中还讨论了线程、进程、构建器、GDK库、模块、文件I/O、并发编程、Swing、Ant、模板、Web服务、XML/JSON处理、数据库支持(SQL和NoSQL)、GroovyScript、Scriptom、GPars、GroovyStream、FunctionalGroovy、GroovyServ、GVM、Groovy for Android等相关主题。 这本书全面、深入地介绍了Groovy 2.4及其在开发中的应用,是广大Groovy开发者和对Groovy感兴趣的读者的重要参考书籍。
2017-11-17 上传
Groovy, the brand-new language for the Java platform, brings to Java many of the features that have made Ruby popular. Groovy in Action is a comprehensive guide to Groovy programming, introducing Java developers to the new dynamic features that Groovy provides. To bring you Groovy in Action, Manning again went to the source by working with a team of expert authors including both members and the Manager of the Groovy Project team. The result is the true definitive guide to the new Groovy language., Groovy in Action introduces Groovy by example, presenting lots of reusable code while explaining the underlying concepts. Java developers new to Groovy find a smooth transition into the dynamic programming world. Groovy experts gain a solid reference that challenges them to explore Groovy deeply and creatively., Because Groovy is so new, most readers will be learning it from scratch. Groovy in Action quickly moves through the Groovy basics, including:, # Simple and collective Groovy data types, # Working with Closures and Groovy Control Structures, # Dynamic Object Orientation, Groovy style, Readers are presented with rich and detailed examples illustrating Groovy's enhancements to Java, including, # How to Work with Builders and the GDK, # Database programming with Groovy, Groovy in Action then demonstrates how to Integrate Groovy with XML, and provides,, # Tips and Tricks, # Unit Testing and Build Support, # Groovy on Windows, An additional bonus is a chapter dedicated to Grails, the Groovy Web Application Framework.