Gradle in Action – Had enough of Maven and Ant? Try this powerful Java build tool – #programming #bookreview

Gradle in Action

Benjamin Muschko

(Manning, paperback)

Apache Maven and Apache Ant are perhaps the two best-known and most widely used Java build tools. But Gradle is gainmuschkoing users and aficionados ( if, indeed, there can be “fans” of software build tools). And this well-prepared new book likely will help Gradle achieve even wider acceptance and employment in the workplace.

“Gradle,” writes Benjamin Muschko, “is the next evolutionary step in JVM-based build tools. It draws on lessons learned from established tools like Ant and Maven and takes their best ideas to the next level. Following a build-by-convention approach, Gradle allows for declaratively modeling your problem domain using a powerful and expressive domain-specific language (DSL) implemented in Groovy instead of XML. Because Gradle is a JVM native, it allows you to write custom logic in the language you’re most comfortable with, be it Java or Groovy.”

Muschko has a strong bias toward Gradle, of course. He is a member of the Gradleware engineering team and has written several popular Gradle plugins.

Nonetheless, his well-written, 15-chapter, 456-page book makes a compelling case for Java developers to add Gradle to their build-tool cabinet and list of skills.

“Over the course of years,” Muschko contends, Maven and Ant “[have] significantly improved and extended their feature set. But even though both are highly popular and have become industry standards, they have one weak point: build logic has to be described in XML. XML is great for describing hierarchical data, but falls short on expressing program flow and conditional logic. As a build script grows in complexity, maintaining the build code becomes a nightmare.”

To use Gradle, you do have to learn parts of yet another programming language, Groovy. But, if you already know Java, you are much of the way there.  “The language [Groovy] integrates with existing Java classes and libraries, which makes it easy for Java developers to learn it.” Muschko stresses. “Not only does Groovy build upon the strengths of Java, it also provides powerful programming features inspired by those of Ruby, Python, and others. Groovy can be used as a scripting language without having to compile the code. Alternatively, Groovy code can be compiled to Java bytecode.” (Both approaches are used in the book.)

“Gradle’s core functionality is built with Java,” Muschko points out. “On top of this functionality sits a domain-specific language (DSL) written in the dynamic programming language Groovy. When writing a Gradle build script, you automatically use the language constructs exposed by this DSL to express the desired build instructions. Gradle build scripts are executable Groovy scripts, but they can’t be run by the Groovy runtime. When the need to implement custom logic arises, you can use Groovy’s language features to build out the desired functionality directly in the Gradle build script.”

Gradle in Action uses some Groovy in most of its code examples. But you are not expected to have experience with that language. Instead, Muschko gradually introduces Groovy and shows how it is used in the build processes, while keeping the book’s focus on Gradle and Gradle’s advantages over Maven and Ant (with Ivy). (You can run many of the book’s code examples from the Gradle command line and also, as I did, try out some of the Groovy code snippets using Groovy’s console. And Chapter 10 describes Gradle’s IDE plug-ins for Eclipse and NetBeans.)

“This book is primarily for developers and build automation engineers who want to implement a repeatable build that’s easy to read and extend,” Muschko says.

Muschko’s book is organized into three parts:

  • Part 1, Introducing Gradle
  • Part 2, Mastering the Fundamentals
  • Part 3, From Build to Deployment.

Part 1 includes an introduction to project automation and illustrates the differences in how builds are put together in Maven, Ant, and Gradle. It also shows how to write and execute a simple Gradle script, run Gradle on the command line, and build a Gradle project by example.

Part 2 delves into more advanced topics such as dependency management, testing an application with Gradle, extending a build with plugins, and other subjects, such as multiproject builds. It also digs deeper into testing, Gradle’s extension mechanism, and “how to translate existing build logic from one tool to another, identify integration points, and depict migration strategies.”

Part 3  emphasizes how to use Gradle in deployment. “In times of increased pressure to deliver software quickly and frequently,” Muschko writes, “automating the deployment and release process is extremely important. In part 3, you’ll learn how to use Gradle to its fullest in the context of continuous delivery.”

Meanwhile, Appendix A provides a closer look at how to use Gradle’s Command Line Interface, while Appendix B, titled “Groovy for Gradle users,” provides an introduction to what the author terms “Groovy’s most important language features,” with recommendations to help you learn more Groovy on your own. 

