==========================
== Timoteo Ponce's blog ==
==========================

Factories, builders and singletons in standalone applications

utilities java
When I started development, desktop applications were my only target and source of pain. I spent several
hours, days, months making things work. When I moved to web-enterprise development, a lot of frameworks save me a lot of time, things like Hibernate, Seam, JMS, Guice.

But when I tried to go back to desktop applications, things hadn't changed very much, I still needed to do a lot of work. Then I started emulating some of the best features of Enterprise frameworks for desktop application development.

One common problem I've been facing to, it's related to this components:
  • Factories: Delegate object creation and decouple components.
  • Builders: Construct complex components from different parts.
  • Singletos: Let's face it, in standalone applications are not that bad.
I've created a so called 'BaseFactory' component with a Guice-like approach to provide some of the previous features, here it is: