
Programming Groovy 2
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Cover
- Table of Contents
- Foreword to the Second Edition
- Introduction
- What's Groovy?
- Why Dynamic Languages?
- Why Groovy?
- What's in This Book?
- Changes Since This Book's First Edition
- Who Is This Book For?
- Online Resources
- Acknowledgments
- Part I-Beginning Groovy
- 1. Getting Started
- Installing Groovy
- Installing and Managing Groovy Versions
- Test-Drive Using groovysh
- Using groovyConsole
- Running Groovy on the Command Line
- Using an IDE
- 2. Groovy for Java Eyes
- From Java to Groovy
- JavaBeans
- Flexible Initialization and Named Arguments
- Optional Parameters
- Using Multiple Assignments
- Implementing Interfaces
- Groovy Boolean Evaluation
- Operator Overloading
- Support of Java 5 Language Features
- Using Groovy Code-Generation Transformations
- Gotchas
- 3. Dynamic Typing
- Typing in Java
- Dynamic Typing
- Dynamic Typing != Weak Typing
- Design by Capability
- Optional Typing
- Multimethods
- Dynamic: To Be or Not to Be?
- Switching Off Dynamic Typing
- 4. Using Closures
- The Convenience of Closures
- Programming with Closures
- Ways to Use Closures
- Passing Parameters to Closures
- Using Closures for Resource Cleanup
- Closures and Coroutines
- Curried Closure
- Dynamic Closures
- Closure Delegation
- Programming with Tail Recursion
- Improving Performance Using Memoization
- 5. Working with Strings
- Literals and Expressions
- GString Lazy-Evaluation Problem
- Multiline Strings
- String Convenience Methods
- Regular Expressions
- 6. Working with Collections
- Using List
- Iterating Over an ArrayList
- Using Finder Methods
- Other Convenience Methods on Lists
- Using the Map Class
- Iterating Over Map
- Other Convenience Methods on Maps
- Part II-Using Groovy
- 7. Exploring the GDK
- Using Object Extensions
- Other Extensions
- Custom Methods Using the Extension Modules
- 8. Working with XML
- Parsing XML
- Creating XML
- 9. Working with Databases
- Setting Up the Database
- Connecting to a Database
- Database Select
- Transforming Data to XML
- Using DataSet
- Inserting and Updating
- Accessing Microsoft Excel
- 10. Working with Scripts and Classes
- The Melting Pot of Java and Groovy
- Running Groovy
- Using Groovy Classes from Groovy
- Intermixing Groovy and Java with Joint Compilation
- Creating and Passing Groovy Closures from Java
- Calling Groovy Dynamic Methods from Java
- Using Java Classes from Groovy
- Using Groovy Scripts from Groovy
- Using Groovy Scripts from Java
- Part III-MOPping Groovy
- 11. Exploring Metaobject Protocol (MOP)
- Groovy Object
- Querying Methods and Properties
- Dynamically Accessing Objects
- 12. Intercepting Methods Using MOP
- Intercepting Methods Using GroovyInterceptable
- Intercepting Methods Using MetaClass
- 13. MOP Method Injection
- Injecting Methods Using Categories
- Injecting Methods Using ExpandoMetaClass
- Injecting Methods into Specific Instances
- Injecting Methods Using Mixins
- Decorating Classes with Multiple Mixins
- 14. MOP Method Synthesis
- Method Synthesis Using methodMissing
- Method Synthesis Using ExpandoMetaClass
- Synthesizing Methods for Specific Instances
- 15. MOPping Up
- Creating Dynamic Classes with Expando
- Method Delegation: Putting It All Together
- Review of MOP Techniques
- 16. Applying Compile-Time Metaprogramming
- Analyzing Code at Compile Time
- Intercepting Method Calls Using AST Transformations
- Injecting Methods Using AST Transformations
- Part IV-Using Metaprogramming
- 17. Groovy Builders
- Building XML
- Building JSON
- Building Swing
- Custom Builder Using Metaprogramming
- Using BuilderSupport
- Using FactoryBuilderSupport
- 18. Unit Testing and Mocking
- Code in This Book and Automated Unit Tests
- Unit Testing Java and Groovy Code
- Testing for Exceptions
- Mocking
- Mocking by Overriding
- Mocking Using Categories
- Mocking Using ExpandoMetaClass
- Mocking Using Expando
- Mocking Using Map
- Mocking Using the Groovy Mock Library
- 19. Creating DSLs in Groovy
- Context
- Fluency
- Types of DSLs
- Designing Internal DSLs
- Groovy and DSLs
- Using Command-Chain Fluency
- Closures and DSLs
- Method Interception and DSLs
- The Parentheses Limitation and a Workaround
- Categories and DSLs
- ExpandoMetaClass and DSLs
- A1. Web Resources
- A2. Bibliography
- Index
- - SYMBOLS -
- - A -
- - B -
- - C -
- - D -
- - E -
- - F -
- - G -
- - H -
- - I -
- - J -
- - K -
- - L -
- - M -
- - N -
- - O -
- - P -
- - Q -
- - R -
- - S -
- - T -
- - U -
- - V -
- - W -
- - X -
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.