“For years, builds had the simple requirements of compiling and packaging software,” Muschko says. “But the landscape of modern software development has changed, and so have the needs for build automation. Today, projects involve large and diverse software stacks, incorporate multiple programming languages, and apply a broad spectrum of testing strategies. With the
rise of agile practices, builds have to support early integration of code as well as frequent and easy delivery to test and production environments. Established build tools continuously fall short in meeting these goals in a simple but customizable fashion.”

So, will it be Gradle to the rescue? In some settings, perhaps yes. In other environments, you may need to know how to use Maven, Ant and Gradle, plus some other build tools. And in still other work settings, the powers that be may insist on Maven or Ant or something else.

In any case, if you work with Java software builds, you may want to consider learning Gradle (and, by default, some Groovy, too). If so, give serious consideration to Benjamin Muschko’s excellent new how-to book.  In its foreword, Hans Dockter, the founder of Gradle and Gradleware, terms Gradle in Action “the authoritative guide.”

Si Dunn

Hello World! – Updated book brings new fun to learning Python – #programming #bookreview

Sande--Hello World!, 2e

Hello World!

Computer Programming for Kids and Other Beginners (2nd Edition)

Warren Sande and Carter Sande

(Manning, paperback)

Many politicians, educators and pundits keep arguing over whether the United States should offer computer programming classes to all students in kindergarten through 12th grade.

Others say all of us, including senior citizens, should do some coding to help us (1) maintain mental sharpness and good computer skills and (2) ward off late-in-life memory problems such as dementia.

These contentious debates are a long way from being settled, of course. Meanwhile, questions also rage over which programming languages we should learn. There are, after all, many dozens now in use.

Experienced software developers often state that Python is a good choice for youngsters ready to tackle their first “real” language, particularly once they have spent some time mastering Scratch, which MIT describes as “a programming language and an online community where children can program and share interactive media such as stories, games, and animation with people from all over the world.”

Manning Publications recently has brought out an updated second edition of its popular Python how-to book, Hello World!, written by Warren Sande and his son Carter Sande.

Some parents want to hand a programming book over to a child and let them learn at their own pace. And that can be done, in many cases, with Hello World! (It is written at a 12-year-old’s reading level, according to Manning). But other parents want to share the learning experience and be mentors, too, and the Sande book can be used effectively that way, as well. In either case, many children younger than 12 also should be able to learn from it.

Be sure to note the “Other Beginners” in the book’s subtitle. I have taken classes in Python, and I have worked my way through a couple of  Python programming books. Hello World! is proving a useful addition to my library, too, because it gives some clear explanations and examples for  many different concepts, such as using variable nested loops, importing portions of modules, or providing collision detection in a game, to name just a few.

One big question quickly pops up when someone decides to learn to program in Python: Python 2 or Python 3?

Several years ago, the language was updated from version 2 to version 3, but many users of version 2 chose to not upgrade. So now we recently have had Python 2.7.6 and Python 3.3.3 (with Python 3.4 coming soon). The two versions have some similarities, but they also have essential differences. Bottom line: They do not play well together.

In this second edition of Hello World!, the authors have elected to stick with Python 2 in their text and code examples. But they have added notes to help make the code work for students using Python 3. Likewise, they have added an appendix explaining some major differences between Python 2 and Python 3.

Other significant changes include using color in illustrations and code listings and, in the chapter on GUI programming, using PyQT, rather than the no-longer-supported PythonCard. And the updated book now spans more than 460 pages, including its index.

With Hello World!, even the most eager student who is a very fast reader can be kept focused and busy for many hours while learning how to program in Python.

Si Dunn

Improving the Test Process – A Study Guide for ISTQB Expert Level Module – #software #bookreview

Improving the Test Process

Implementing Improvement and Change — A Study Guide for the ISTQB Expert Level Module

Graham Bath and Erik van Veenendaal
(Rocky Nook – paperback, Kindle)

If you are a software tester seeking an important new credential to help boost your career, definitely check out this book. Improving the Test Process can help you complete and pass one of the four modules required by the International Software Testing Qualifications Board (ISTQB) to achieve “Expert” certification. (Two of the four “Expert” modules will be available in 2014 and 2015, respectively.)

The ISTQB has established three levels in its Certified Tester program: Foundation, Advanced and Expert. “The result,” the two authors state, “is a structure that supports the development of career paths for professional testers.”

Improving the Test Process has 10 chapters and six appendices devoted to that Expert Level module, including an appendix that focuses on what to expect in the module’s certification exam.

