Professional Web Applications Themes

Program Flow - PHP Development

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

  1. #1

    Default Program Flow

    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


    Albert Ahtenberg Guest

  2. #2

    Default Re: Program Flow

    Hi !
    On Thu, 26 Jun 2003 22:50:38 -0400, "Albert Ahtenberg"
    <donotcontactthis.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.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

  3. #3

    Default Re: Program Flow

    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" <jochen.daumcans.co.nz> wrote in message
    news:3vcnfvog3a551hn3mdsr9nslc8ukcjm0r94ax.com...
    > Hi !
    > On Thu, 26 Jun 2003 22:50:38 -0400, "Albert Ahtenberg"
    > <donotcontactthis.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.
    > [url]http://sourceforge.net/projects/phpdbedittk/[/url]

    Albert Ahtenberg Guest

  4. #4

    Default Re: Program Flow

    Hi Albert!

    On Fri, 27 Jun 2003 00:04:54 -0400, "Albert Ahtenberg"
    <donotcontactthis.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
    ([url]http://learn.to/quote[/url]) 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.
    [url]http://sourceforge.net/projects/phpdbedittk/[/url]
    Jochen Daum Guest

Similar Threads

  1. Hi i need to start xml flow
    By keyan81b in forum Adobe Indesign Windows
    Replies: 0
    Last Post: December 9th, 04:02 PM
  2. table flow
    By Jeffrey_Markham@adobeforums.com in forum Adobe Indesign Windows
    Replies: 1
    Last Post: June 20th, 03:36 AM
  3. Fluid flow
    By DaveLock webforumsuser@macromedia.com in forum Macromedia Director 3D
    Replies: 4
    Last Post: October 9th, 02:22 PM
  4. Program flow question
    By Bruce W...1 in forum PHP Development
    Replies: 4
    Last Post: September 23rd, 06:07 PM
  5. Replies: 0
    Last Post: July 20th, 01:20 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139