Category: Ideas

Ideas are concepts, techniques, procedures or thoughts that we’re working on but are not yet fully “fleshed out” or “ready for prime time”. Take them with a grain of salt. They are intended to generate lots of reader discussion. Once an Idea is fully realized, it could reappear on this site in the form of a How-To or Tip. Aliases: Research, Theories.


Applying the Decorator Pattern to a DataGridView


In this article, I present a simple example of how you can apply the Decorator Pattern to a DataGridView to extend its behavior without using inheritance. This article is not meant to be a tutorial on the Decorator Pattern. Rather, it is just a brief explanation of how I solved a particular design problem using a variation of the Decorator Pattern. With a bit of thought, the reader should be able to apply my design pattern to decorate other types of visual controls and components from the .NET Framework such as Button, CheckBox, ComboBox, Label, ListBox, ListView, Panel, TextEdit and TreeView.
Continue reading » Applying the Decorator Pattern to a DataGridView

Pages: 1 2 3 4

State Pattern Persistence with Hibernate

In my software development job, I do a lot of persistence layer implementation, especially using the Hibernate O/R mapper. I work closely with a clever domain layer programmer who tends to use a lot of design patterns, perhaps because he likes the woman of the cover of Head First Design Patterns.

Sometimes, these design patterns create a bit of a challenge for me in the persistence layer, especially since I always tell my domain layer programmer that I can persist things transparently, without having to muck up his code with persistence layer artifacts.

A case in point is the State pattern. I have now persisted 5 different sets of states so it’s no longer a challenge. However, it took me a little while to figure how to do it. Naturally, I started by checking out Hibernate’s forums but much to my chagrin, I found several people asking the same question but no one offering an answer. Therefore, I will provide an answer in this blog post. Continue reading » State Pattern Persistence with Hibernate