The chapters and appendices are:

  • 1. Introduction
  • 2. The Context of Improvement
  • 3. Model-Based Improvement
  • 4. Analytical-Based Improvement
  • 5. Selecting Improvement Approaches
  • 6. Process for Improvement
  • 7. Organization, Roles, and Skills
  • 8. Managing Change
  • 9. Critical Success Factors
  • 10. Adapting to Different Life Cycle Models
  • Appendix A: Glossary
  • Appendix B: Literature and References
  • Appendix C: The Syllabus Parts
  • Appendix D: The Exam
  • Appendix E: Summary of Cognitive Levels (K-Levels)
  • Appendix F: Answers

The “Answers” appendix provides the answers to exercises posted at the end of chapters 2 through 10.

“The definition of a testing expert used by ISTQB,” the authors note, “is ‘a person with the special skills and knowledge representing mastery of a particular testing subject. Being an expert means possessing and displaying special skills and knowledge derived from training and experience.'”

The book’s authors are both long-time professionals in the field of software testing, and they are co-authors of the ISTQB Expert Level syllabus. So they know their subject matter.

In each chapter, they lay out specific learning objectives and follow with technical content and exercises.

Their well-written book is structured so it can be used for two important purposes: (1) as a preparation guide for taking the ISTQB Expert Level certification exam and (2) as a practical guide for experienced testing professionals who want to learn more about how to improve software testing processes.

Si Dunn

Rapid Android Development – Using Processing to build apps fast – #programming #bookreview

Rapid Android Development

Build Rich, Sensor-Based Applications with Processing
Daniel Sauter
(Pragmatic Bookshelfpaperback)

The main goal of Daniel Sauter’s nicely written new book is to help you learn “how to develop interactive, sensor-based Android apps” quickly.

At first glance, you may question how “quickly” you can go through 13 chapters with a total of 363 pages, including the index.

But there’s good news here, particularly if you are not a patient programmer. The book is divided into five parts, all structured to serve as “self-contained mini-courses.” And the author has geared his text toward six semi-specific categories of readers.

Sauter, by the way, is an artist and educator with some eight years’ experience teaching Processing. Processing is a free “award-winning, graphics-savvy” programming language and development environment that can be used to work with Android devices and software.

Let’s go to the six reader categories first. Rapid Android Development is aimed at:

  1. Readers with at least “a basic understanding of programming concepts….”
  2. Intermediate Processing users “looking to create Android apps from within the Processing IDE….”
  3. “Educators who teach courses on mobile technologies” and need “a free tool that does not require developer licenses or subscriptions.”
  4. Java and Android developers who want to use Processing to leverage “a host of libraries for productivity gains.” (Java developers will quickly see that Processing builds on Java.)
  5. JavaScript and Web developers who want to use Processing.js syntax to help them create “JavaScript-powered web applications that can run inside browsers without plugins or other modifications. Processing.js also takes advantage of WebGL hardware acceleration.”
  6. Arduino users and hobbyists, particularly those “interested in adapting Android phones or tablets for use as sensing devices, controllers, or graphics processors.”

Now let’s look at the five parts of Rapid Android Development.

  • Part I focuses on installing Processing and the Android SDK but also looks at touch screens and Android sensors and cameras.
  • Part II is devoted to “working with the camera and location devices found on most Androids.”
  • Part III’s emphasis is on peer-to-peer networking, including Wi-Fi, Bluetooth and Wi-Fi Direct, plus Near Field Communication (NFC), which is “expected to revolutionize the point-of-sale industry,” Sauter notes.
  • Part IV “deals with data and storage,” he adds, “as all advanced apps require some sort of data storage and retrieval to keep user data up-to-date.”
  • Part V examines 3D graphics and cross-platform apps.

You will need several software tools and at least one Android device to work with the code examples in this book. (The book lists several Android phones and tablets that have been tested with the code examples, which are available online.)

If you want to do some work in Part III, you will need at least two Android devices (so your peer can have a peer). And if you have absolutely no programming experience, you should get some first. Sauter, an associate professor of New Media art at the University of Illinois–Chicago School of Art and Design, offers some suggestions for good sources.

His new book seems a bit light on illustrations. But its well-displayed, well-explained code examples and clear how-to paragraphs keep the reader moving and making progress.

If you are a creative coder looking for some new skills, projects and challenges, check out Rapid Android Development, ASAP.

Si Dunn 

Making Sense of NoSQL – A balanced, well-written overview – #bigdata #bookreview

