Programming Groovy: dynamic productivity for the Java developer
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Raleigh, NC
Pragmatic Bookshelf
2008
|
Schriftenreihe: | The pragmatic programmers
|
Schlagworte: | |
Online-Zugang: | Table of contents only Contributor biographical information Publisher description Inhaltsverzeichnis |
Beschreibung: | XVIII, 300 S. graph. Darst. |
ISBN: | 1934356093 9781934356098 |
Internformat
MARC
LEADER | 00000nam a2200000zc 4500 | ||
---|---|---|---|
001 | BV035964738 | ||
003 | DE-604 | ||
005 | 20100205 | ||
007 | t | ||
008 | 100120s2008 xxud||| |||| 00||| eng d | ||
010 | |a 2008298081 | ||
020 | |a 1934356093 |9 1-934356-09-3 | ||
020 | |a 9781934356098 |9 978-1-934356-09-8 | ||
035 | |a (OCoLC)213468771 | ||
035 | |a (DE-599)BVBBV035964738 | ||
040 | |a DE-604 |b ger |e aacr | ||
041 | 0 | |a eng | |
044 | |a xxu |c US | ||
049 | |a DE-739 | ||
050 | 0 | |a QA76.73.G23 | |
082 | 0 | |a 005.133 |2 22 | |
084 | |a ST 250 |0 (DE-625)143626: |2 rvk | ||
100 | 1 | |a Subramaniam, Venkat |e Verfasser |4 aut | |
245 | 1 | 0 | |a Programming Groovy |b dynamic productivity for the Java developer |c Venkat Subramaniam ; [edited by Daniel H. Steinberg] |
264 | 1 | |a Raleigh, NC |b Pragmatic Bookshelf |c 2008 | |
300 | |a XVIII, 300 S. |b graph. Darst. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a The pragmatic programmers | |
650 | 4 | |a Groovy (Computer program language) | |
650 | 4 | |a Java (Computer program language) | |
650 | 4 | |a Ruby (Computer program language) | |
650 | 4 | |a Python (Computer program language) | |
700 | 1 | |a Steinberg, Daniel H. |e Sonstige |4 oth | |
856 | 4 | |u http://www.loc.gov/catdir/toc/fy0805/2008298081.html |3 Table of contents only | |
856 | 4 | |u http://www.loc.gov/catdir/enhancements/fy0913/2008298081-b.html |3 Contributor biographical information | |
856 | 4 | |u http://www.loc.gov/catdir/enhancements/fy0915/2008298081-d.html |3 Publisher description | |
856 | 4 | 2 | |m HBZ Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=018858876&sequence=000004&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-018858876 |
Datensatz im Suchindex
_version_ | 1804140984331665408 |
---|---|
adam_text | ..Contents
Foreword xvii
1 Introduction 1
1.1 Why Dynamic Languages?................. 1
1.2 What s Groovy?....................... 4
1.3 Why Groovy?......................... 5
1.4 What s in This Book?.................... 8
1.5 Who Is This Book For?................... 11
1.6 Acknowledgments...................... 11
1 Beginning Groovy 15
2 Getting Started 17
2.1 Getting Groovy........................ 17
2.2 Installing Groovy...................... 18
2.3 Test-Drive Using groovysh................. 19
2.4 Using groovyConsole.................... 20
2.5 Running Groovy on the Command Line......... 21
2.6 Using an IDE......................... 22
3 Groovy for the Java Eyes 25
3.1 From Java to Groovy.................... 25
3.2 JavaBeans.......................... 33
3.3 Optional Parameters.................... 38
3.4 Implementing Interfaces.................. 39
3.5 Groovy boolean Evaluation ................ 43
3.6 Operator Overloading.................... 44
3.7 Support of Java 5 Language Features.......... 47
3.8 Gotchas............................ 55
xü ? CONTENTS
4 Dynamic Typing 63
4.1 Typing in Java........................ 63
4.2 Dynamic Typing....................... 66
4.3 Dynamic Typing != Weak Typing............. 67
4.4 Design by Capability.................... 68
4.5 Optional Typing....................... 74
4.6 Types in Groovy....................... 74
4.7 Multimethods........................ 75
4.8 Dynamic: To Be or Not to Be?............... 79
5 Using Closures 81
5.1 Closures........................... 81
5.2 Use of Closures....................... 85
5.3 Working with Closures................... 87
5.4 Closure and Resource Cleanup.............. 87
5.5 Closures and Coroutines.................. 90
5.6 Curried Closure....................... 91
5.7 Dynamic Closures...................... 94
5.8 Closure Delegation..................... 96
5.9 Using Closures ....................... 99
6 Working with Strings 101
6.1 Literals and Expressions.................. 101
6.2 GString Lazy Evaluation Problem............. 104
6.3 Multiline String....................... 108
6.4 String Convenience Methods ............... 110
6.5 Regular Expressions.................... Ill
7 Working with Collections 115
7.1 Using List........................... 115
7.2 Iterating Over an ArrayList................. 117
7.3 Finder Methods....................... 120
7.4 Collections Convenience Methods............ 121
7.5 Using Map.......................... 124
7.6 Iterating Over Map..................... 126
7.7 Map Convenience Methods................. 128
xlü
n Using Groovy 131
8 Exploring the GDK 133
8.1 Object Extensions...................... 133
8.2 Other Extensions...................... 139
9 Working with XML 147
9.1 Parsing XML......................... 147
9.2 Creating XML........................ 152
10 Working with Databases 157
10.1 Connecting to a Database................. 158
10.2 Database Select....................... 159
10.3 Transforming Data to XML................. 160
10.4 Using DataSet........................ 161
10.5 Inserting and Updating................... 162
10.6 Accessing Microsoft Excel................. 162
11 Working with Scripts and Classes 165
11.1 The Melting Pot of Java and Groovy........... 165
11.2 Running Groovy....................... 166
11.3 Using Groovy Classes from Groovy............ 167
11.4 Using Groovy Classes from Java............. 168
11.5 Using Java Classes from Groovy............. 169
11.6 Using Groovy Scripts from Groovy............ 171
11.7 Using Groovy Scripts from Java.............. 173
11.8 Ease of Integration..................... 175
m MOPping Groovy 177
12 Exploring Meta-Object Protocol (MOP) 179
12.1 Groovy Object........................ 180
12.2 Querying Methods and Properties ............ 185
12.3 Dynamically Accessing Objects.............. 187
13 Intercepting Methods Using MOP 189
13.1 Intercepting Methods Using Groovylnterceptable . ... 189
13.2 Intercepting Methods Using MetaClass ......... 192
xiv ? CONTENTS
14 MOP Method Injection and Synthesis 197
14.1 Injecting Methods Using Categories ........... 198
14.2 Injecting Methods Using ExpandoMetaClass...... 203
14.3 Injecting Methods into Specific Instances........ 207
14.4 Method Synthesis Using methodMissing......... 209
14.5 Method Synthesis Using ExpandoMetaClass...... 214
14.6 Synthesizing Methods for Specific Instances...... 217
15MOPpingUp 219
15.1 Creating Dynamic Classes with Expando........ 219
15.2 Method Delegation: Putting It All Together ....... 222
15.3 Review of MOP Techniques................. 226
16 Unit Testing and Mocking 229
16.1 Code in This Book and Automated Unit Tests...... 229
16.2 Unit Testing Java and Groovy Code ........... 231
16.3 Testing for Exceptions................... 235
16.4 Mocking................... 236
16.5 Mocking by Overriding................... 239
16.6 Mocking Using Categories................. 243
16.7 Mocking Using ExpandoMetaClass............ 244
16.8 Mocking Using Expando.................. 246
16.9 Mocking Using Map..................... 248
16.10 Mocking Using the Groovy Mock Library......... 249
17 Groovy Builders 255
17.1 Building XML........................ 255
17.2 Building Swing........................ 259
17.3 Custom Builder Using Metaprogramming........ 260
17.4 Using BuilderSupport.................... 263
17.5 Using FactoryBuilderSupport............... 267
18 Creating DSLs in Groovy 273
18.1 Context............................ 273
18.2 Fluency.................. 275
18.3 Types of DSLs........................ 276
18.4 Designing Internal DSLs.................. 277
18.5 Groovy and DSLs...................... 277
18.6 Closures and DSLs..................... 278
18.7 Method Interception and DSLs.............. 279
18.8 The Parentheses Limitation and a Workaround..... 281
18.9 Categories and DSLs.................... 282
18.10 ExpandoMetaClass and DSLs............... 285
XV
A Web Resources 287
B Bibliography 293
Index 295
|
any_adam_object | 1 |
author | Subramaniam, Venkat |
author_facet | Subramaniam, Venkat |
author_role | aut |
author_sort | Subramaniam, Venkat |
author_variant | v s vs |
building | Verbundindex |
bvnumber | BV035964738 |
callnumber-first | Q - Science |
callnumber-label | QA76 |
callnumber-raw | QA76.73.G23 |
callnumber-search | QA76.73.G23 |
callnumber-sort | QA 276.73 G23 |
callnumber-subject | QA - Mathematics |
classification_rvk | ST 250 |
ctrlnum | (OCoLC)213468771 (DE-599)BVBBV035964738 |
dewey-full | 005.133 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 005 - Computer programming, programs, data, security |
dewey-raw | 005.133 |
dewey-search | 005.133 |
dewey-sort | 15.133 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>01844nam a2200445zc 4500</leader><controlfield tag="001">BV035964738</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20100205 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">100120s2008 xxud||| |||| 00||| eng d</controlfield><datafield tag="010" ind1=" " ind2=" "><subfield code="a">2008298081</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">1934356093</subfield><subfield code="9">1-934356-09-3</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9781934356098</subfield><subfield code="9">978-1-934356-09-8</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)213468771</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)BVBBV035964738</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">aacr</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="044" ind1=" " ind2=" "><subfield code="a">xxu</subfield><subfield code="c">US</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-739</subfield></datafield><datafield tag="050" ind1=" " ind2="0"><subfield code="a">QA76.73.G23</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">005.133</subfield><subfield code="2">22</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 250</subfield><subfield code="0">(DE-625)143626:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Subramaniam, Venkat</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Programming Groovy</subfield><subfield code="b">dynamic productivity for the Java developer</subfield><subfield code="c">Venkat Subramaniam ; [edited by Daniel H. Steinberg]</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Raleigh, NC</subfield><subfield code="b">Pragmatic Bookshelf</subfield><subfield code="c">2008</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">XVIII, 300 S.</subfield><subfield code="b">graph. Darst.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">The pragmatic programmers</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Groovy (Computer program language)</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Java (Computer program language)</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Ruby (Computer program language)</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Python (Computer program language)</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Steinberg, Daniel H.</subfield><subfield code="e">Sonstige</subfield><subfield code="4">oth</subfield></datafield><datafield tag="856" ind1="4" ind2=" "><subfield code="u">http://www.loc.gov/catdir/toc/fy0805/2008298081.html</subfield><subfield code="3">Table of contents only</subfield></datafield><datafield tag="856" ind1="4" ind2=" "><subfield code="u">http://www.loc.gov/catdir/enhancements/fy0913/2008298081-b.html</subfield><subfield code="3">Contributor biographical information</subfield></datafield><datafield tag="856" ind1="4" ind2=" "><subfield code="u">http://www.loc.gov/catdir/enhancements/fy0915/2008298081-d.html</subfield><subfield code="3">Publisher description</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">HBZ Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=018858876&sequence=000004&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-018858876</subfield></datafield></record></collection> |
id | DE-604.BV035964738 |
illustrated | Illustrated |
indexdate | 2024-07-09T22:08:39Z |
institution | BVB |
isbn | 1934356093 9781934356098 |
language | English |
lccn | 2008298081 |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-018858876 |
oclc_num | 213468771 |
open_access_boolean | |
owner | DE-739 |
owner_facet | DE-739 |
physical | XVIII, 300 S. graph. Darst. |
publishDate | 2008 |
publishDateSearch | 2008 |
publishDateSort | 2008 |
publisher | Pragmatic Bookshelf |
record_format | marc |
series2 | The pragmatic programmers |
spelling | Subramaniam, Venkat Verfasser aut Programming Groovy dynamic productivity for the Java developer Venkat Subramaniam ; [edited by Daniel H. Steinberg] Raleigh, NC Pragmatic Bookshelf 2008 XVIII, 300 S. graph. Darst. txt rdacontent n rdamedia nc rdacarrier The pragmatic programmers Groovy (Computer program language) Java (Computer program language) Ruby (Computer program language) Python (Computer program language) Steinberg, Daniel H. Sonstige oth http://www.loc.gov/catdir/toc/fy0805/2008298081.html Table of contents only http://www.loc.gov/catdir/enhancements/fy0913/2008298081-b.html Contributor biographical information http://www.loc.gov/catdir/enhancements/fy0915/2008298081-d.html Publisher description HBZ Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=018858876&sequence=000004&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis |
spellingShingle | Subramaniam, Venkat Programming Groovy dynamic productivity for the Java developer Groovy (Computer program language) Java (Computer program language) Ruby (Computer program language) Python (Computer program language) |
title | Programming Groovy dynamic productivity for the Java developer |
title_auth | Programming Groovy dynamic productivity for the Java developer |
title_exact_search | Programming Groovy dynamic productivity for the Java developer |
title_full | Programming Groovy dynamic productivity for the Java developer Venkat Subramaniam ; [edited by Daniel H. Steinberg] |
title_fullStr | Programming Groovy dynamic productivity for the Java developer Venkat Subramaniam ; [edited by Daniel H. Steinberg] |
title_full_unstemmed | Programming Groovy dynamic productivity for the Java developer Venkat Subramaniam ; [edited by Daniel H. Steinberg] |
title_short | Programming Groovy |
title_sort | programming groovy dynamic productivity for the java developer |
title_sub | dynamic productivity for the Java developer |
topic | Groovy (Computer program language) Java (Computer program language) Ruby (Computer program language) Python (Computer program language) |
topic_facet | Groovy (Computer program language) Java (Computer program language) Ruby (Computer program language) Python (Computer program language) |
url | http://www.loc.gov/catdir/toc/fy0805/2008298081.html http://www.loc.gov/catdir/enhancements/fy0913/2008298081-b.html http://www.loc.gov/catdir/enhancements/fy0915/2008298081-d.html http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=018858876&sequence=000004&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT subramaniamvenkat programminggroovydynamicproductivityforthejavadeveloper AT steinbergdanielh programminggroovydynamicproductivityforthejavadeveloper |