In my first post of Zero to Service, we went over how to build an API using Spring Boot. All of the actions of adding items in this first post were done in memory. In this second post, we’ll be going over how to configure your service so that you can now add and retrieve records from a MySQL database.
For this task, we will be using a popular framework called Hibernate. Hibernate is an ORM (Object-Relational Mapping) framework that allows you to interact with your database in an Object-Oriented fashion while providing many more tools at your disposal.
In this post, we’ll go through all the steps required to get a Java Spring Boot service up and running. At a pretty high level, Spring Boot is an open-source framework that simplifies tasks such as dependency injection and assists with building APIs.
We will be implementing a service that will take care of creating, updating, and retrieving cars from an inventory. In this example, if we follow HTTP and REST standards, we can implement this using two API requests.
Automated testing is a crucial part of high-quality software development. There are several dos and don’ts and pros and cons with every level of automated testing.
If you are not familiar with the different levels of automation, you can go from testing a unit of code (ex. a class), to test the integration of these units (ex. multiple classes), to the whole system. Testing is all about the risks and picking the right compromises. …
While it is true that there are some clear benefits to deploying your applications using containers over virtual machines, in some cases due to costs or other requirements you might prefer to deploy to a virtual machine.
In this post, we’ll go through the steps required for you to be able to deploy a Java Spring service to a virtual machine using GitHub Actions.
Let’s begin with a few assumptions we’ll be making before we begin:
Learn how to not have to implement getters, setters, and other methods for your Java applications by only using a few annotations.
Developing in Java can sometimes feel a little bit verbose. As programmers, we are always eager to write more code but wanting to do less at the same time.
Project Lombok is an open-source library that helps you write less code in a…
Reactive forms are an alternative to creating forms in Angular. Most of the heavy lifting for creating reactive forms happens in the component class instead of the template (HTML file).
One of the big benefits of using reactive forms is that it makes testing easier. The reason for this is that all the code related to your form lives in the component class. Given this, you don’t need to access the template on your tests to test your form. Instead, you can simply write a unit test.
The first step to implement a reactive form will be to…
The decorator design pattern is a software design pattern that helps you add responsibilities to an object at runtime. This pattern is considered to be a structural design pattern. This type of pattern focuses on the relationships between classes and how they can help solve specific problems.
The Gang of Four, in their book Design Patterns: Elements of Reusable Object-Oriented Software, defined the intent of decorator pattern like this:
Intent: Attach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality.
One of the key characteristics of this design pattern is that it follows…
Angular applications by default rely on the browser to compile all the code. Even though this is the behavior, there is a way to change this. You can change your application to compile on a server instead of the client’s browser.
This discussion comes down to client-side rendering (CSR) vs server-side rendering (SSR). In this article, I’ll be going over what SSR and CSR are, their pros and cons, and how to convert your application to do SSR.
In simple terms, CSR relies on the client’s browser to compile the code. On the other hand, SSR relies on a server…
You might be familiar with CI tools such as TeamCity, Jenkins, Concourse, Travis CI to mention a few. Well, this time we’ve got a new neighbor in town.
This new neighbor offers new capabilities to automating your workflows: GitHub Actions.
GitHub Actions provides different ways to automate development tasks. Some of the things you could do are:
These are just…
You might have heard before about the Singleton Design Pattern. It could have been in a book, online course, or in school. Back in the day when I first heard about it, I thought, why would I need to use this pattern? What I wish my professor could have told me was a real-world example of why it is needed.
Several years after that course, I had a good lesson on when to use it and why it is important. Let’s go over why this pattern is so important based on that time where everything went bad for me.
Passionate about coding. Engineering software one keystroke at a time… ⌨️