Making Sense of NoSQL

A Guide for Managers and the Rest of Us
Dan McCreary and Ann Kelly
(Manning, paperback)

This is NOT a how-to guide for learning to use NoSQL software and build NoSQL databases. It is a meaty, well-structured overview aimed primarily at “technical managers, [software] architects, and developers.” However, it also is written to appeal to other, not-so-technical readers who are curious about NoSQL databases and where NoSQL could fit into the Big Data picture for their business, institution, or organization.

Making Sense of NoSQL definitely lives up to its subtitle: “A guide for managers and the rest of us.”

Many executives, managers, consultants and others today are dealing with expensive questions related to Big Data, primarily how it affects their current databases, database management systems, and the employees and contractors who maintain them. A variety of  problems can fall upon those who operate and update big relational (SQL) databases and their huge arrays of servers pieced together over years or decades.

The authors, Dan McCreary and Ann Kelly, are strong proponents, obviously, of the NoSQL approach. It offers, they note, “many ways to allow you to grow your database without ever having to shut down your servers.” However, they also realize that NoSQL may not a good, nor affordable, choice in many situations. Indeed, a blending of SQL and NoSQL systems may be a better choice. Or, making changes from SQL to NoSQL may not be financially feasible at all. So they have structured their book into four parts that attempt to help readers “objectively evaluate SQL and NoSQL database systems to see which business problems they solve.”

Part 1 provides an overview of NoSQL, its history, and its potential business benefits. Part 2 focuses on “database patterns,” including “legacy database patterns (which most solution architects are familiar with), NoSQL patterns, and native XML databases.” Part 3 examines “how NoSQL solutions solve the real-world business problems of big data, search, high availability, and agility.” And Part 4 looks at “two advanced topics associated with NoSQL: functional programming and system security.”

