I wrote a couple of applications in CF that use NoSQL data warehouses: one uses the Google App Engine data store, and the other uses MongoDB.
In both cases, I did CFC to act as my objects. But I used the built-in "framework" object, which uses onMissingMethod for accessors, and cfproperty with lots of custom metadata to define the properties of the objects.
For example, this is all that I NEED to define for a model if it does not have a custom business logic:
<cfcomponent output="false" persistentLayer="GAE" persistentClass="asana" extends="com.bespokelogic.framework.BaseModel"> <cfproperty name="id" type="string" persistentDatatype="string" settable="true" gettable="true" required="true"> <cfproperty name="deckSet" type="string" persistentDatatype="string" settable="true" gettable="true" default="basic"> <cfproperty name="englishName" type="string" persistentDatatype="string" settable="true" gettable="true"> <cfproperty name="traditionalName" type="string" persistentDatatype="string" settable="true" gettable="true"> <cfproperty name="pronunciation" type="string" persistentDatatype="string" settable="true" gettable="true"> <cfproperty name="anatomicalFocus" type="array" persistentDatatype="array" settable="true" gettable="true" default="#arrayNew(1)#"> <cfproperty name="therapeuticFocus" type="array" persistentDatatype="array" settable="true" gettable="true" default="#arrayNew(1)#"> <cfproperty name="benefits" type="string" persistentDatatype="string" settable="true" gettable="true"> <cfproperty name="variations" type="string" persistentDatatype="string" settable="true" gettable="true"> <cfproperty name="contraindications" type="array" persistentDatatype="array" settable="true" gettable="true" default="#arrayNew(1)#"> <cfproperty name="skill" type="string" persistentDatatype="string" settable="true" gettable="true"> <cfproperty name="instructions" type="string" persistentDatatype="string" settable="true" gettable="true"> </cfcomponent>
All CFC modules extend the base model, which has validation, serialization, deserialization, and virtual getter / setter methods.
Then I have a persistence layer that knows how to get and put objects from / to the data store.
Then I wrote a service for each of the models that use the save level.
The result is that models know how to serialize their property data, and persistencelayer knows how to insert them into the data warehouse.
So, in a sense, this is not an object-relational manager, but rather a document object manager.
The frame is much more fully represented in fact, since my design was that I take some models and save them in SQL, some in NoSQL, all in one application - and I could replace the underlying data store without recoding the application . It was a partial success.
In your case, if you use one data warehouse, you can skip all these complex things.
You just need a base object that knows how to serialize and deserialize models, as well as your getter / setter stuff. Decide how you want to store the property data in CFC. I used a structure called "variables.instance._properties {}"
Then write a service for your model (s), which has put and fetch methods. For example, the put method takes a model, calls the serialization method to turn it into JSON, and then inserts it into Mongo. The fetch method receives a Mongo record, creates a new CFC instance, and passes the Mongo record to the deserialization method.
That was pretty weird ...
TL DR: "Objects in CF (for example, they are) are actually not all that static. Use CFC. Use onMissingMethod to enable dynamic properties. Store properties so that you can serialize and deserialize them in a format (usually JSON), which is easily digested by your data warehouse. Write a simple persistence layer that receives and places documents to / from the data warehouse. Write simple services that implement your persistence level and take and return dynamic models to you.
CF is very suitable for NoSQL, in my opinion.