Tag: Java
Java Patterns For Concurrency
This post talks about some of the patterns we can use to solve concurrency issues relating to state shared across multiple threads. The goal is to provide some smarter alternatives to slapping synchronized on every method call, or around every block of code. The problem with synchronized is that is requires everyone to participate. If […]
Continue Reading...Modifying Immutable Objects with Chained Methods
When you are coding with immutable objects, there are many times where you not only need to initially define them but may want to create derivative versions of an existing instance. You might want to consider using chained methods to make your code more concise or to take advantage of default or optional parameters.
Continue Reading...Implementing Chained Methods with Inheritance
Chained methods are class methods that return the instance of the object so you can call another method on the same object. This article looks at the problems you can face with implementing classes with chained methods in Java when using inheritance, and how to solve them.
Continue Reading...Java Concurrency – Introduction
First in a series on concurrency and describes some of the problems with concurrency in our code and simple ways we can fix them. While there are far more complex problems that require more advanced solutions they all share the same principles and in many cases, are rooted in these basic solutions.
Continue Reading...Back from the Upside Down
Find out where I’ve been for the last 3 years and where I plan on heading.
Continue Reading...Using Facelets Parameters with Templates in JSF
One feature of Facelets is the ability to define parameters in your pages that can be used anywhere in the template hierarchy. This post shows you how you can pass parameter between the Facelet template and the client.
Continue Reading...JSF Page Templates With Facelets
Templating is a very powerful feature for developing web applications with many pages that follow the same layout and design. This article demonstrates how to use facelets to create reusable templates for JSF pages.
Continue Reading...Exonerating the JSF Lifecycle
One of the many accusations aimed at JSF is the definition and complexity of the JSF Lifecycle. The JSF lifecycle is responsible for processing the page creation and submission and orchestrates the different pieces of the framework. A more thorough description of the process can be found in this article by Rick Hightower. At a […]
Continue Reading...Comparing Constants Safely
When comparing two objects, the equals method is used to return true if they are identical. Typically, this leads to the following code : The problem here is that whether intended or not, it is quite possible that the name value is null, in which case a null pointer exception would be thrown. A better […]
Continue Reading...Immutability Through Interfaces
It is often desirable to have immutable objects, objects that cannot be modified once constructed. Typically, an immutable object has fields that are declared as final and are set in the object constructor. There are getters for the fields, but no setters since the values cannot be saved. Once created, the object state doesn’t change […]
Continue Reading...