RE: [WEB] Storing code in tables

2007-02-06 Thread Fletcher Johnson
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.


Re: [WEB] Storing code in tables

2007-02-04 Thread Ed Leafe
On Feb 4, 2007, at 1:48 PM, Kenneth Kixmoeller/fh wrote:

 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?

I don't think it is dangerous; I just think it is a VFP mindset.  
Outside of the VFP world, you're going to get a lot of reactions like  
this. Code is more flexible in text files, not in tables.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




___
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.


Re: [WEB] Storing code in tables

2007-02-04 Thread Kenneth Kixmoeller/fh

On Feb 4, 2007, at 1:01 PM, Ed Leafe wrote:

   I don't think it is dangerous; I just think it is a VFP mindset.
 Outside of the VFP world, you're going to get a lot of reactions like
 this. Code is more flexible in text files, not in tables.


Thanks, Ed. I don't mind having a VFP mindset, but these comments  
challenge me to consider whether that is a good or bad thing in this  
instance.

Is it really a VFP mindset, or just a data guy mindset?

Ken


___
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.


RE: [WEB] Storing code in tables

2007-02-04 Thread john harvey
My WASP program uses memo fields to store code, so that when you make a
selection from a dropdown, the code fires from the memo field. It allows me
to add code without recompiling the exe, and since it is running on a fat
client, I don't worry about it. People act like they work for the NSA or CIA
and there are spooks out there trying to read the IR from their screens. If
that is the case, then I think maybe a different strategy might be in order,
and find a room with windows.

John

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Kenneth Kixmoeller/fh
Sent: Sunday, February 04, 2007 12:49 PM
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.


Re: [WEB] Storing code in tables

2007-02-04 Thread Ed Leafe
On Feb 4, 2007, at 2:31 PM, Kenneth Kixmoeller/fh wrote:

 Is it really a VFP mindset, or just a data guy mindset?

I've worked with database apps in a variety of environments, but to  
be honest I've never seen the approach you describe, where an  
application's logic is considered data, outside of the VFP world.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




___
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.


Re: [WEB] Storing code in tables

2007-02-04 Thread Kenneth Kixmoeller/fh

On Feb 4, 2007, at 1:28 PM, Ed Leafe wrote:

 ...never seen the approach you describe, where an application's  
 logic is considered data...

Maybe that is a programmer guy mindset. bg

The validation part of it I see as a natural extension of metadata,  
the other part I need to reach to find an 'engineering  
justification. Still reaching...

Ken


___
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.


Re: [WEB] Storing code in tables

2007-02-04 Thread Kenneth Kixmoeller/fh

On Feb 4, 2007, at 1:27 PM, john harvey wrote:

 People act like they work for the NSA or CIA...

g I'd tell you more, but... rest of cliché

Ken



___
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.


RE: [WEB] Storing code in tables

2007-02-04 Thread mrgmhale
I was firing commands from Memo fields, line by line (no If-Endif/While
Loop/Case based commands obviously) for years before EXECSCRIPT() came
along.  The biggest reason was to allow me to fine tune behavior of my main
code without recompiling an app.  Imagine my delight when Ed had looked at
my technique and told me about VFP7 having EXECSCRIPT().  Works like a
champ, although the VFP7 debugger craps out when I SET STEP ON in called
code via EXECSCRIPT() and can't find its way back home.  VFP8/9 fixed that
problem.  And with VFP8/9 EXECSCRIPT() I do process If-Endif/While/Case
based commands with ease.

I have even gotten to the point where I use database tables with fields that
contain various configuration values to build on-the-fly code from my Memo
fields that are then fired off via EXECSCRIPT().  Works great.  I spend far
less time testing inside a project, recompiling,  chasing down various
versions of code.  I tell my clients it is a Database-Centric method of
designing my solutions.  They all seem to think it sounds advanced,
therefore must be worth a grunt at least.  And with the code within the Memo
fields I really couldn't care less if someone sees it.  The real horsepower
is in the .app/.exe files, although I do not protect that with ReFox or
anything.  Perhaps I should, eh?  heh-heh...

Gil

 -Original Message-
 From: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED] Behalf Of john harvey
 Sent: Sunday, February 04, 2007 2:28 PM
 To: [EMAIL PROTECTED]
 Subject: RE: [WEB] Storing code in tables


 My WASP program uses memo fields to store code, so that when you make a
 selection from a dropdown, the code fires from the memo field. It
 allows me
 to add code without recompiling the exe, and since it is running on a fat
 client, I don't worry about it. People act like they work for the
 NSA or CIA
 and there are spooks out there trying to read the IR from their
 screens. If
 that is the case, then I think maybe a different strategy might
 be in order,
 and find a room with windows.

 John

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
 Of Kenneth Kixmoeller/fh
 Sent: Sunday, February 04, 2007 12:49 PM
 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.


Re: [WEB] Storing code in tables

2007-02-04 Thread MB Software Solutions
john harvey wrote:
 My WASP program uses memo fields to store code, so that when you make a
 selection from a dropdown, the code fires from the memo field. It allows me
 to add code without recompiling the exe, and since it is running on a fat
 client, I don't worry about it. People act like they work for the NSA or CIA
 and there are spooks out there trying to read the IR from their screens. If
 that is the case, then I think maybe a different strategy might be in order,
 and find a room with windows.


   
It's dangerous from the perspective of managing source code control 
(SCC) perhaps, or that you can easily insert new code without the 
traditional approaches; that said, the n-tier VFP open source project I 
posted in the OpenTech forums uses a meta-table for the all of the SQL 
definitions. 

I think it comes down to:  how much code do you want under SCC versus 
the flexibility you can achieve with somewhat unconventional (read:  
non-VFP thinkers) wisdom.

Now if you used text files (instead of tables), it'd be easier for SCC.


-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
Work smarter, not harder, with MBSS custom software solutions!



___
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.


Re: [WEB] Storing code in tables

2007-02-04 Thread MB Software Solutions
Ed Leafe wrote:
 On Feb 4, 2007, at 2:31 PM, Kenneth Kixmoeller/fh wrote:

   
 Is it really a VFP mindset, or just a data guy mindset?
 

   I've worked with database apps in a variety of environments, but to  
 be honest I've never seen the approach you describe, where an  
 application's logic is considered data, outside of the VFP world.
   

iirc, Andy Kramek has applied this approach.  It was a VFP/SQL Server 
scenario, iirc.

-- 
Michael J. Babcock, MCP
MB Software Solutions, LLC
http://mbsoftwaresolutions.com
http://fabmate.com
Work smarter, not harder, with MBSS custom software solutions!



___
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.