| |||||||||||||||
![]() Sell Back Your Copy for $7.49
Whether you buy it used on Amazon for $27.50 or somewhere else, you can sell it back through our Book Trade-In Program at the current price of $7.49.
Used Price$27.50
Trade-in Price$7.49
Price after
Trade-in$20.01 |
Fergal Dearle
Fergal is a seasoned software development professional with 23 years of experience in software product development across a wide variety of technologies. He is currently principal consultant with his own software development consulting company, Dearle Technologies Ltd., engaged in design, development, and architecture for new software products for client companies. In the past Fergal has worked in lead architect and developer roles for Candle Corporation on the OMEGAMON product which is now part of IBMs Tivoli product suite as development manager for the Unix implementations of Lotus 1-2-3. In the early 1990s Fergal lead the team at Glockenspiel that developed CommonView, the first object-oriented UI framework for Microsoft Windows. The team was awarded one of the first ever Jolt Productivity Awards by Dr Dobbs Journal.
Product Details
Would you like to update product info or give feedback on images?
|
|
Share your thoughts with other customers:
|
||||||||||||||||||||||
|
Most Helpful Customer Reviews
8 of 8 people found the following review helpful:
4.0 out of 5 stars
A Guide for Understanding And Writing Groovy DSLs,
This review is from: Groovy for Domain-Specific Languages (Paperback)
Preface
The book Groovy for Domain-Specific Languages [Packt Publishing: 3, Amazon.com: 5] written by Fergal Dearle [4] has been published by Packt Publishing in May 2010. As the title mentions it is all about how to implement domain-specific languages aka DSLs based on the Groovy programming language. With this book the author explicitly targets Java programmers. As can be seen in the separate chapter descriptions below, the book covers Groovy basics, advanced DSL-related language features and script integration issues. Although not explicitly mentioned, this book covers Groovy up to version 1.6, as this can be deducted from some code samples and screenshots. Chapter Summary Chapter 1 - Introduction to DSL and Groovy The first chapter starts with a general introduction to general purpose programming languages which leads to a brief introduction to specific languages also known as domain-specific languages (DSLs). In addition, the author gives a brief introduction into Groovy and how it relates to the Java platform. A first example of Groovy's XML markup builder gives a practical example on how certain dynamic programming features support building custom DSLs. Chapter 2 - Groovy Quick Start The second chapter covers Groovy from ground up split into two main parts: the first part is the administrative one - it explains where to get Groovy and how to install it on various operating systems and gives an overview about basic commands found in Groovy's binary directory: groovy, groovysh, groovyConsole and groovyc. The second part of this chapter introduces Groovy in about 23 pages and clearly targets programmers with a Java background, not supposed to be an introduction for Groovy newbies without a Java background. Chapter 3 - Groovy Closures The third chapter handles Groovy closures in en detail. It starts with code examples of simple closures, explains closure parameters and how separate methods in Groovy's Closure class relate to them and goes over to currying. At the end of this chapter it introduces this, delegate and owner as being important implicit variables in the context of Groovy closures. Chapter 4 - Example DSL: GeeTwitter The fourth chapter introduces a custom DSL around Twitter4J [1] - a library containing Java classes for accessing Twitter's REST API [0]. The first version of GeeTwitter introduces Groovy's optional parenthesis on method calls and shows possible approaches for using that DSL in Groovy scripts. At the end of this chapter, the reader has built a source-complete abstract base class for creating GeeTwitter DSL scripts. Chapter 5 - Power Groovy DSL Features Now it really comes down to the crunch. This chapter can be seen as most important chapter, as it covers a lot of ground about Groovy language features used in real-world frameworks like Grails: Groovy's meta object protocol and meta-programming, the ExpandoMetaClass, the Builder pattern and Groovy's base builder classes. The chapter gives a good appreciation of what can be achieved by using these powerful features and gives a greater understanding how to use fully-functioning custom DSLs. Chapter 6 - Existing Groovy DSLs This chapter mainly handles Grails-specific DSLs and how they are implemented in the light of using Groovy's power DSL features. In addition, the author gives an overview of some selected TDD frameworks out of Groovy space: GSpec, EasyB and Spock. The overview concentrates on what can be done with these frameworks and not so much of how this is done by the frameworks. Chapter 7 - Building a Builder Hint: This chapter is available as sample chapter [2]. The chapters starts with a detailed discussion of variable resolving strategies in the context of Groovy closures and summarizes the most import meta-programming features for Groovy DSL development. Afterwards, it introduces Groovy's BuilderSupport and FactoryBuilderSupport. Chapter 8 - Implementing a Rules DSL The eight chapter shows how to implement a business rules DSL based on the concept of Groovy scripts and bindings. The given example is about an imaginary broadband service provider program that needs business rules for rewarding customer accounts with a scoring system, leading to the Reward DSL. The chapter closes with a paragraph on testing DSLs with Groovy's GroovyTestCase. Chapter 9 - Integrating It All This chapter handles typical integration issues: using Java classes from Groovy code and vice-vera, how to use Groovy classes within the Spring framework via dependency injection and how to integrate scripts in existing Java applications. Summary The book is mainly for Java programmers or Groovy newbies with a Java background that want to integrate a custom Groovy DSL into an existing application. It starts with a brief introduction to Groovy and DSLs in general, takes a closer look at Groovy closures and moves on to practical examples on how to apply various features of the Groovy programming language to design custom domain-specific languages. The reader should get a fundamental understanding on how to built and integrate custom DSLs and how this was done by frameworks like Grails. Personal Opinion Groovy is a great language for designing domain-specific languages. Although it is easy once you are familiar with the most important concepts, messing with a Groovy DSL is like `just get it working somehow' for Groovy or Grails beginners. This book equips its readers with a basic understanding about Groovy programming language features that can be used to create custom DSLs. This leads to a better understanding about how those concepts are used in Grails and other frameworks and surely raises the knowledge on Groovy programming features.
4 of 4 people found the following review helpful:
4.0 out of 5 stars
More 'Groovy' than DSL, presented in a Java-understandable way,
This review is from: Groovy for Domain-Specific Languages (Paperback)
The book really covers two topics: The Groovy language and writing Domain-Specific Languages.
The Groovy portion is thorough and offers a broad survey of the language. Given nearly 300 pages, a lot of ground is covered, but there's usually only one example per topic shown in code. That's ok, though-- at times I needed more than one example, but never failed in my quest to find additional material via the internet. Once given an idea about the a Groovy feature (with surrounding contextual text and the usual single example) I knew what that feature was for. After that, it was up to me to gain mastery through external sources in some cases. No problem here. The DSL part was interesting, from the point of view of a Java coder. Dynamic language features like Meta-programming and the definition of new methods on the fly are new to me, so I had a lot of questions answered as I looked over the way the author used these features to build a DSL. Interesting! All things considered, I found the book to be a good read and I expect it'll find future use as a reference in my developer's bookshelf. Java coders can pick this one up and feel right at home.
2 of 2 people found the following review helpful:
4.0 out of 5 stars
Get started with writing a DSL for your applications,
By
This review is from: Groovy for Domain-Specific Languages (Paperback)
Groovy for Domain-Specific Languages has the subtitle 'Extend and enhance your Java applications with Domain-Specific Language in Groovy'. The book is aimed at Java developers who want to write a Domain-Specific Language (DSL) and integrate it with their applications.
Because the book targets a Java audience the first chapters are mostly an introduction to Groovy. The first chapter is an introduction to Groovy and Domain-Specific Languages (DSLs). The author explains some common concepts for DSLs and common examples of DSLs. In the second chapter we learn how to install Groovy and how to write and run scripts. Next we get a brief introduction into the Groovy language features, so as a Java developer we get enough knowledge to get started with Groovy. Features like metaprogramming are covered in a later chapter. In chapter three the author covers closures. Because Groovy supports closures and they are important for writing DSLs a complete chapter is devoted to closures. This is a good thing, because as Java developers we get a good understanding of the power of closures, we don't have in Java. We learn how to write closures, pass parameters, curry parameters and invoke them. The book doesn't cover the latests Groovy 1.7.2 curry methods, but it is enough to get started. After the first three chapters we learned enough to write our first DSL. The author explains how we can write our own DSL for a Twitter client. First we learn about the Twitter API and how to use it with the Twitter4J library. Next we are going to make the API calls more Groovy by using closures and Groovy's collection support. This results already in more readable code that doesn't read like normal Java code. We even learn how we can write a command-line script to use the Twitter DSL. The author explains that we can extend from the Script class to provide a very clean DSL that just read like English. So after the fourth chapter we already can write our own DSL in Groovy with jsut the basic Groovy features. In chapter five the author introduces more powerful Groovy features. We learn about named parameters, builders and the builder design pattern, metaprogramming with Groovy's Meta-Object Protocol (MOP) and the ExpandoMetaClass to enhance classes. In chapter six the author shows some existing DSLs from the Groovy eco-system. This is a bit theoretical but we get to see Grails' GORM, Gant, and test frameworks like Spock and EasyB. For a Java developer this might be new and shows at least the power of Groovy and what type of DSLs can be achieved. Builders are a powerful way to work with hierarchical data and constructs. So chapter seven is completely dedicated to builders. This chapter is also available as free chapter for download. The author first explains how we can use closures and the invokeMethod and methodMissing methods to construct a builder. Next we learn how to use the BuilderSupport classes to create our own builders. In chapter eight we learn how to write our own rules DSL and that is where it really gets interesting. We learn how we can use the bindings support in Groovy for a business rules DSL. We create a DSL to define rewards and promotion rules for an imaginery online media provider. Step by step we build the DSL and write supporting classes to load the DSL rules and execute them with concrete domain object classes. In the last chapter we learn different ways to integrate the rules DSL from the previous chapter in a Java application. First we see how Groovy and Java integrate. And next we learn how we can integrate the DSL script with GroovyClassLoader, GroovyShell and GroovyScriptEngine. Groovy for Domain-Specific Languages is a good book to learn how to write a DSL in Groovy. As a Java developer we get enough introduction to Groovy to get started, but if we already know Groovy we can skip the chapters about Groovy's features. It is good that in chapter four we already learned enough to write a DSL for the Twitter API. This shows that writing a DSL doesn't have to be difficult. The rest of the book introduces some more powerful features so in the end we can write a builder and a extensive rules DSL that can be integrated in our Java (or Groovy) applications. The book is a good starting point and provides useful code to get stared with writing our own Domain-Specific Language in Groovy. The author doesn't cover AST transformations as a another way to write DSLs, but with the provided information we can already achieve a lot.
Share your thoughts with other customers: Create your own review
|
|
Tags Customers Associate with This Product(What's this?)Click on a tag to find related items, discussions, and people.
|
|
This product's forum
Active discussions in related forums
Search Customer Discussions
|
Related forums
|