McCreary and Kelly observe that “[t]he transition to functional programming requires a paradigm shift away from software designed to control state and toward software that has a focus on independent data transformation.” (Erlang, Scala, and F# are some of the functional languages that they highlight.) And, they contend: “It’s no longer sufficient to design a system that will scale to 2, 4, or 8 core processors. You need to ask if your architecture will scale to 100, 1,000, or even 10,000 processors.”

Meanwhile, various security challenges can arise as a NoSQL database “becomes popular and is used by multiple projects” across “department trust boundaries.”

Computer science students, software developers, and others who are trying to stay knowledgeable about Big Data technology and issues should also consider reading this well-written book.

Si Dunn

Making Java Groovy – An excellent how-to guide for Java developers – #programming #bookreview

Making Java Groovy

Kenneth A. Kousen
(Manning, paperback)

I have looked at a lot of programming how-to texts in recent years, and this is one of the best I have encountered. Kenneth A. Kousen does not try to get readers to abandon aging and bloated Java in favor of a language that’s sleeker, shinier and newer. Instead, he seeks to show us how to use Groovy’s features and capabilities to help simplify Java, to make working with it easier, more efficient and–yes, even a bit more enjoyable. Indeed, Kousen proposes that we should gradually blend more and more Groovy into our Java code. Hence the title, Making Java Groovy.

(By the way, I lived through the hippie Sixties and remember how weary many of us grew of endlessly hearing the happy word “groovy”–as in “It’s groovy, man, groovy! Everything’s groovy!” I can say honestly that I resisted looking at Groovy, the programming language, for a long time, primarily because of that long-ago, wince-inspiring memory.)

Groovy is an object-oriented programming language that works on the Java platform, and it is intended to complement Java, not replace it. As Guillaume Laforge, the Groovy program manager, explains in his foreword to Kousen’s book: “The idea [behind Groovy] was to empower users to be more productive by removing the boilerplate of Java, and to simplify their programming lives by giving them compelling and straightforward APIs [application programming interfaces] to work with.”

Ken Kousen emphasizes that, among other things, Groovy “adds new capabilities to existing Java classes.” It uses Java libraries. And it makes it easier to work with XML and JSON. Kousen adds that “the Groovy version of a Java class is almost always simpler and cleaner. Groovy is far less verbose and generally easier to read.”

His book has ten chapters and two appendices and is structured into three parts. The first part, titled “Up to Speed with Groovy,” focuses on some long-time Java problems that Groovy addresses and simplifies, and it presents some ways you can use Groovy’s features in Java. The obligatory “Hello, World!” example is presented, but Kousen’s code accesses Google Chart Tools and generates a cool (okay, a groovy) “Hello, World!” 3D pie chart, to which you can add new slices and labels. (But, yes, you do first get the bland and obligatory Groovy shell command-line groovy:000>println ‘Hello, World!’ to verify that your Groovy installation works. Then you get to create the pie chart.)

Kousen is an independent consultant and technical trainer who specializes “in all areas related to Java.” He presents several Java code examples and shows how much shorter they can be made by integrating some Groovy into the mix. “Java historically hasn’t played well with others [other programming languages],” he cautions. But he demonstrates how Java and Groovy can be integrated smoothly to solve some nagging Java irritations and shortcomings.

The book’s second section highlights “Groovy Tools” and emphasizes build processes and testing, “two of the major ways Groovy is often introduced into an organization….”

The third section, “Groovy in the Real World,” describes “the sorts of challenges Java developers face on a regular basis” and how Groovy can help overcome them. The author starts with the Spring framework, “probably the most commonly used open source project in the Java world” and illustrates how “Spring and Groovy are old friends and work together beautifully.”  He also examines: (1) how Groovy interacts with persistent storage; (2) REST-ful web services, “with an emphasis on the JAX-RS 2.0 specification”; and (3) using Groovy in web application development.

The book’s instructions for downloading and installing Groovy are positioned near the back in Appendix A. and seem a bit sparse. But this is okay, since Making Java Groovy is not intended for programming beginners. And I can confirm that writers really don’t like to have to pause a well-written introduction long enough to explain how to download and install the right software for several operating systems.

Following Kousen’s instructions, I installed Groovy fairly easily on a Windows 7 PC, using a Windows EXE installer. He also mentions (too briefly) the Eclipse Marketplace. Since I have Eclipse (with Java and Scala) installed on a Linux machine, I used the Marketplace to get the Groovy and Grails plug-in, too. (My wife did not want Groovy anywhere on her precious Mac, so I did not test that installation.)

“Groovy generates Java bytecodes that are interpreted by a Java virtual machine,” Kousen states. “This means you have to have Java installed to install Groovy.”  Note also: “You need a full Java Development Kit (JDK) rather than a Java Runtime Environment (JRE).” And the Standard Edition (SE) is fine.

Appendix B, “Groovy by Feature,” expands upon Chapter 2’s “Groovy by Example,” and this one seems to be oddly placed. “While some people learn best through short, simple code examples illustrating each concept,” Kousen explains, “others prefer to see basic concepts combined to solve actual problems.” Appendix B “walks through most of the major features of Groovy and provides short snippets of code illustrating them.”

I would be happier if Appendix B had been positioned as Chapter 3, instead. Many people can learn both by feature and by example. And there should be nothing wrong with using one approach to reinforce the other.

But this is minor nitpicking. Making Java Groovy is an excellent how-to guide that I predict will go a long way to help popularize Groovy programming–even among us old guys who still shudder at the verbal excesses of our youth, when we proclaimed “everything” was “groovy.”

Si Dunn

OpenGL ES 2 for Android – A fine quick-start guide for new developers – #android #programming #bookreview

OpenGL ES 2 for Android

A Quick-Start Guide
Kevin Brothaler
(Pragmatic Bookshelf - paperback)

Yes, the timing might seem a bit strange, releasing an OpenGL ES 2 book in early July, 2013, barely a month before the August release of OpenGL ES 3.

However, OpenGL ES 3 is backward-compatible with OpenGL ES 2. And the steps and techniques you can learn in this Open GL ES 2 book for Android are forward-compatible to OpenGL ES 3. Many also are applicable to iOS WebGL or HTML5 WebGL.

This “quick-start guide” assumes you have some experience with Java and Android, and it quickly jumps into creating OpenGL applications for Android. You install software tools such as the Java Development Kit (JDK) and the Android Software Development Kit and create a simple test project. Then you dive into developing and enhancing a 3D game project —  “a simple game of air hockey” — for the remainder of the book.

OpenGL ES 2 for Android is nicely illustrated, well-written, and cleanly organized with short paragraphs and short code examples that clearly have been tested. It is a fine quick-start guide, particularly for developers looking into OpenGL for the first time.

Some math skills are required to develop the air hockey game. But the author does a nice job of explaining and illustrating the math examples, as well.

Kevin Brothaler has extensive experience in Android development. He founded Digipom, a mobile software development shop, and he manages an online set of OpenGL tutorials for Android and WebGL: Learn OpenGL ES.

Si Dunn