Home > Hackery > Memorable

Memorable

Ok so the intro to the "Hackery" section was a tad exaggerative. But not as far off as you might think. So how did I solve the problem of remembering non normalized data, without having to bother with normalizing it? I mean some data just doesn't seem fit for normalization. For example what do I do with a partially filled out 20 page registration form? Do I really want to normalize that information and save it down to a record in the database only to have to pull it all back out again? That sounds time consuming and pointless. My solution comes in the form of a doctrine behavior, though the idea could be applied to any model which you'd like to store associated non normalized data.

Memorable (a doctrine behavior)

Introducing the "LC_Template_Memorable"

Introducing the "LC_Memory"

So How Does It Work?

Create an model with the new behavior (make sure your memory "tableName" exists in the db).
Use the new "remember" method hanging off your model in your controller.

So What Does It All Mean?

It means that in a pinch you can throw this behavior on your model and remember anything you'd like about are particular record in a very short turn around time. Chances are you'll want to refactor later, but it'll get you through the "Go live" date. Now that's what I call good hackery.

I invite you to send me feedback on any real world applications, questions, or comments. And as always peer review is encouraged. ~mrBurly.

© Lance Caraccioli 2008-2017. Design: spyka webmaster