On Java Development

All things related to Java development, from the perspective of a caveman.

Archive for the ‘Java Design Patterns’ Category

Creating Summary Data using SQL Count(*) and Hibernate

without comments

Introduction

This post shows how to implement a SQL statement with a Count(*) function using Hibernate. This creates a record set that doesn’t map to an existing entity, so the coding needed to pull the data out of the resulting list and to then put them into a container class is a bit different than usual when using Hibernate and mapped entities.

This post also goes beyond being a simple presentation about an SQL statement inside a DAO. Along the way, it explains many Java development concepts that every developer should know. It also exposes forces that should cause the developer to recognize the need for a certain Java Design Pattern.

Maybe this post should have been called “How to Design an Application to use a Mini-Architecture including Services, Business Objects, Data Access and Transfer Objects while using Hibernate to summarize records.“, but the focus is still about how to use the Count(*) function with Hibernate.
Read the rest of this entry »

Design Patterns

without comments

Java developers should be familiar with design patterns. They provide proven solutions to common problems and incorporating them into your Java designs will result in more reliable and scalable applications.

Read the rest of this entry »

Written by admin

March 30th, 2014 at 5:03 pm

Anatomy of a Web Application

without comments

Introduction

This post is for the reader who is curious about the architecture, components and technologies that make up a web application.
Read the rest of this entry »

Singleton Design Pattern

without comments

Probably the simplest of design patterns, the so-called Singleton ensures one single instance of a class exists. The method presented is guaranteed to execute only once ensuring there is only one instance created (and is thread-safe).
Read the rest of this entry »

Written by admin

January 6th, 2014 at 8:10 pm