Sample web application

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tony Marston

    Sample web application

    For those of you who are interested I have made some transactions from
    my sample web application available on my website. They are described
    in http://www.tonymarston.net/php-mysql...plication.html

    This contains a link to where you can run the transactions online, and
    there is another link where you can download all the necessary code to
    run offline in your own PHP environment.

    Be aware that this code is not for the novice as it contains the
    following features:

    - It is built around a *proper* 3 tier architecture as there are
    totally separate scripts which deal with the data access, business and
    presentation layers.

    - The data access layer is provided by a DML object which issues all
    DML/SQL statements (this version is for MySQL).

    - The business layer is comprised of an abstract database class with a
    separate subclass for each physical database table. The abstract class
    contains a great deal of generic and reusable code, while each
    subclass only contains code which is specific to its database table.
    There is a separate validation object which deals with
    generic/standard/declarative validation.

    - The presentation layer (user interface) is comprised of two types of
    script: a set of resuable dialog-type scripts which perform specific
    actions on specific data structures, and a set of component scripts
    which basically do nothing but call one of the dialog-type scripts
    with the identity of the objects to work on.

    - All HTML output is done via XML with XSL transformations . The XSL
    files come in two categories: a set of component templates which deal
    with each database table, plus a set of generic reusable templates
    which are responsible for creating the HTML code for each type of
    control.

    Try it. Run it. Download it. Play with it. Examine it.

    Don't applaud, just throw money!

    Tony Marston
    This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

  • Jochen Daum

    #2
    Re: Sample web application

    Hi Tony!

    On 10 Nov 2003 08:39:37 -0800, tony@marston-home.demon.co.u k (Tony
    Marston) wrote:
    [color=blue]
    >For those of you who are interested I have made some transactions from
    >my sample web application available on my website. They are described
    >in http://www.tonymarston.net/php-mysql...plication.html
    >[/color]

    (...)

    Looks very nice and interesting. I have done something similar, but
    not separated it so well, as it grew with time. I have to have a look
    later to learn something...

    Jochen
    --
    Jochen Daum - CANS Ltd.
    PHP DB Edit Toolkit -- PHP scripts for building
    database editing interfaces.
    Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

    Comment

    • Jochen Daum

      #3
      Re: Sample web application

      On 10 Nov 2003 08:39:37 -0800, tony@marston-home.demon.co.u k (Tony
      Marston) wrote:
      [color=blue]
      >For those of you who are interested I have made some transactions from
      >my sample web application available on my website. They are described
      >in http://www.tonymarston.net/php-mysql...plication.html
      >[/color]

      I must add, that I'm positively surprised that you use arrays for the
      database class. This seems the best solution to me as well with PHP,
      but a lot of people stick to the

      $obj->field

      solution still.

      Jochen
      --
      Jochen Daum - CANS Ltd.
      PHP DB Edit Toolkit -- PHP scripts for building
      database editing interfaces.
      Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

      Comment

      • Terence

        #4
        Re: Sample web application

        Tony Marston wrote:
        [color=blue]
        > in http://www.tonymarston.net/php-mysql...plication.html
        >[/color]
        [color=blue]
        > Don't applaud, just throw money!
        >[/color]

        Dude, that is a shitload of good work!
        I haven't read every article but I've skimmed. I will refer back to it
        when dealing with specific topics. I've taken different approaches to
        similar problems. I think I can benefit learning alternate methods.
        Love the nice XSL article, just the right size for the XSL newbie (even
        though you say some experience is required). Nice recipes there.
        Good to see the use of XSLT in your dialog-types too -- can't understand
        why every second PHP developer is coming up with his/her own unique
        templating system when the W3C already has a very good one.

        Well done.

        Hey everyobody, come look!

        <<applauds anyway (too poor to throw money)>>


        Comment

        • Tony Marston

          #5
          Re: Sample web application

          Jochen Daum <jochen.daum@ca ns.co.nz> wrote in message news:<23ovqvkaq 1l1ro2e12217a6k oe61oj1dit@4ax. com>...[color=blue]
          > On 10 Nov 2003 08:39:37 -0800, tony@marston-home.demon.co.u k (Tony
          > Marston) wrote:
          >[color=green]
          > >For those of you who are interested I have made some transactions from
          > >my sample web application available on my website. They are described
          > >in http://www.tonymarston.net/php-mysql...plication.html
          > >[/color]
          >
          > I must add, that I'm positively surprised that you use arrays for the
          > database class. This seems the best solution to me as well with PHP,
          > but a lot of people stick to the
          >
          > $obj->field
          >
          > solution still.
          >
          > Jochen[/color]

          I cannot see the point of extracting data from each object one field
          at a time when the whole row can be passed as an associative array.
          This method also avoids the necessity of having field names hard-coded
          everywhere. If you look at my code which creates the XML document you
          will see that there are no field names hard-coded anywhere - it just
          takes the contents of the array (which may hold any number of rows)
          and throws it into an XML document. Thus I have been able to create a
          single standard function which creates XML files. I think this is a
          good example of 'write once - use many' which is an objective that
          every competent programmer should aim for.

          Did you notice how I also use arrays to construct the INSERT and
          UPDATE statements using generic code? I have seen examples where
          people have hard-coded these for each individual table. How
          inefficient is that?

          Tony Marston
          This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

          Comment

          • Jochen Daum

            #6
            Re: Sample web application

            Hi !

            On 11 Nov 2003 01:01:03 -0800, tony@marston-home.demon.co.u k (Tony
            Marston) wrote:
            [color=blue]
            >Jochen Daum <jochen.daum@ca ns.co.nz> wrote in message news:<23ovqvkaq 1l1ro2e12217a6k oe61oj1dit@4ax. com>...[color=green]
            >> On 10 Nov 2003 08:39:37 -0800, tony@marston-home.demon.co.u k (Tony
            >> Marston) wrote:
            >>[color=darkred]
            >> >For those of you who are interested I have made some transactions from
            >> >my sample web application available on my website. They are described
            >> >in http://www.tonymarston.net/php-mysql...plication.html
            >> >[/color]
            >>
            >> I must add, that I'm positively surprised that you use arrays for the
            >> database class. This seems the best solution to me as well with PHP,
            >> but a lot of people stick to the
            >>
            >> $obj->field
            >>
            >> solution still.
            >>
            >> Jochen[/color]
            >
            >I cannot see the point of extracting data from each object one field
            >at a time when the whole row can be passed as an associative array.
            >This method also avoids the necessity of having field names hard-coded
            >everywhere. If you look at my code which creates the XML document you
            >will see that there are no field names hard-coded anywhere - it just
            >takes the contents of the array (which may hold any number of rows)
            >and throws it into an XML document. Thus I have been able to create a
            >single standard function which creates XML files. I think this is a
            >good example of 'write once - use many' which is an objective that
            >every competent programmer should aim for.
            >
            >Did you notice how I also use arrays to construct the INSERT and
            >UPDATE statements using generic code? I have seen examples where
            >people have hard-coded these for each individual table. How
            >inefficient is that?[/color]

            From the size of your answer it looks like you disagree. But you
            don't. I do it exactly the same way.

            Jochen
            --
            Jochen Daum - CANS Ltd.
            PHP DB Edit Toolkit -- PHP scripts for building
            database editing interfaces.
            Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

            Comment

            • Tony Marston

              #7
              Re: Sample web application

              Terence <tk.lists@fastm ail.fm> wrote in message news:<3FB09211. 3090309@fastmai l.fm>...[color=blue]
              > Tony Marston wrote:
              >[color=green]
              > > in http://www.tonymarston.net/php-mysql...plication.html
              > >[/color]
              >[color=green]
              > > Don't applaud, just throw money!
              > >[/color]
              >
              > Dude, that is a shitload of good work!
              > I haven't read every article but I've skimmed. I will refer back to it
              > when dealing with specific topics. I've taken different approaches to
              > similar problems. I think I can benefit learning alternate methods.
              > Love the nice XSL article, just the right size for the XSL newbie (even
              > though you say some experience is required). Nice recipes there.
              > Good to see the use of XSLT in your dialog-types too -- can't understand
              > why every second PHP developer is coming up with his/her own unique
              > templating system when the W3C already has a very good one.[/color]

              This also means that I would find it easier to upgrade to XFORMS (the
              new W3C standard) as soon as compatible browsers become available.

              Tony Marston
              This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL


              [color=blue]
              > Well done.
              >
              > Hey everyobody, come look!
              >
              > <<applauds anyway (too poor to throw money)>>[/color]

              Comment

              Working...