Managed Hosting



Dynamic Bean
Project Home Blog Forums Known Issues Contact Project

Author: Patrick Santora (All RIAForge projects by this author)
Last Updated: October 25, 2007 6:47 PM
Version: 1.0
Views: 18,869
Downloads: 746
License: Apache License, Version 2


The dynamic bean simplifies the “creating a bean with generic accessors (setters and getters)” process by automatically creating the accessors in memory at runtime as they are called. This is done by using the OnMissingMethod method now provided with ColdFusion 8.

If you have seen something similar, don’t stop reading, read on, it gets better.

For those who are not familiar with accessors, normally the accessors are physical methods residing within a bean that assist the bean to set/get private internal bean variable information.

By making the creation of accessors automatic and in memory we make the bean smarter. In the end this can save development time (not having to worry about writing the accessors) as well as save physical server disk space.

Disk Space? The disk space is a large factor since Cold Fusion creates a physical file on the server that represents the “physical” method/accessor within the bean itself. Now that the methods would be in memory, no physical file would be created. Pretty cool huh? This will be handy for those huge projects with many beans. cfclasses be gone! Well sort of. You may need to still build a physical bean with just a component wrapper and init type constructor if your application depends on those.

In a way you can look at this as providing a level of dynamic subclassing to ColdFusion. Benefits? Yes!.

There are other ways that the bean can be used. One example is by using the bean to create a dynamic bean collection based on database record sets pulled from a database.

I'm sure there are others and I encourage the ideas to blossom against this project, so bring it on!

I’ve saved the best for last. The Dynamic Bean doesn’t just hold variable information. It TRACKS what you have asked for thus far and creates a metadata structure similar to the structure of data you would see if you were to call getMetaData() in ColdFusion. The key benefit to this is that it keeps the dynamic bean from becoming a black box as well as gives a window to working against data that could be dumped out as a physical bean (I should be working on this soon if people see this as an additional benefit).

Recent Blog Entries:


ColdFusion 8

Issue Tracker:

There are no issues for this project.

To enter issues for this (or any other) project, you must be logged in.