object oriented php - primer

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

    object oriented php - primer

    Could anyone give me a tip about a good primer on object oriented php
    programming - why I should use it, the benefits, the drawbacks, the bugs, the
    glory?

    And, should I upgrade to php5 before starting to use it (to avoid two
    standards)?

    --
    Sandman[.net]
  • Garp

    #2
    Re: object oriented php - primer

    "Sandman" <mr@sandman.net > wrote in message
    news:mr-E684E3.23580314 062004@individu al.net...[color=blue]
    > Could anyone give me a tip about a good primer on object oriented php
    > programming - why I should use it, the benefits, the drawbacks, the bugs,[/color]
    the[color=blue]
    > glory?[/color]


    I think this site has everything you need to know:


    Yeesh.

    Garp


    Comment

    • MBR

      #3
      Re: object oriented php - primer

      Actually, I have a similar question, and I don't think Google will have
      the answer for me. The question is not how to do OO in PHP. That I
      can figure out on my own. I've done OO in straight C before C++ was
      ubiquitous. I've written OO code in C++ and Java for over 10 years.
      BUT my experience with web applications is that the associated server-
      side code is usually fairly trivial, and structuring things in a class
      hierarchy is generally overkill.

      So, my question is not how do people do object oriented programming in
      PHP, but rather why? Under what circumstances does it really provide
      any benefit?

      Mark
      mbr@arlsoft.com

      Garp wrote:[color=blue]
      > "Sandman" <mr@sandman.net > wrote in message
      > news:mr-E684E3.23580314 062004@individu al.net...
      >[color=green]
      >>Could anyone give me a tip about a good primer on object oriented php
      >>programming - why I should use it, the benefits, the drawbacks, the bugs,[/color]
      >
      > the
      >[color=green]
      >>glory?[/color]
      >
      >
      >
      > I think this site has everything you need to know:
      > www.google.com
      >
      > Yeesh.
      >
      > Garp
      >
      >[/color]

      Comment

      • Berislav Lopac

        #4
        Re: object oriented php - primer

        MBR wrote:[color=blue]
        > So, my question is not how do people do object oriented programming in
        > PHP, but rather why? Under what circumstances does it really provide
        > any benefit?[/color]

        For me, the reason to use OO in PHP is the same as in any other language: OO
        makes things better organized and easier to maintain.

        There is to inherent advantage in using OO above procedural or other types
        of programming except that it gives a better organization of your code,
        making it much easier to reuse, maintain and publish.

        Why do you use OO in Java? (Note: one can easily write a completely
        procedural program in Java).

        Berislav

        --
        If the Internet is a Marx Brothers movie, and Web, e-mail, and IRC are
        Groucho, Chico, and Harpo, then Usenet is Zeppo.


        Comment

        • Sandman

          #5
          Re: object oriented php - primer

          In article <Etvzc.423$eC5. 3308631@news-text.cableinet. net>,
          "Garp" <garp7@no7.blue yonder.co.uk> wrote:
          [color=blue][color=green]
          > > Could anyone give me a tip about a good primer on object oriented php
          > > programming - why I should use it, the benefits, the drawbacks, the bugs,
          > > the glory?[/color]
          >
          > I have no idea what so ever, and it would even be stupid of me to reply to
          > your post.
          >
          > Garp[/color]

          Ok, thanks anyway.

          --
          Sandman[.net]

          Comment

          • Garp

            #6
            Re: object oriented php - primer


            "Sandman" <mr@sandman.net > wrote in message
            news:mr-CF6322.20580915 062004@individu al.net...[color=blue]
            > In article <Etvzc.423$eC5. 3308631@news-text.cableinet. net>,
            > "Garp" <garp7@no7.blue yonder.co.uk> wrote:
            >[color=green][color=darkred]
            > > > Could anyone give me a tip about a good primer on object oriented php
            > > > programming - why I should use it, the benefits, the drawbacks, the[/color][/color][/color]
            bugs,[color=blue][color=green][color=darkred]
            > > > the glory?[/color]
            > >
            > > I have no idea what so ever, and it would even be stupid of me to reply[/color][/color]
            to[color=blue][color=green]
            > > your post.
            > >
            > > Garp[/color]
            >
            > Ok, thanks anyway.
            >
            > --
            > Sandman[.net][/color]

            I'm sorry, but the question was as wide open as you could have made it. This
            isn't the right forum to ask for such general advice (you didn't even
            specify PHP for the OOD part), and I'm glad you got the point I made,
            however badly you spelled "whatsoever ".

            Garp


            Comment

            • Garp

              #7
              Re: object oriented php - primer


              "Berislav Lopac" <berislav.lopac @dimedia.hr> wrote in message
              news:can472$fll $1@ls219.htnet. hr...[color=blue]
              > MBR wrote:[color=green]
              > > So, my question is not how do people do object oriented programming in
              > > PHP, but rather why? Under what circumstances does it really provide
              > > any benefit?[/color]
              >
              > For me, the reason to use OO in PHP is the same as in any other language:[/color]
              OO[color=blue]
              > makes things better organized and easier to maintain.
              >
              > There is to inherent advantage in using OO above procedural or other types
              > of programming except that it gives a better organization of your code,
              > making it much easier to reuse, maintain and publish.
              >
              > Why do you use OO in Java? (Note: one can easily write a completely
              > procedural program in Java).
              >
              > Berislav[/color]

              All good points; simply put, OOD is simply a way of organising solutions to
              problems. It's just a good way to think about the problems you encounter
              every day in your work and this is evident in all the languages that either
              integrated OO in their middle age or grew out of the concept itself. I do it
              because I only have to solve problems once. When I don't do it, after the
              third or fourth cut & paste I wish I had.

              Garp


              Comment

              • Jay Donnell

                #8
                Re: object oriented php - primer

                I've written a couple medium sized programs (~10,000 lines) in php and
                one of the main reasons I use OO is to keep the namespace clean. Most
                of my apps have done a lot of db queries so you get a lot of $query
                and $row variables. This can become a problem if your using a lot of
                require statements to import code and not using OO or functions at the
                least. Classes are also a lot easier for me to read and use than a
                bunch of multi-dimensional arrays for passing data around. However, I
                don't think OO is really about encapsulation as much as it is about
                abstraction, but I'll leave that discussion alone. I don't find a lot
                of reasons to have hierarchies of classes in the apps I've worked on
                in php.

                Comment

                Working...