When I wrote that PseudoObject.cfc
would be useless, I was thinking that all objects created would need 3 file operations, and thus, it would be quite unlikely to perform any better (or even on par with) normal object creation.
Based on the way I implemented it in that post, it would need three file operations.
But sitting in my data management class today, I was reminded of ORM
because the professor noted that we wouldn't normally think of methods acting on an entity in the database, while each entity would have every other thing we would find in a typical object.
In any case, I realized you could move the file operations out a bit, and they would only need to be run once if you were building a ton of objects that shared the same type. This, I would think would be a substantial improvement over creating tons of real objects. And where would you do that? In an ORM framework - if you wanted to return an array of structs as objects. Then, each could be manipulated as if they were a real object!
Now, it would be freakin' sweet if you can attach a function to each row of the query like this. I expect it would be straight forward if possible, but if not, we can still see a lot of possibilities for ORMs out there (I'll probably test that tomorrow). I plan to implement something along these lines in cfrails, if it does hold up for thousands of objects.
Hey! Why don't you make your life easier and subscribe to the full post
or short blurb RSS feed? I'm so confident you'll love my smelly pasta plate
wisdom that I'm offering a no-strings-attached, lifetime money back guarantee!
Leave a comment
Leave a comment
I should reiterate, I don't have any proof that it would be faster - it's just a hunch. Further, I wouldn't know where to begin testing that sort of thing in any meaningful test. Although, I guess a real usage scenario would be just a loop... Anyone have any pointers?
Posted by Sam
on Jan 25, 2007 at 06:33 AM UTC - 6 hrs