Cademy logoCademy Marketplace

Course Images

The Complete Apache Groovy Developer Course

The Complete Apache Groovy Developer Course

🔥 Limited Time Offer 🔥

Get a 10% discount on your first order when you use this promo code at checkout: MAY24BAN3X

  • 30 Day Money Back Guarantee
  • Completion Certificate
  • 24/7 Technical Support

Highlights

  • On-Demand course

  • 13 hours 25 minutes

  • All levels

Description

Learn how to program using Apache Groovy.

Are you looking to learn a new language? Learning a new language helps expand your skillset as a developer and make you more marketable to employers. If you aren't learning a new language because it's not the one you use at work, the author thinks you are missing out on the benefits. He often finds that seeing how other languages solve problems makes me a better developer with the languages he uses on a day to day basis. He is here to tell you all about an awesome dynamic language called Apache Groovy. What is Apache Groovy? Apache Groovy is a powerful, optionally typed and dynamic language, with static-typing and static compilation capabilities for the Java platform, aimed at improving developer productivity thanks to a concise, familiar and easy to learn syntax. It integrates smoothly with any Java program and immediately delivers to your application powerful features, including scripting capabilities, Domain-Specific Language authoring, runtime, and compile-time meta-programming and functional programming. Who Should Learn Apache Groovy? He is going to teach you everything you need to know to start using the Groovy programming language. This course is really designed for 2 different types of people and he think's you will both benefit from it. If you're a beginner programmer with a some experience in another language like Python or Ruby, this course is for you. Dynamic languages are generally thought of as easier for total beginners to learn because they're flexible and fun. If you're an existing Java Developer (Beginner or Experienced), this course is also for you. You will learn Groovy compliments the Java language and makes some of the complex tasks from Java concise and easy. Enroll Today! He has spent a lot of time putting together what he think's is the most complete course on Groovy on the market today. Please take the time to watch the preview videos and if you like what you see, click that enroll button and the author will see you inside! All the code and supporting files for this course are available at - https://github.com/PacktPublishing/The-Complete-Apache-Groovy-Developer-Course-

What You Will Learn

Create Groovy Applications from Scratch
Use the Groovy Console
Write Groovy Applications in IntelliJ
Understand the different features of the Groovy Language

Audience

This course is for Java developers of all levels who have some experience in another language.

Approach

A complete course packed with step-by-step instructions, working examples, and helpful advice. This course is clearly divided into small parts that will help you understand each part individually and help you learn at your own pace.

Key Features

Covered topics are in-depth and very easy to follow for anyone with some prior Java experience. * This course builds a good baseline for development in Groovy. The less technical background lectures promote a deeper understanding of Groovy as a language.

Github Repo

https://github.com/packtpublishing/the-complete-apache-groovy-developer-course-

About the Author

Dan Vega

Dan Vega is a Software Engineer living just outside of one of his favorite places in the world, Cleveland, Ohio He is a self-taught programmer who firmly believes that you can accomplish anything in this life if you put your mind to it, roll up your sleeves and are willing to put in the work. Dan haa been writing software for over 20+ years now uses his knowledge, passion, and influence to help other developers achieve their goals. He teach online and currently, has over 55,000 students. When Dan isn't writing software there are a number of things that really keeps him busy. He loves to read books, listen to podcasts and watch online courses. Dan has a real thirst for knowledge and it consumes him every single day of the week. He also love to run & lift heavy weights which keep him balanced throughout the week.

Course Outline

1. Introduction

1. Introduction and Goals for this course

In this course we are going to walk through some of the fundamentals of the language. After that we are going to cover everything from closures to meta programming, testing, DSLs and so much more.

2. What is Groovy?

The Groovy language is inspired by languages like Python, Ruby, and Smalltalk, making them available to Java developers using a Java-like syntax.

3. The Groovy Website & Documentation

In this lecture we will walk through the Groovy Website and look at all the available resources to us. It is important to know how to find things especially when you are looking for answers. I am going to walk through the website and all the documentation.

4. Groovy Books & Additional Resources

These are not required for the course by any means but I have read them and I think it would be wise to pick one or all of them up.

5. How to get the most out of this course

