Author: cdimascio

Java Getters and Setters with Lombok

Sick of all the boilerplate code required to create simple getter/setters with Java? Checkout project Lombok! Let’s suppose we want to create a simple class with the following: public getter/setter for age protected setter for name With Vanilla Java, we might do the following: However, with Lombok (we remove most of the cruft) and we simply write: How cool?!?! Thank you!

Windows process impersonation using RunAs, Windows APIs, and psexec

Impersonation is the ability of a thread or process to execute in a security context that is different from the context of the process that owns the thread or process. On Windows, there are many ways to impersonate a user. Some methods are very easy to use. Some are very insecure. In this post we will review the following methods: Using RunAs Using Windows APIs Using psexec Impersonation is also available...

RESTful Design Principles

Here, we will outline the set of RESTful design principles that should be adhered to when creating a ‘proper’ RESTful service. Let’s start with the basics. What is REST? REST = REpresentational State Transfer. REST is an architectural style for network based software that requires stateless, cacheable, client-server communication via a uniform interface between components. The primary focus of this blog post is to introduce REST along with REST terminology, REST concepts, and some simple...

Debugging a Java application… Remotely!

Have you ever had the need to debug a Java application remotely? You can! This post describes how you can do using Java and Eclipse. Let’s start by describing some important  Java remote debugging parameters that we’ll make use of later. transport=dt_socket instructs the JVM that the debugger connections will be made through a socket address=8998 opens port number 8998 for use by the debug session suspend=y starts the JVM in...

JUnit Basics

Unit tests are written to ensure that small units of code function as intended. When it comes to Unit tests, the higher your code coverage, the higher your confidence when refactoring and/or extending code functions and features. Unit tests play an incredibly important role when it comes to sustaining and maintaining code. JUnit is a simple, yet powerful unit test framework for Java. JUnit enables you to construct test cases...


Get every new post on this blog delivered to your Inbox.

Join other followers: