RE: [coldbox:12443] Nested CFC/Object?

I don’t know how much of a ColdBox thing this is, or if there is really any “coldbox” standard on it. Are you using an ORM, or just rolling your own model? I use a home-rolled model/ORM that lazy loads in composite objects as many levels deep as I need. As far as dumping them, I don’t know if this question is a means to that end, or if you just used that as an example. Since all your data will probably live in the “private” “variables” scope, it makes it difficult to dump out anything since cfdump only shows you public properties (“this” scope and public/remote methods).

In my base bean I have a method called dataDump() (for lack of a better name) which recursively outputs all the properties of that object and every inner object as keys in a struct. Nested objects are nested structs. It works well for quickly visualizing your models in cfdump, but watch out for circular references which will give you a stack overflow pretty quickly. (i.e. company has employee has company etc.)



No, I’m not using any ORM, just rolling my own.

I suppose I can just create a variable in the variables scope within my CFC that is of type Address and that would do it, or maybe in the constructor do it. What do you think about that?

I only asked about dumping them because it would be a good way to see how the objects are nested, nothing more…