In this lecture we are going to cover how to get the most out of this course. I have taught a few courses and I have taken a ton of them and I think one of the biggest keys to being successful with them is applying what you learn. To me this means you aren't trying to complete this course in a day. You are spending the time to go through the exercises and quizzes. I would even suggest taking this further if you can. Write your own sample scripts or applications to further understand the code tha


2. Getting Started

1. Intro

In this lecture we are going to talk about what we cover in this section.

2. Installing the Java JDK on Windows

In this lecture we are going to install Java on Windows. Remember that Groovy compiles down to Java bytecode so we still need to install the JDK.

3. Installing the Java JDK on Mac OSX

In this lecture we are going to install Java on Mac OS X. Remember that Groovy compiles down to Java bytecode so we still need to install the JDK

4. Installing Groovy on Windows

Installing Groovy on Windows

5. SDKMAN

In this tutorial we are going to install Groovy on Mac OSX by using one of my favorite tools. The Software Development Kit Manager (SDKMAN) is a great tool for managing parallel versions of software.

6. groovysh

In this lecture we are going to look at groovsh, the Groovy command like shell.

7. groovyc

In this lecture we are going to look at running and compiling groovy programs.

8. Groovy Console

In this lecture we are going to look at the Groovy Console. This program is great for writing small Groovy programs and we will use it throughout the course

9. Hello, IntelliJ

In this lecture we are going to install IntelliJ and then look at how to create a standard Hello, World project. You can use the community edition for this.

10. [Exercise Review] 3 ways to Hello, Groovy

I want to go through a quick review and let you know how I would have solved that problem.

11. From Java to Groovy

In this lecture we are going to look at the differences from a Java class to a Groovy class. If you have never written a single line of code in Java it is still good to see how much less code you use in Groovy. For all of you Java pros out there if this is your first time seeing this it can be an eye opener.


3. Groovy Basics

1. Intro

A few of the lectures will be short and basic introductions but we will cover some of the topics in later sections of this course.

2. Imports

In this lecture we are going to talk through how to use import statements to import packages and classes into your program.

3. Keywords

In this lecture we are going to quickly talk about keywords. The Java language defines 50 keywords that are reserved words in your applications. The Groovy language adds an additional 4 bringing us to a grand total of 54 keywords.

4. Comments

In this lecture we will talk about the different options we have for commenting out code. I also want to look at a great blog post that highlights the evolution of a software engineer

5. Assertions

In this lecture we are going to look at assertions. Assertions (by way of the assert keyword) were added in Java 1.4. An assertion is a statement in the Java programming language that enables you to test your assumptions about your program.

6. Scripts

In this lecture we are going to talk about scripts. We have already seen the idea of scripts a little bit in this course, but we will cover them a little more here.

7. Classes

In this lecture we are going to introduce classes. Classes are one of the most fundamental concepts of object-oriented programming. We could spend hours talking about the building blocks of OOP but what we are going to talk about now is creating objects and using them.

8. [Exercise Review] Create your own Class

In this lecture we are going to review the previous exercise on creating your own class.

9. Numbers

In this lecture we are going to talk about numbers in Groovy. In the next section we will talk more about the different data types in Java and Groovy but for now I want to briefly focus on numbers.

10. Groovy Control Structure

In this lecture we are going to talk about control structures in Groovy. Control structures are a basic feature of any programming language.

11. Annotations & AST Transformations

In this lecture we are going to talk about annotations. You have already seen an annotation in this course and may not have even realized it. In the Java to Groovy demo we showed an example of how we could remove the tostring method and replace it with with a single line above the class. That was the toString annotation.

12. [Exercise Review] Using AST Transformations

In this lecture we are going to review the exercise on AST Transformations.

13. Operators

In this lecture we are going to look at some of the basic operators that you will come across in Groovy.

14. Grapes

In the last lecture we got a quick introduction to annotations. In this lecture we are going to look at a special annotation you may see throughout this course and in examples you come across on the web. The @Grab annotation is used to define external library dependencies in a script.


4. Simple Data Types

1. Data Types Intro

In this lecture I just want to talk briefly about what we are going to learn in this section.

2. Java Data Types

In this lesson we are going to talk about primitive data types in Java. To understand data types in Groovy we need to understand data types in Java.

3. Groovy Data Types & Optional Typing

