It’s Not A Framework

I almost forgot to mention, today I embarked on my pseudo-framework journey. I am not intending on making a MVC based framework. Philosophically, I think most of the ones are becoming bloated for the “Getting Real” sized applications for which they’re designed.

With leagues of PHP development under my belt, I’ve grown frustrated with the typical CRUD process that comes along with most web-applications. The solution? Going the extra mile for laziness.

Basic functions so far:

  • The Database Object
    • insert(string $table, arr $fields, arr $values)—pretty self explanatory. Obstacles here include fields that require single quotes in INSERT queries (dates, most text fields, enumerated & set fields).
    • edit(string $table, arr $fields, arr $values)—same idea. Same obstacles.
    • delete(string $table, string key_field, string key_value)—this one gets tricky. As a design decision, I have the option of finding out $table’s primary key from MySQL. Do I want to be restricted to single record deletion? Probably not.
    • select_all(string $table, optional string $key_name, optional string $key_value)—will perform a SELECT * on $table, moving all results returned into a numered associative array, e.g., $userdata[$i][‘username’].
    • connect and query (obvious)
  • The Form Object
    • show_edit(string $table, arr $fields, arr $values)
    • show_insert(string $table, arr $fields)
  • Misc
    • sanitize(string $string)—used in conjunction with the array_map function, this will just trim and strip potential harmful tags from input.

I’ve also been doing a lot of playing with Prototype and Behaviour. Let’s not forget about the V in MVC—that which I think Smarty is more than sufficient.

Where is all of this going? A happier, more efficient me.

Advertisements

About andyhillky
I'm cool.

2 Responses to It’s Not A Framework

  1. ryan guill says:

    I know you are talking about php, but since you at least understand cf, you should look at reactor. It is a cf framework for database abstraction, object relational mappings (orm). It is quite cool and quite refined even though i think its still a pre 1.0 release. Might at least give you some good ideas. ping me if you need more info.

  2. What about Ruby on Rails!!

    I hope to get to see this code sometime. Can I check it out from a code repository?

%d bloggers like this: