DAOs and Gateways in ColdFusion

Some thoughts on Data Access Objects and Gateways within ColdFusion, and whether or not we really need both of them?

What are DAOs and Gateways?

Firstly a quick overview of what these are:

Data Access Object and Gateways are the names given to ColdFusion components that access information from a database or other external data source. Within the ColdFusion community DAOs and Gateways have pretty much taken on the meaning as follows.

More ...

The Strategy Design Pattern in ColdFusion

Thoughts on the Strategy design pattern specific to ColdFusion and it's typeless nature.

What is the Strategy design pattern?

Suppose you have an object A which needs to use another object B.

[A] --- uses ---> [B]

Then a different situation requires that you need to exchange B for another object C; so object A is then making use of C.

[A] --- uses ---> [C]

The ability to exchange objects B and C without changing object A is the Strategy design pattern in action.

In order for this to be possible, objects B and C need to both implement the common set of functions that object A requires.

In this description, the object A is called our context. The objects B anc C are our strategy objects.

More ...