Ken,

Anything that is done differently than the way you do it is wrong.  If it was
right, then you would be doing it that way.

In some cases, we see the benefit and then adjust our style.  But, more often,
it is easier for our approach to be right.

I can argue this either way.  Certainly, if the code is in a table, it is
subject to modification (potentially malicious), is not easy to control (via
current source control approaches), and can create some very difficult to track
problems (since you may not realize that the code is being called from the wrong
record than you expect.)  I can go on, but you get the idea.

On the other hand, you get all the benefits from such an approach.  But, as has
been mentioned, you have lived with this approach and are comfortable with it.
Also, you have the benefits of macro expansion (&) and ExecScript() - both of
which were unavailable in most languages - at least until recently.  The ability
to use these two options makes using a table viable and the lack makes it
impractical.

Anyway, my thought on the matter is simple.  Does this approach allow you to
create code that works better and/or faster than the code written "the right
way"?

I remember the first application I saw by Ken Levy.  It was for the CHP (as I
recall).  What made it so cool is that he used all the controls the wrong way.
He was able to implement drag and drop in Fox 2.x by using windows that looked
like buttons, etc.  The fact that it was not "the correct way to right code" did
not stop him from creating a killer app that could not have been written
otherwise.

Anyway, just my 2 cents on this topic (hey, why is there a $ on the keyboard,
but no cents symbol?)

Fletcher

Fletcher Johnson
[EMAIL PROTECTED]
408-929-5678 - Cell
408-946-0960 - Work
501-421-9629 - Fax 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of
Kenneth Kixmoeller/fh
Sent: Sunday, February 04, 2007 10:49 AM
To: Profox
Subject: [WEB] Storing code in tables

Hey - --  -

Since I see y'all chatting...

I am working on my framework for designing Web applications using PHP, and in
this case, MySQL. One of the goals I have had for a long time in my development
(in any language) is to keep things flexible by putting lots of stuff in tables.
This includes metadata tables which specify ordinary validation rules:
mandatory?, typical formats, encrypted?, stuff like that. The typical ones
result in a function call to a utility object embedded in a data object:
IsValidFormat (<string>,"Telephone"), for example. For exceptional validation,
this includes a field for a bit-o'-code for custom validation or table- level
validation.

Also, for the same flexibility reason, my framework design keeps page- related
information, including display code in a table, too. This is never core code
like login validation or data object definitions, only again, function calls to
data and UI objects. All of the class definition code is kept in files, not
tables, off of the Web tree.

When I posted a question related to this strategy in a PHP group, I got an
individual who said that this strategy is very dangerous, and (in so many words)
I'm an idiot for even contemplating it. Mind you, he only knew the "code in
tables" part, without the level of detail above. I subsequently supplied it, but
so far without response.

Whadaya think? Is this an ill-conceived strategy?

Ken


[excessive quoting removed by server]

_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to