One thing I tend to do is use data structures for programming. That is, I create functions that require complex data structures as input. I then create these complex data structures for each of my classes, which then have differing behaviours as a result.
Disadvantages of data structure programming
Advantages of data structure programming
The classic example of programming with data structures would be the database schema objects used by e.g. SPOPS, Tangram or Class::DBI. These tend to look like
$sch = { table => $tablename, fields => { id => { type => 'int', auto_inc => 1, # more config values }, # more fields }, # behavior specifiers };
and to my mind this works quite well. An exception is Alzabo, which makes you use method calls to create the schema; and note that they have felt it necessary to include a web-based schema builder.
Your thoughts welcome.
dave hj~
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Programming using data structures
by dragonchild (Archbishop) on Feb 20, 2003 at 15:07 UTC | |
by dash2 (Hermit) on Feb 20, 2003 at 17:35 UTC | |
|
Re: Programming using data structures
by derby (Abbot) on Feb 20, 2003 at 14:06 UTC | |
by Abigail-II (Bishop) on Feb 21, 2003 at 01:37 UTC | |
|
Re: Programming using data structures
by perrin (Chancellor) on Feb 20, 2003 at 17:50 UTC | |
|
Re: Programming using data structures
by diotalevi (Canon) on Feb 20, 2003 at 17:41 UTC |