By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,610 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,610 IT Pros & Developers. It's quick & easy.

Program Flow

P: n/a
Hello,

I had some bad experience with code organization and script
functionality in writing my php based applications. And as the applications
get bigger in scale it gets even worse. Therefore, I am trying to build a
general schema for data flow in a php/mysql application.

What I has in mind is to design a three major units. To handle the
input, processing and data access. Plus another unit to generate the output.

What I have now is one script that resolves the operation to be done
according to the parameters send to it and the call the processing unit to
do the rest of the job. However, as I add more functionality to the system
this dispatcher script gets bigger and bigger...

1. How can I arrange my program/data flow in an efficient and easily
maintainable way?

2. And how should I implement the output generation unit to be
completely seperate from the others (I have lots of forms and outputs I have
to show the user when necessary)?

Regards,
Albert Ahtenberg
Jul 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi !
On Thu, 26 Jun 2003 22:50:38 -0400, "Albert Ahtenberg"
<do**********@this.address> wrote:
Hello,

I had some bad experience with code organization and script
functionality in writing my php based applications. And as the applications
get bigger in scale it gets even worse. Therefore, I am trying to build a
general schema for data flow in a php/mysql application.

What I has in mind is to design a three major units. To handle the
input, processing and data access. Plus another unit to generate the output.

What I have now is one script that resolves the operation to be done
according to the parameters send to it and the call the processing unit to
do the rest of the job. However, as I add more functionality to the system
this dispatcher script gets bigger and bigger...

1. How can I arrange my program/data flow in an efficient and easily
maintainable way?
I have pretty much the same problem, which I solve by dividing the
dispatch script into smaller logical portions. But thats not nice.

I thought you would want to model it in a database or an array, so
that a script could output the program flow as well. You could capsule
that with a class, so that the dispatch script can ask for the
appropriate task for this input.
2. And how should I implement the output generation unit to be
completely seperate from the others (I have lots of forms and outputs I have
to show the user when necessary)?
Isn't the output dependent on the action? In my scripts the output
pretty much follows the structure ofthe code.

Jochen

Regards,
Albert Ahtenberg


--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #2

P: n/a
Hi,

I didn't really understand what you mean when you say capsule in within a
class.

And regarding the output, sure it depends on the current action but I though
to maybe use some kind of templating or at least seperate the HTML from the
PHP to keep the code more organized.

Albert Ahtenberg

"Jochen Daum" <jo*********@cans.co.nz> wrote in message
news:3v********************************@4ax.com...
Hi !
On Thu, 26 Jun 2003 22:50:38 -0400, "Albert Ahtenberg"
<do**********@this.address> wrote:
Hello,

I had some bad experience with code organization and script
functionality in writing my php based applications. And as the applicationsget bigger in scale it gets even worse. Therefore, I am trying to build a
general schema for data flow in a php/mysql application.

What I has in mind is to design a three major units. To handle the
input, processing and data access. Plus another unit to generate the output.
What I have now is one script that resolves the operation to be done
according to the parameters send to it and the call the processing unit todo the rest of the job. However, as I add more functionality to the systemthis dispatcher script gets bigger and bigger...

1. How can I arrange my program/data flow in an efficient and easilymaintainable way?

I have pretty much the same problem, which I solve by dividing the
dispatch script into smaller logical portions. But thats not nice.

I thought you would want to model it in a database or an array, so
that a script could output the program flow as well. You could capsule
that with a class, so that the dispatch script can ask for the
appropriate task for this input.
2. And how should I implement the output generation unit to be
completely seperate from the others (I have lots of forms and outputs I haveto show the user when necessary)?


Isn't the output dependent on the action? In my scripts the output
pretty much follows the structure ofthe code.

Jochen

Regards,
Albert Ahtenberg


--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/

Jul 16 '05 #3

P: n/a
Hi Albert!

On Fri, 27 Jun 2003 00:04:54 -0400, "Albert Ahtenberg"
<do**********@this.address> wrote:
Hi,

I didn't really understand what you mean when you say capsule in within a
class.

I meant one could tore the actions against certain input in an array,
or a database, or xml or whatever. Maybe build a class with methods:

function get_action_function_for_input ($inputfield, $inpuvalue)

which returns a function name. And a similar set_function.

Maybe the set function should append it to a list of action functions.
or even run the functions from within the class.

The class should just be a level of indirection, so you can change the
data format. Maybe there is a common format for workflow systems,
which you want to use.

I'm just making up these ideas now, so it might all be quite rough.
And regarding the output, sure it depends on the current action but I though
to maybe use some kind of templating or at least seperate the HTML from the
PHP to keep the code more organized.


There was just a discussion regarding the use of templating systems
some days ago in which I participated. You'll find the names there.

HTH, Jochen

BTW: I'm deleting the old parts of your threads, because in two years
people will be unable to understand them, because they are upside down
or all mixed. Some people say, its better to quote correctly
(http://learn.to/quote) and I like it better that way. How you do it
is your call.
--
Jochen Daum - CANS Ltd.
PHP DB Edit Toolkit -- PHP scripts for building
database editing interfaces.
http://sourceforge.net/projects/phpdbedittk/
Jul 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.