Groovy for domain-specific languages : extend and enhance your Java applications with domain-specific languages in Groovy /
Annotation
Clasificación: | Libro Electrónico |
---|---|
Autor principal: | |
Formato: | Electrónico eBook |
Idioma: | Inglés |
Publicado: |
Birmingham, UK :
Packt Pub.,
©2010.
|
Temas: | |
Acceso en línea: | Texto completo |
Tabla de Contenidos:
- Cover; Copyright; Credits; About the Author; About the Reviewers; Table of Contents; Preface; Chapter 1: Introduction to DSL and Groovy; DSL: New name for an old idea; The evolution of programming languages; General-purpose languages; Spreadsheets and 4GLs; Language-oriented programming; Who are DSLs for?; A DSL for process engineers; Stakeholder participation; DSL design and implementation; External versus internal DSL; Operator overloading; Groovy; A natural fit with the JVM; Groovy language features; Static and optional typing; Native support for lists and maps; Closures
- Groovy operator overloadingRegular expression support; Optional syntax; Groovy markup; Summary; Chapter 2: Groovy Quick Start; How to find and install Groovy; Running Groovy; The Groovy script engine-groovy; Shebang scripts; The Groovy shell: groovysh; The Groovy console: groovyConsole; The Groovy compiler: groovyc; Groovy IDE and editor integration; Netbeans; Eclipse; IntelliJ IDEA; Other IDEs and editors; Introducing the Groovy Language; Module structure; Groovy shorthand; Assumed imports; Default visibility, optional semicolon; Optional parentheses and types; Optional return keyword
- AssertionsAutoboxing; Strings; Regular expressions; Methods and closures; Control structures; Groovy truth; Ternary and Elvis operators; Switch statement; Loops; Collections; Ranges; Lists; Maps; Operators; Spread and spread-dot; Null safe dereference; Operator overloading; Summary; Chapter 3: Groovy Closures; What is a closure; Closures and collection methods; Closures as method parameters; Method parameters as DSL; Forwarding parameters; Calling closures; Finding a named closure field; Closure parameters; Parameters and the doCall method; Passing multiple parameters
- Enforcing zero parametersDefault parameter values; Curried parameters; Closure return values; Closure scope; this, owner, and delegate; Summary; Chapter 4: Example DSL: GeeTwitter; Twitter; Working with the Twitter APIs; Using Twitter4J Java APIs; Tweeting; Direct messages; Searching; Following; Groovy improvements; A Groovier way to find friends; Groovy searching; Removing boilerplate; Refactoring; Fleshing out GeeTwitter; Improving search; Adding a command-line interface; Adding built-in methods; Summary; Chapter 5: Power Groovy DSL features; Named parameters; Named parameters in DSLs
- BuildersBuilder design pattern; Using Groovy Builders; MarkupBuilder; Namespaced XML; GroovyMarkup and the builder design pattern; Using program logic with builders; Builders for every occasion; NodeBuilder; SwingBuilder; Griffon: Builders as DSL; Method pointers; Metaprogramming and the Groovy MOP; Reflection; Groovy Reflection shortcuts; Expandos; Categories; Metaclass; Pretended methods (MetaClass.invokeMethod); Understanding this, delegate, and owner; How Builders work; ExpandoMetaClasses; Replacing methods; Adding or overriding static methods; Dynamic method naming