Groovy Programming: An Introduction for Java Developers

Free Download

Authors:

Edition: 1

ISBN: 0123725070, 9780123725073

Size: 5 MB (5487777 bytes)

Pages: 497/497

File format:

Language:

Publishing Year:

Category:

Kenneth Barclay, John Savage0123725070, 9780123725073

Groovy Programming: An Introduction for Java DevelopersKenneth Barclay and John Savage”For a book targeting those new to scripting, OO or dynamic languages in general, this book is fabulous!”- Andrew Glover, President, Stelligent IncorporatedGroovy is a unique scripting language designed to augment the Java platform. It offers Java-like syntax, native support for maps and lists, methods, classes, closures, and builders. With its dynamic weak typing and seamless access to the Java API, it is well suited to the development of many small- to medium-size applications.Groovy is more expressive and operates at higher levels of abstraction than Java. This results in more rapid application development and increased programmer productivity. It can be used for “gluing” applications together rather than implementing complex data structures and algorithms. Another major strength of Groovy is that the coding effort required is relatively small by comparison with code written in Java. Often the latter appears to be overly complex and difficult to understand and maintain. This is because it requires extensive boilerplate or conversion code not required by Groovy.In one of the first guides to Groovy, authors Kenneth Barclay and John Savage introduce all the major aspects of Groovy development and explain the dynamic features this innovative programming language brings to the Java platform. This book assumes only a general knowledge of Java programming. Whether a seasoned Java developer or new to scripting languages, you’ll receive expert guidance on how to make Groovy work for you.

Table of contents :
Contents……Page 8
Foreword……Page 15
Preface……Page 17
About the authors……Page 20
why scripting?……Page 22
why groovy?……Page 24
numbers and expressions……Page 26
expressions……Page 27
operator precedence……Page 29
assignment……Page 30
increment and decrement operators……Page 31
object references……Page 32
relational and equality operators……Page 33
exercises……Page 35
string literals……Page 38
string indexing and slicing……Page 39
string methods……Page 40
regular expressions……Page 44
exercises……Page 46
lists……Page 48
list methods……Page 50
maps……Page 52
map methods……Page 54
ranges……Page 55
exercises……Page 56
simple output……Page 60
formatted output……Page 62
simple input……Page 63
exercises……Page 66
iteration 1: specification and list implementation……Page 68
iteration 2: map implementation……Page 71
exercises……Page 73
methods……Page 74
default parameters……Page 77
method return values……Page 78
parameter passing……Page 80
scope……Page 82
collections as method parameters and return values……Page 83
exercises……Page 84
while statement……Page 88
for statement……Page 90
if statement……Page 92
switch statement……Page 95
break statement……Page 99
continue statement……Page 100
exercises……Page 101
closures……Page 106
closures, collections, and strings……Page 111
other closure features……Page 117
exercises……Page 121
command line arguments……Page 124
file class……Page 125
exercises……Page 132
iteration 1: specification and map implementation……Page 134
11.2 iteration 2: implementation of a text-based user interface……Page 140
iteration 3: implementation with closures……Page 143
exercises……Page 146
classes……Page 148
composition……Page 156
exercises……Page 158
specification……Page 160
iteration 1: an initial model……Page 161
iteration 2: augment the model……Page 163
iteration 3: reinstate the user interface……Page 168
exercises……Page 174
inheritance……Page 178
inherited methods……Page 181
redefined methods……Page 183
polymorphism……Page 184
the abstract class……Page 187
the interface class……Page 190
exercises……Page 194
unit testing……Page 200
the groovytestcase and junit testcase classes……Page 202
the groovytestsuite and junit testsuite classes……Page 207
the role of unit testing……Page 210
exercises……Page 214
specification……Page 216
iteration 1: confirm the polymorphic effect……Page 217
iteration 2: demonstrate the required functionality……Page 220
iteration 3: provide user feedback……Page 225
iteration 4: enforce constraints……Page 233
exercises……Page 238
simple queries……Page 240
relations……Page 242
17.3 database updates……Page 245
objects from tables……Page 249
inheritance……Page 251
the spring framework……Page 253
exercises……Page 258
iteration 1: persist the domain model……Page 260
iteration 2: the impact of persistence……Page 272
exercises……Page 279
groovy markup……Page 280
markupbuilder……Page 282
xml parsing……Page 285
exercises……Page 297
swingbuilder……Page 298
lists and tables……Page 307
box and boxlayout classes……Page 313
exercises……Page 315
strings……Page 318
templates……Page 319
exercises……Page 323
iteration 1: prototype the gui……Page 324
iteration 2: implement the handlers……Page 327
exercises……Page 334
servlets……Page 336
groovlets……Page 337
gsp pages……Page 345
exercises……Page 349
iteration 1: web implementation……Page 350
exercise……Page 354
epilogue……Page 356
the java development kit……Page 358
the derby/cloudscape database……Page 359
the textbook sources……Page 360
simple and elegant……Page 362
methods……Page 364
classes……Page 365
polymorphism……Page 366
closures……Page 367
exceptions……Page 368
classes……Page 370
operator associativity……Page 371
variable definitions……Page 372
logical operators……Page 374
conditional operator……Page 375
conversions……Page 376
testing……Page 379
regular expressions……Page 382
single character match……Page 383
match zero or more……Page 384
match number……Page 385
character classes……Page 386
miscellaneous notations……Page 387
grouping……Page 388
Appendix E – more on lists, maps, and ranges……Page 390
classes……Page 391
lists……Page 392
the spread operator……Page 393
testing……Page 394
formatted output……Page 397
console class……Page 400
recursive methods……Page 403
static typing……Page 405
actual parameter agreement……Page 407
default parameter ambiguity……Page 408
collections as method parameters and return values……Page 410
closures and ambiguity……Page 414
closures and methods……Page 415
closures and scope……Page 416
recursive closures……Page 417
static typing……Page 418
closures, collections, and ranges……Page 419
return statement……Page 421
testing……Page 422
properties and visibility……Page 425
object navigation……Page 430
static members……Page 434
operator overloading……Page 436
the invokemethod……Page 438
exercises……Page 440
Appendix J – advanced closures……Page 441
simple closures……Page 442
partial application……Page 444
composition……Page 446
patterns of computation……Page 447
business rules……Page 449
packaging……Page 453
list reduction……Page 460
exercises……Page 462
antbuilder……Page 466
specialized builders……Page 474
menus and toolbars……Page 479
dialogs……Page 486
bibliography……Page 490
index……Page 492

Reviews

There are no reviews yet.

Be the first to review “Groovy Programming: An Introduction for Java Developers”
Shopping Cart
Scroll to Top