Should Your Objects Validate Themselves?

It seems quite common in the ColdFusion community to see objects with a validate() function. This is used to handle when your object contains potentially invalid data, such as invalid data supplied from a form.

This leads to a good question; should your objects be allowed to have an invalid state?

More ...

Nested Set Trees in ColdFusion (v1.0)

A common technique to manage hierarchical data in a relational database is to use an "Adjacency List" model, where you have both an ID column and a Parent ID column in a table. This is easy to understand and maintain but can be difficult or inefficient when you want to retrieve hierarchies of records.

The "Nested Set" model provides an alternative technique for managing this kind of data and is more efficient at reading a hierarchy but requires a little more work for inserts, updates, deletes and moves.

This project provides a library of ColdFusion code that you may like to use to help manage your hierarchical data using the nested set model.

More ...

Nested Set Trees in ColdFusion (v0.8)

A common technique to manage hierarchical data in a relational database is to use an "Adjacency List" model, where you have both an ID column and a Parent ID column in a table. This is easy to understand and maintain but can be difficult or inefficient when you want to retrieve hierarchies of records.

The "Nested Set" model provides an alternative technique for managing this kind of data and is more efficient at reading a hierarchy but requires a little more work for inserts, updates, deletes and moves.

This project provides a library of ColdFusion code that you may like to use to help manage your hierarchical data using the nested set model.

More ...

Nested Set Trees in ColdFusion (v0.2)

A new version of this project is available.

A common technique to manage hierarchical data in a relational database is to use an "Adjacency List" model, where you have both an ID column and a Parent ID column in a table. This is easy to understand and maintain but can be difficult or inefficient when you want to retrieve hierarchies of records.

The "Nested Set" model provides an alternative technique for managing this kind of data and is more efficient at reading a hierarchy but requires a little more work for inserts, updates, deletes and moves.

See the references below for some good links that describe the Nested Set model in more detail (or just try a search in Google).

This entry provides a library of ColdFusion code that you may like to use to help manage your hierarchical data using the nested set model.

More ...

Nested Set Trees in ColdFusion

A new version of this project is available.

A common technique to manage hierarchical data in a relational database is to use an "Adjacency List" model, where you have both an ID column and a Parent ID column in a table. This is easy to understand and maintain but can be difficult or inefficient when you want to retrieve hierarchies of records.

The "Nested Set" model provides an alternative technique for managing this kind of data and is more efficient at reading a hierarchy but requires a little more work for inserts, updates, deletes and moves.

See the references below for some good links that describe the Nested Set model in more detail (or just try a search in Google).

This entry provides a library of ColdFusion code that you may like to use to help manage your hierarchical data using the nested set model.

More ...

Using Constants in ColdFusion Components

In code we often need to make use of constant values. It is good practice to use named constants rather than literal values, but what is a good technique for managing constants in an object oriented ColdFusion application?

More ...

Executing System Commands with ColdFusion

Update 13 May 2008: This project has been moved over to RIA Forge at http://systemcommand.riaforge.org/

This is an update to a previous entry.

Typically when you want to execute a system command you would use the <cfexecute> tag, but there are some situations when this may not be ideal such as when you want to capture both the "standard output" and "error output" streams of the system command.

More ...

What is Abstraction?

You are a person, but clearly you are much more than that. You are good looking and very intelligent and you have a wide range of outstanding skills. You may be great at cooking, an outstanding pianist and perhaps one of the best parents in the world.

However, if I were to interview you for a ColdFusion developer role I would not be very interested in knowing that you make a mean red curry. Although you are a great many things to many people, I would primarily be interested in your skills as a developer. Do you write clean code? Have you used some of the community frameworks? How many years have you been working with ColdFusion? And so on.

In fact my focus would only be on a small part of what you are. I would be focusing on the essential characteristics in you that particularly suited my needs. I would ignore all of the wonderful things about you that are not directly relevant. I have abstracted you into something more generalised and less detailed. You become the abstraction "ColdFusion Developer."

More ...

Object Oriented Pagination in ColdFusion

There are various ways to perform pagination in ColdFusion, but I thought I would offer a few additional thoughts to the subject, including an object oriented approach to handling the results.

More ...

Using ColdFusion frameworks on shared hosting

I have had problems in the past when wanting to use a ColdFusion framework such as Mach II, Model Glue, ColdSpring or Reactor in a shared hosting environment.

For example, suppose you install ColdSpring under the /coldspring directory, then everything works just fine. Then another site on the same shared server also installs coldspring, and then goes on to create a /coldspring ColdFusion mapping to point to their /coldspring directory. Suddenly your site will try to run their copy of the ColdSpring and not yours. Not so good.

It turns out to be quite easy to get around this by simply renaming all of the component references in whatever framework you are using so that the framework is sitting under your own custom directory.

More ...