The Complete Apache Groovy Developer Course
- 13.5 hours on-demand video
- 16 articles
- 1 downloadable resource
- Full lifetime access
- Access on mobile and TV
- Certificate of Completion
Get your team access to 4,000+ top Udemy courses anytime, anywhere.Try Udemy for Business
- Create Groovy Applications from Scratch
- Use the Groovy Console
- Write Groovy Applications in IntelliJ
- Understand the different features of the Groovy Language
- Retain Information through quizzes and exercizes
Welcome to the complete Apache Groovy Developer Course. My name is Dan Vega and I will be instructor. I have been developing software for over 15 years now and I have a real passion for teaching and helping others. I use Groovy almost every single day and I can honestly tell you that I enjoy working with language and Groovy makes programming fun again.
I want to start off by thanking you for purchasing this course. I spent a lot of time developing what I think is one of the most complete courses on learning Groovy around. In this course we are going to walk through some of the basic fundamentals of the language. After that we are going to cover everything from closures to meta programming, testing, DSLs and so much more. I am taking a very hands on approach in this course. We are going to have a ton of quizzes and exercises to help reinforce the things that we learn in each section. After each exercise we are going to discuss the problem and walk through the solution together.
So I hope you enjoy this journey with me and if you have any questions please don’t hesitate to ask them.
In this lecture I want to take a few minutes and explain what Groovy is to those of you brand new to the language. If you’re not new to Groovy I still think you might learn a thing or two so let’s jump on in. 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. The Groovy language is inspired by languages like Python, Ruby, and Smalltalk, making them available to Java developers using a Java-like syntax.
In this lecture we will walk through the Groovy Website and look at all of 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 of the documentation.
I don't know about you guys but I really like to use as many resources that are available to me as I can when I am trying to learn something. I love courses like this one as well YouTube videos, blogs, articles and even good old fashioned books. I want to spend a couple minutes and talk about a few books that have really helped me out. 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.
Groovy in Action (Second Edition)
Making Java Groovy
Programming Groovy 2
At the end of this course I have a section on additional resources. This will contain some links to websites, books, blogs, podcasts, YouTube videos or anything else I think might be of help to you.
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 that we are going through in each section. When you get comfortable enough create your scripts and applications and upload the github.
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. If you are on Mac OSX you can still install Groovy manually but quite honestly I don't know why you would.
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.
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.
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 the 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 that will bring everything together for us.
In the last section we took a look at some basic data types in Java & Groovy. In this section we are going to dive into some complex data types also known as collections. 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 look into maps and lists but thanks to some GDK enhancements they also become very easy to work with.
In this section we are finally going to dive into Closures. You aren’t going to get very far in Groovy before you start running into Closures. They are everywhere and a pretty big part of the language. In fact they are probably the key feature that has made Groovy as popular as it today. That is why this section is extremely important to understand and I hope you will take the time to really understand we go over here.
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.
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.
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 ot a boolean and there is a fundamental difference how we handle this in Groovy compared to Java.
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. This is an introduction to the terms and concepts to make you more familiar with them so you can spot them and use them.
A JavaBean is just a standard
- All properties private (use getters/setters)
- A public no-argument constructor
- Implements Serializable.
Java provides a mechanism, called object serialization where an object can be represented as a
sequence of bytes that includes the object's data as well as information about the object's
type and the types of data stored in the object.
- Create a Java Bean
- Equivalent Groovy Bean
- Look at a Groovy Bean under the hood
- How to use Groovy Beans
- How to write your own getters / setters
- Direct field access
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 take a 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.
@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:
@TupleConstructor. In addition, you can add one of the other annotations if you need to further customize the behavior of the AST transformation.
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 constructors use
@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 a number of configuration options to customize the building process. In addition, a number of 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 can also define your own strategy class. The following strategies are bundled with Groovy:
- SimpleStrategy for creating chained setters
- ExternalStrategy where you annotate an explicit builder class while leaving some buildee class being built untouched
- DefaultStrategy which creates a nested helper class for instance creation
- InitializerStrategy which creates a nested helper class for instance creation which when used with
@CompileStaticallows type-safe object creation
- Some experience using any programming language
Are you looking to learn a new language? Learning a new language helps expand your skill set 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, I think you're missing out on the benefits. I often find that seeing how other languages solve problems makes me a better developer with the languages I use on a day to day basis. I am 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?
I am 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 I think 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.
I have spent a lot of time putting together what I think 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 I will see you inside!
- Developers of all levels who have some experience in another language
- Java developers of all levels