Never miss a beat

Join my newsletter.

Tag: java

A Beginner's Guide to Java Enums

Published: 8/5/2019

An Enum in Java is a special data type that encompasses a set of predefined constants. When setting a variable of that Enum type, you have to use one of the constants that you define for it. A great example is the compass: In the above example, we create a new enum and it’s predefined set of constants. Then we create a variable of that enum type, and assign it to one of the constants. Keep in mind that we can only set our direction to Compass.NORTH , Compass.SOUTH , Compass.EAST , Compass…

The Builder Design Pattern

Published: 4/24/2018

Welcome back. I'm writing today to talk about something that I think is pretty cool -- design patterns in code! Specifically, we're going to cover the builder pattern, which I find myself using all the time when writing Android applications and sometimes when writing plain Java applications.

What the heck is Android's Proguard?

Published: 2/21/2018

Hello there Android developer or curious onlooker. Welcome back to another blog post talking about your favorite, my favorite, and the world's favorite mobile operating system. Today we're going to talk about Proguard and what that means for Android Developers.

A Brief Introduction to Tries

Published: 6/30/2017

Hello there! Welcome back! Today I’m talking about Tries (pronounced “trys”). Tries are a type of search tree commonly used for storing and searching single characters that make up one or more strings. What make a trie interesting is that the first node contains an empty value and the descendants of a node have a common prefix associated with that node. Like most data structures, tries are easier to reason about when you have a picture to help explain it. Let’s take the word “propane” break it…

Building RESTful APIs with Ginger, H2, and Java 8

Published: 10/1/2015

Recently, I started writing a few RESTful services in Java Spark. I found a few recurring themes and decided to extract them out into a layer ontop of Spark to make it even easier to build a RESTful service from the ground up. This project is called Ginger and I’ll show you how to create a RESTful service using the Ginger framework. If you get stuck, the completed source code can be found here . Things to know Ginger is built heavily ontop of Spark. As of recently, Spark only runs on Java 1.…

Intro to Reflection in Java

Published: 9/16/2015

Recently, I began exploring an interesting idea I had – creating a RESTful framework built on top of Spark. Now, Spark is naturally restful, but I basically want the user to be able to define an object, flag it as a resource, and compile their code. They should then have GET , POST , PUT , and DELETE verbs available on that object. Sounds relatively trivial right? There are actually several ways to do this, but the simplest way (once I was able to wrap my head around it) involves…