Creating Holiday Promotions for Your Small Business

We are finally approaching the end of 2020. This year has tested all of our strength and will power, yet in a matter of days, it will be over. For some small business owners, the holidays signify a…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Chapter 17 Groovy Builders

Programming Groovy 2 — by Venkat Subramaniam (120 / 152)

👈 Part 4 Using Metaprogramming | TOC | 17.1 Building XML 👉

Builders are internal DSLs that provide ease in working with certain types of problems. For instance, if we need to work with nested, hierarchical structures, such as tree structures, XML, HTML, or JavaScript Object Notation (JSON) representations, we’ll find builders to be very useful. They provide syntax that does not tie us tightly to the underlying structure or implementation. They don’t replace the underlying implementation; instead, they provide an elegant way to work with it.

We can use Groovy builders for a number of everyday tasks, including working with XML, JSON, HTML, DOM, SAX, Swing, and even Ant. In this chapter we’ll look at a few tasks to get a feel for builders. We’ll then explore two techniques to create our own builders.

👈 Part 4 Using Metaprogramming | TOC | 17.1 Building XML 👉

Add a comment

Related posts:

Daniel Kaluuya on his new short film Two Single Beds

With short film Two Single Beds — which Daniel Kaluuya wrote and stars in — available on Film4 on All4, we spoke to the Oscar-nominated actor about learning experiences, pressure and the freedom of…

Why I Gave up Using the Apple Watch

Apple have a very healthy slice of the smartwatch market share as you can see below. Apple were the biggest single company in the smartwatch industry in 2018 according to the analysts Counterpoint…

Why we need to adjust the importance work has in our lives

Most people work too much. But who can blame them? Our society values money, success, and the false sense of security from salaried positions above all else. To the point where people are afraid to…