In this lecture we are going to talk more about Groovy data types. In Java every variable needs to be declared with a type and this is one place where Groovy is very different.

4. Working with numbers

In this lecture we are going to cover some of scenarios you are going to run into while working with numbers in Groovy.

5. Operator Overloading

In this lecture we are going to talk about this concept of Operator Overloading. We are going to look through the documentation and see what operator overloading is available to us and walk through some demos.

6. [Exercise Review] Operator Overloading

In this lecture we are going to review our operator overloading exercise.

7. Strings

In this lecture we are going to look at working with Strings in Groovy. There are different ways to create Strings based on our needs and we will cover most of them here.

8. Regular Expressions

In this lecture we are going to cover the basics of regular expressions. Java has had support for regular expressions (or regex as it's often referred to as) since 1.4. These are a representation of a search pattern used to scan and match for text. While you can use them in Java there are certain situations where they become very complicated. Groovy adds three very helpful methods to the API. In this lecture we are going to cover those, some basics about constructing patterns and a short demo th


5. Collections

1. Collections Intro

If you have done any Java programming in the past you know that working with collections hasn't always been easy. In fact, Groovy took something complex in Java and made it easy to work with and that is one of the main reasons I took a look at Groovy in the first place. In this section we are going to take a look at ranges which might be new to some developers, but they are very useful and easy to work with. We will also investigate maps and lists but thanks to some GDK enhancements they also be

2. Ranges

In this lecture we are going to look at our first complex data type called a Range. Ranges allow us to define a list or "range" of items and move through them.

3. Lists

In this lecture we look at another data type called a list. Lists allow us to create lists of things and there is an easy to use API for manipulating these lists.

4. Maps

In this lecture we are going to look at the final data type of this section called a Map. A map allows us to create key / value pairs of data.

5. [Exercise Review] Using Collections

We are going to review the quiz on using collections.


6. Closures

1. Intro

We are going to begin our introduction to closures in this section. You can start to do some cool things with closures, and they are a fundamental concept in learning the Groovy programming language.

2. What are Closures?

So, what is a closure? A closure is just like a method except that it is a first-class citizen of the language. When I have a method in a class, we give it a name, it takes some arguments and it performs some actions. A closure will do the same thing but unlike a method a closure is an object and can be used or passed around your program.

3. Creating Closures

In this lecture we are going to introduce you to closures. We will walk through how to create them and some of the basic syntax we use to construct closures.

4. Closure Parameters

A closure can accept parameters just like a method can. In this lecture we are going to look at all the different ways a closure can accept parameters.

5. Collections Methods

In this lecture we are going to dive into the documentation and look at some of the different methods we can perform on collections. We are also going to look at how to use a lot of these. These methods should start to make a lot more sense now that we understand how closures work.

6. Curry Methods

In Groovy, currying refers to the concept of partial application. Currying in Groovy will let you set the value of one parameter of a closure, and it will return a new closure accepting one less argument.

7. Closure Scope & Delegates

In this lecture we look at what scopes are available to us in a Closure. The delegate of a Closure is an important concept and helps set them apart from lambdas.

8. [Exercise Review] Using Closures

In this lecture we are going to review the exercise Using Closures.


7. Control Structures

1. Intro

In this lecture we will talk about our introduction into control structures.

2. The Groovy Truth

Before we dive into the conditional structures like if, if / else or when we need to understand what the Groovy Truth is. This is because the expressions that are defined in those control structures need to evaluate at a Boolean and there is a fundamental difference how we handle this in Groovy compared to Java.

3. Conditional Structures

In this lecture we dive into the conditional structures that you are going to use in Groovy.

4. Looping

In this lecture we are going to look at the different looping constructs available to us in Groovy.

5. Exception Handling

In this lecture we are going to get our first introduction to exception handling in Groovy.

6. [Exercise Review] Control Structures

Did you like this exercise? It was pretty short and sweet, but we are starting to write more complete classes, and this is really starting to get fun right?


8. Object Oriented Programming (OOP)

1. Intro

What is Object Oriented Programming (OOP) and why should I care about it? What are some of the concepts that we are going to cover in this section? Please remember that people have written books on this subject alone, so we won't cover everything.

2. Classes / Fields / Local Variables

We have talked about classes throughout this course, but we really haven't had a chance to dive into the details. In this lecture we talk about how to create a class, declare fields and local variables.

3. Constructors & Methods

Now that we have our class created and we know how to create fields it's time to move on to methods. In this lecture we are going to cover how to create and call constructors and methods.

4. Organizing Classes into Packages

In this lecture we are going to use IntelliJ and learn all about packages. When we create classes, we need a way to organize them, so our classes remain maintainable and packages give us that ability.

5. Inheritance

In this lecture we are going to talk about inheritance. When you have behavior that might be common to many classes we create a class to hold this functionality and extend this "base" class from our other classes.

6. Interfaces

Learn more about interfaces.

7. Traits

Learn about traits.

8. Groovy Beans

A JavaBean is just a standard

9. [Exercise Review] What makes a class

Look into this review exercise from the author's perspective.


9. Runtime MetaProgramming

1. Intro to Runtime Metaprogramming

Metaprogramming is one of the highlights of Groovy.

2. Meta Object Protocol (MOP)

The MOP (Meta Object Protocol) is a big concept to understand when it comes to MetaProgramming. In this lecture we are going to define the MOP and explain what it is and how it is used.

3. Customizing the MOP

Now that we have a little bit of an understanding of what the MOP is it's time to dive in a little further. We are going to learn how to customize the MOP using different hooks.

4. MetaClass

Every single class has an associated MetaClass. The MetaClass contains all the methods & properties your class contains. Where the dynamic nature of Groovy comes into play is by manipulating that MetaClass and not the concrete class.

5. Category Classes

Using the MetaClass to add dynamic capabilities to our program is usually going to be the way to go. Sometimes we might prefer an alternative method that is a little more confined and not so application wide. In this lesson I want to look at this problem and show how categories help us solve it. There are also a few built-in categories in the language, and we will look at a demo of one today.

6. Intercept / Cache / Invoke Pattern

In this lecture we are going to look at a pattern called the Intercept / Cache / Invoke Pattern. This is a pretty solid performance pattern that we should be taking advantage of when we start dealing with missing methods.

7. [Exercise Review] Runtime Metaprogramming

We are going to review the Runtime Metaprogramming exercise


10. Compile Time MetaProgramming

1. Intro

We are to look at some AST Transformations that allow us to change the code at compile time.

2. @ToString

A Class annotation is used to assist in the creation of toString() methods in classes. The @ToString annotation instructs the compiler to execute an AST transformation which adds the necessary toString() method.

3. @EqualsAndHashCode

Class annotation used to assist in creating appropriate equals() and hashCode() methods.

4. @TupleConstructor

The @TupleConstructor annotation instructs the compiler to execute an AST transformation which adds the necessary constructor method to your class.

5. @Canonical

The @Canonical annotation instructs the compiler to execute an AST transformation which adds positional constructors, equals, hashCode and a pretty print toString to your class. There are additional annotations if you only need some of the functionality: @EqualsAndHashCode, @ToString and @TupleConstructor. In addition, you can add one of the other annotations if you need to further customize the behaviour of the AST transformation.

6. @Singleton

Class annotation to make a singleton class. The singleton is obtained through normal property access using the singleton property (defaults to "instance"). Such classes can be initialized during normal static initialization of the class or lazily (on first access). To make the singleton lazy use @Singleton(lazy=true). Lazy singletons are implemented with double-checked locking and a volatile backing field. By default, no explicit constructors are allowed. To create one or more explicit construct

7. @Sortable

A class annotation used to make a class Comparable by multiple Comparators.

8. @Immutable

The @Immutable annotation instructs the compiler to execute an AST transformation which adds the necessary getters, constructors, equals, hashCode and other helper methods that are typically written when creating immutable classes with the defined properties.

9. @TypeChecked

This will let the Groovy compiler use compile time checks in the style of Java.

10. @CompileStatic

This will let the Groovy compiler use compile time checks in the style of Java then perform static compilation, thus bypassing the Groovy meta object protocol.

11. @Builder

The @Builder AST transformation is used to help write classes that can be created using fluent API calls. The transform supports multiple building strategies to cover a range of cases and there are several configuration options to customize the building process. In addition, several annotation attributes let you customise the building process. Not all annotation attributes are supported by all strategies. See the individual strategy documentation for more details. If you're an AST hacker, you ca

12. [Exercise Review] AST Transformations

Exercise Review - Find an AST Transformation that we didn't cover and use it.


11. Working with Builders

1. Intro to Builders

In this section we are going to look at builders!

2. MarkupBuilder - XML

In this lesson we are going to cover how to use the Markup Builder to generate XML.

3. Builder Documentation

This lesson will cover a quick tip I picked up on how to find some more examples of using builders.

4. Markup Builder - HTML

In this lecture we are going to look at using the markup builder to create HTML. We will also look at how the markup builder can take a writer as an argument to its constructor and write out an HTML file in our project.

5. [Exercise Review] Markup Builder

In this lesson we are going to review the previous exercise.

6. JSON Builder

In this lesson we are going to look at using a totally different type of builder called the JSON Builder. Even though the JSON Builder is different than the Markup Builder they all use the same underlying structure so building out data should be similar.

7. Object Graph Builder

A builder for creating object graphs. Each node defines the class to be created and the property on its parent (if any) at the same time.

8. List of Builders

We looked at the markup and JSON builder in this section but Groovy ships with many more. I just wanted to take a couple minutes and show you where you can find more information about these builders.


12. Working with REST Services

1. Intro

In this section we talk about how to read and write JSON/XML and how to work with REST Services.

2. Working with XML

As we begin to work with web services we need to understand how to work with different types of data. In this lesson we are going to quickly recap how to use a builder to create xml and then talk about how we can read xml and traverse through that document.

3. Working with JSON

As we begin to work with web services we need to understand how to work with different types of data. In this lesson we are going to quickly recap how to use a builder to create JSON data and then talk about how we can read JSON and extract data from it.

4. HTTP Request Methods (Verbs)

In this lecture we are going to discuss HTTP Verbs. When working with REST APIs it is vital to understand what the different request methods are.

5. HTTP Status Codes

In this lecture we are going to discuss HTTP Status Codes.

6. Content Negotiation

In this lecture we are going to discuss content negotiation. This allows us to use the same resource to send & receive different types of content.

7. Using REST based APIs

In this lesson we are going to look at how to call REST services from your groovy classes or scripts.


13. Working with the GDK

1. Intro

Groovy makes things that are hard in other languages easy.

2. Working with Files & I/O

In this lecture we are going look at how the GDK makes it so easy to work with files, directories and input/output.

3. Threads

In this lesson we talk about what threads are, how to create them in Java and how much easier the GDK makes it. Java has great support for multithreaded applications which allow individual programs to do multiple tasks at the same time. Each task is called a thread and programs that can run more than one thread at a time are said to be multithreaded.

4. Database Programming with Groovy

In this lesson we are going to learn how to connect to a database, create a schema, insert some data and query against it.

5. [Exercise Review] Reading from a Database & Writing to a File

In this exercise review I am going to walk you through my thinking on how to solve the exercise.

6. Templates

Working with templates is one of those tasks you know you're going to need at some point but never sure how to do it. In our case here a template is essentially text. A template unlike fixed literal text allows for some placeholders to be later replaced by dynamic data. You're looking at template right now as you watch this video. There are some web pages that have static text and there are others like this one that have dynamic content. A few things we might use templates for are

7. Dates

Working with Dates in Java has always been another pain point. Java 8 added a new Date / Time API but it still isn't as intuitive as the Groovy API. In this lesson we are going to look at how easy it is to work with a date/time in Groovy.


14. Bonus

1. Contribute to Groovy

In this lesson we are going to look at all the different options available to you to contribute to the open source Groovy project.

2. Debugging in IntelliJ

If you are new to debugging this lesson is for you. I am going to show a quick demo of how you can use the debugger to gain some insight into what is going on in your application.

3. Groovy & Spring Boot

I absolutely love Spring Boot and, in this lecture, I will give you a quick introduction as to what it is and how to use Groovy with it.


15. Conclusion

1. Thank You!

Thank you so much for taking this journey with me!

Course Content

  1. The Complete Apache Groovy Developer Course

About The Provider

Packt
Packt
Birmingham
Founded in 2004 in Birmingham, UK, Packt’s mission is to help the world put software to work in new ways, through the delivery of effective learning and i...
Read more about Packt

Tags

Reviews