This is a space that holds a collection of my personal work and ideas
  • Efficient Text Highlighter
  • Implement the Lightning Algorithm
  • Build a markdown notes taking app
  • Serve Images in Next-gen Formats
  • Package-lock.json Explained

Exception Handling in WebMethods

10/10/2018

Try-Catch block is commonly used to try a risky operation and catch the exception it may raise. This article shows the trick to do the similar thing without writing java code in a flow service with WebMethods.

Read more

Building an Efficient Cache

09/26/2018

To build a cache could be as simple as to just to use a key-value pair kind data structure. It works sufficient most of the time in a single-threaded application. However, when there are many clients access the same cache while the computation being conducted can yield duplicated caching attempts thus defeat the purpose of caching, which is to avoid duplicated computation. This article introduces the existing caching patterns and discusses the key points to create an efficient cache.

Read more

Java Basic Serialization

09/02/2018

Serialization includes the part that serializes an object to a file and deserializes a file to an object that has the desired same state as it was in. It is typically done by using two high-level classes from the java.io package - ObjectOutputStream and ObjectInputStream. In this article, we demonstrate the basic operations of serializing and deserializing.

Read more

Useful File java.io Mini API

08/29/2018

Java io is a very extensive library. There are numerous ways and combinations to write/read data on a file. This article summaries some very useful classes in java.io package.

Read more

Java 8 Time Package and Locale

08/26/2018

Java 8 provides an extensive time computational package - java.time that is recommended for any new code to use because it provides so many helper methods to compute time and easily used with java.util.Locale class to support localization (l10n) and internationalization (i18n). In this article, we will learn some most useful operations using the java.time package with java.util.Locale class through a scenario of Beijing Winter Olympic Game opening day reminder.

Read more

Load and Store Properties File

08/26/2018

Properties files are usually used to externalize configuration from applications to text files. This article introduces the syntax and usage of properties files.

Read more

Locale and Resource Bundles

08/26/2018

Resource bundles allow you to move locale-specific information out from your main source code to a properties file or a java class. In this article, we will introduce the usage of both implementations of the ResourceBundle interface -- PropertyResourceBundle and ListResourceBundle class.

Read more

Behavioral Patterns - Visitor Pattern Exercise

07/17/2018

The Visitor Pattern represents an operation to be performed on elements of an object structure. Visitor lets you define a new operation without changing the classes of the elements on which it operates. In this exercise, we will create a bookstore inventory structure that collects books, movies, and music. We will add shared behaviors across this hierarchical structure by using the Visitor Pattern.

Read more

Behavioral Patterns - Template Method Pattern Exercise

07/11/2018

The Template Method Pattern defines the skeleton of an algorithm in a method, deferring some steps to subclasses. Template Method lets subclasses redefine certain steps of an algorithm without changing the algorithm’s structure. In this exercise, we will use the Template Method Pattern to create a Three Course Dinner Template for training restaurant staff for preparing the meal.

Read more

Behavioral Patterns - Strategy Pattern Exercise

07/03/2018

The Strategy Pattern defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it. In this exercise, we will use the Strategy Pattern to create a simplified Race model from the popular game World of Warcraft.

Read more