What is/is not considered to be good OO programming

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

    #31
    Re: What is/is not considered to be good OO programming

    R. Rajesh Jeba Anbiah wrote:
    [color=blue]
    >
    > A person starts a thread, asking comments about his OO tutorial.
    > Many real programmers here refuse to accept his code as good OO. He[/color]

    Many other real programmers found the code acceptable, still more found
    his code good OO to some qualified extent. I can't help wondering, what
    you think a "real programmer" is.
    [color=blue]
    > then went to Zend (<http://www.zend.com/zend/tut/tutorial-wong4.php>)
    > and starts another thread there badly criticizing the author (Benson[/color]

    I didn't see the criticism he levelled at Wong (was it in here, or on Zend.com?),
    so I can't comment on it in particular; I would say, however, that many different
    philosophies of software development exist, and just because one is different to
    another doesn't necessarily make either of them wrong. Personally, I would never
    use most of the code examples given in the various online tutorials I have
    seen, as most of them don't live up to my idea of what consitutes robust,
    clean code.
    [color=blue]
    > Wong). Then, he again came back to comp.lang.php and starts the[/color]

    I'm not aware of the precise timescale, but I do know that 1 - Tony started the
    thread, which lasted a long time; 2 - I revived it with some general comments
    on OO and software design goals in general. I don't think this counts as
    "coming back", and I'm also curious as to what this represents in the bigger
    scheme of things, as far as reprehensible behaviour is concerned.
    [color=blue]
    > "argument" which is not of course a "discussion ". Now, who is[/color]

    I think you'll find it was a bit of both. Yes, there were barbed comments
    flying in all directions as attacks on techniques and ideas turned into
    attacks on the holders of the ideas (ad hominem). On the flip side,
    there was a good deal of healthy debate on the pros and cons of OO design
    patterns, on PHP OO, and on the use of OO in general. I would imagine that
    many people benefitted from reading a wide variety of viewpoints and opinions,
    allowing them to form their own, rather than just parroting the words of others.

    I think that is a healthy thing, even if it did mean some bad blood.
    [color=blue]
    > rubbish??[/color]

    OK, that was just childish. Isn't this the kind of language you are deprecating
    in your post?
    [color=blue]
    >
    > I really appreciate André Næss for his patience. I don't think[/color]

    I don't think that Andre, Tony, I or any of the many people who contributed to
    the threads involved exemplified patience. I for one have rapidly put fingers
    to keyboard in a fit of rage, digust or just plain confusion at what
    $SOME_OTHER_PER SON has written, and I suspect the others are the same. The main
    reason Andre contributed so heavily to the threads in question, is that he disagreed
    strongly with Tony's views, just as Tony disagreed with his.
    [color=blue]
    > anyone will respect a person who stupidly mess with a regular
    > contributor.[/color]

    OK. How long have you been reading this group? Just to recap, the original thread
    was started by Tony, who stated that he had posted a basic, beginner-oriented
    tutorial on creating classes in PHP. The "messing" then followed, mostly in
    the form of criticism of Tony's design decisions. So that would indicate that
    Andre was messing with Tony. It's also interesting to note, that the chief original
    critiscm of the tutorial, was that adding methods to handle paged output of data
    records (through mysql's "limit" clause) was "bad OO" (I don't really agree with
    this), rather than on how helpful the tutorial was for beginners to PHP OO.

    Andre and Tony are (were at least) regular contributors to this group. I also used
    to be, and I have noticed that the names seem to have changed lately. Nonetheless,
    regular contributions to a newsgroup/discussion list/chatroom do not make someone
    an expert on all things, to be respected blindly with adoration. Anyone who has read
    CSS-Discuss will be aware of one particular poster, whose comments generally tend towards
    the limit case "Your fonts are too small".

    You should respect someone because what they say is interesting, thought-provoking, or
    simply plain helpful. Virtually all of the contributors to this thread (in its various
    incarnations) qualify by this criterion. Personally, I respect both Tony's and Andre's
    views and expertise. I have different views to both of them, and I'm pretty sure I code
    differently to the way they use (I know this for a fact in Tony's case, since I have seen
    a large body of his code).

    I do agree that maybe the rebuttal Tony posted was a little strongly worded at times, but
    I do think he has a right to say the things he did, and many of them I find valid. I disagree
    with some of them, but that's because I see things differently. I'm a different person
    after all, with the ability to form my own opinions and ways of working.

    I enjoy dicussing matters with others who hold different opinions to mine; and this is how
    people grow and develop new ideas. I would hate to think that a lively discussion on software
    design could be stopped just because someone has made newcomers frightened of offending

    Comment

    • Tony Marston

      #32
      Re: What is/is not considered to be good OO programming

      Matty <matt+nntp@askm enoquestions.co .uk> wrote in message news:<pj4Cb.201 64$lm1.176262@w ards.force9.net >...[color=blue]
      > R. Rajesh Jeba Anbiah wrote:
      >[color=green]
      > >
      > > A person starts a thread, asking comments about his OO tutorial.
      > > Many real programmers here refuse to accept his code as good OO. He[/color]
      >
      > Many other real programmers found the code acceptable, still more found
      > his code good OO to some qualified extent. I can't help wondering, what
      > you think a "real programmer" is.
      >[color=green]
      > > then went to Zend (<http://www.zend.com/zend/tut/tutorial-wong4.php>)
      > > and starts another thread there badly criticizing the author (Benson[/color]
      >
      > I didn't see the criticism he levelled at Wong (was it in here, or on Zend.com?),[/color]

      Try this URL: http://www.zend.com/zend/comments/sh...4&mode=&kind=t


      <snip>

      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

      • Marcus Baker

        #33
        Re: What is/is not considered to be good OO programming

        Hi...Matty wrote:[color=blue]
        > Can't help wondering what the object composition argument was, and how
        > on earth you could do it in a logical manner.
        >
        > A table "has a" page of records? [snip][/color]

        There are a whole load of ways of skinning this particular cat. Here's
        one...

        A row has a data list.
        A row has a field list.
        A result set has rows.
        A result set has a table.
        A table has a name.
        A table has a field list.
        A field list has fields.

        With these arrangements I could completely describe the most commonly
        used database mappings with the following classes: Row, Field, Table,
        Query, Connection. By using factory methods to assemble these
        appropriately, I need no subclasses at all. This is actually a perfectly
        valid way of solving the problem. Anything you can do with inheritance
        you can do with composition, although the code may be less clear because
        everything happens at run time.

        Having one class per table and placing extra domain code in these
        classes is known as the "Table Gateway" pattern, or is sometimes called
        a DAO in Java circles (which is actually usually slightly different as
        they usually have dumb tables and smart rows). It is an effective
        solution if the application presents mostly tabular data and
        relationships between the data are not too complex. This approach gets
        really nasty once you get away from this. Choosing this is usually a
        sign that the system was designed from the data viewpoint, rather than
        the object viewpoint. It should be efficient from the point of view of
        writing least code because of it's simplicity, but is a poor performer
        when it comes to responding to change. Changing the app. means changing
        the table structure as well as all the code above, because of the
        isomorphic relationship cutting accross the layers. You can get away
        with it for a long time using views and table filters, so it isn't a bad
        approach by any means. It's just that it applies to only a small part of
        the enterprise problem space. One where the OO language is slave to the
        DB rather than the other way around.
        [color=blue]
        > ;p
        >
        > Matt[/color]

        Did that answer help?

        yours, Marcus
        --
        Marcus Baker, marcus@lastcraf t.com, nokia@appo.demo n.co.uk

        Comment

        • Marcus Baker

          #34
          Re: What is/is not considered to be good OO programming

          Hi...

          Philipp Lenssen wrote:[color=blue]
          > And employee "is a type of" person. So it would not make sense to use
          > object composition. (Not if person and employee are intended to be the
          > same anyway.) Because an employee shares attributes of a person but
          > includes his own.[/color]

          I do agree with you, but cannot resist picking up on this. I know you
          chose it as an off hand example, and it's so easy to criticise...;)

          Making employee a descendent of person is nearly always a bad idea.
          Employment has a different lifetime than a person. Employment is a
          relationship rather than an inate property. I would have...

          Person<>--->Employment<---<>Company

          That is...

          class Party { ... }

          class Person extends Party { ... }

          class Company extends Party { ... }

          class Employment {
          function Employment($emp loyer, $employee, $date) {...}
          function terminate($date ) {...}
          function getEmployee() {...}
          function getEmployer() {...}
          }

          That way your job applicant can become your employee and then retire,
          all without having to be deleted and recreated as something else each time.

          yours, Marcus
          --
          Marcus Baker, marcus@lastcraf t.com, nokia@appo.demo n.co.uk

          Comment

          • André Næss

            #35
            Re: What is/is not considered to be good OO programming

            Matty:

            [color=blue]
            > OK. How long have you been reading this group? Just to recap, the
            > original thread was started by Tony, who stated that he had posted a
            > basic, beginner-oriented
            > tutorial on creating classes in PHP. The "messing" then followed, mostly
            > in
            > the form of criticism of Tony's design decisions. So that would indicate
            > that
            > Andre was messing with Tony. It's also interesting to note, that the
            > chief original critiscm of the tutorial, was that adding methods to handle
            > paged output of data records (through mysql's "limit" clause) was "bad OO"
            > (I don't really agree with this), rather than on how helpful the tutorial
            > was for beginners to PHP OO.[/color]

            Actually that's not entirely correct. Tony's original post said that he had
            tried to get the code accepted into some sort of class repository, but the
            code was rejected because it wasn't OO enough, according to the person in
            charge. He then turned to this group because he wanted an explanation of
            why (if) this was the case. People, me included, tried to give one. We
            didn't start "messing" with him.

            As I stated a couple of times in my posts, I understand that Tony's approach
            works, and I understand that he prefers it. But the background for the
            discussion was whether other people could reuse his code easily through
            such a class repository, not whether Tony can use his own code.

            André Næss

            Comment

            • Matty

              #36
              Re: What is/is not considered to be good OO programming

              André Næss wrote:
              [color=blue]
              > Actually that's not entirely correct. Tony's original post said that he
              > had tried to get the code accepted into some sort of class repository, but
              > the code was rejected because it wasn't OO enough, according to the person[/color]

              I stand corrected! As I remembered it, the initial posting was a "Look
              at my tutorial" thing, then followed with "There's no way you'd get this
              into a repository". I would agree with the "insufficie nt OO" case, at least
              as far as having a subcalss for every table goes anyway.
              [color=blue]
              > in charge. He then turned to this group because he wanted an explanation
              > of why (if) this was the case. People, me included, tried to give one. We
              > didn't start "messing" with him.[/color]

              Maybe I shoudl have stated my (intended) irony a little more strongly... I
              don't really feel that anyone was actually "messing" with anyone - that was
              the point of my reply to Anbiah. Mainly, I was taking issue with the OP's
              comment, which essentially came down to "How dare you mess with Andre Naess?
              The man is a *god*!" I feel this kind of unquestioning hero-worship can
              block healthy debate, since newcomers will be too frightened to disagree
              with what someone else has said.
              [color=blue]
              > As I stated a couple of times in my posts, I understand that Tony's
              > approach works, and I understand that he prefers it. But the background
              > for the discussion was whether other people could reuse his code easily
              > through such a class repository, not whether Tony can use his own code.[/color]

              Some of it was, yes, but it's also worth noting that the inclusion (or
              otherwise) of the recordset paging code is a question of design philosophy/
              methodology, and has nothing to do with the question of Object Orientation...

              Comment

              • Matty

                #37
                Re: What is/is not considered to be good OO programming

                Marcus Baker wrote:
                [color=blue]
                > Hi...Matty wrote:[color=green]
                >> Can't help wondering what the object composition argument was, and how
                >> on earth you could do it in a logical manner.
                >>
                >> A table "has a" page of records? [snip][/color]
                >
                > There are a whole load of ways of skinning this particular cat. Here's
                > one...
                >
                > A row has a data list.
                > A row has a field list.[/color]
                <snip>

                Yes, thanks, I am aware of the method. My point, was that originally Tony
                presented a table handling class, which was essentially designed to iterate
                through the data (or maybe return a chunk as several assoc arrays, I can't
                remember exactly). When Tony added a method to return a subset of the data
                a-la "Display 1-10, 11-20, 21-30, etc", some people complained that this was
                bad OO, that he was confusing presentation with application/business logic.
                One suggestion advanced was that paging the data should be handled through
                composition/aggregation - that was the reason for the sarcasm in my post,
                since doing something like this confuses the interface for interacting with
                the table, which already returns records itself.

                [color=blue]
                >
                > Having one class per table and placing extra domain code in these
                > classes is known as the "Table Gateway" pattern, or is sometimes called[/color]

                <...>
                [color=blue]
                > approach by any means. It's just that it applies to only a small part of
                > the enterprise problem space. One where the OO language is slave to the
                > DB rather than the other way around.[/color]

                Yes, I'm aware of this approach, having written class libraries that do exactly
                this kind of thing (generally in an extensible, predictable fashion ;p), and
                used them too. Thankyou for the heads-up. I think it's safe to assume, that
                if people are discussing OO design, they have some experience of the issues
                involved.

                Matt

                Comment

                • Marcus Baker

                  #38
                  Re: What is/is not considered to be good OO programming

                  Hi...

                  Matty wrote:[color=blue]
                  > Marcus Baker wrote:
                  > Yes, thanks, I am aware of the method.[/color]

                  Sorry, I didn't mean to be condescending. The question was a rather open
                  one and so I started with the broadest answer.
                  [color=blue]
                  > When Tony added a method to return a subset of the data
                  > a-la "Display 1-10, 11-20, 21-30, etc", some people complained that this was
                  > bad OO, that he was confusing presentation with application/business logic.[/color]

                  Java developers don't have this problem as the data is cached between
                  page requests. In Java I would definitely either load the whole set or
                  place holders for later (lazy) loading. It's easier to do paging in this
                  case as the data fetch is totally separated from use of the data.

                  If we do that in PHP we end up pulling loads of data only to see it all
                  disappear at the end of the script. This makes paging a performance
                  issue. Optimisation tends to break the purity of paradigms pretty
                  quickly, but you can usually rework things to keep code maintainable.
                  [color=blue]
                  > One suggestion advanced was that paging the data should be handled through
                  > composition/aggregation - that was the reason for the sarcasm in my post,
                  > since doing something like this confuses the interface for interacting with
                  > the table, which already returns records itself.[/color]

                  I don't think sarcasm is a good idea in any post, but I digress. These
                  would be one possible set of guidelines:

                  Write the cleanest version first (no paging). Create a class (called a
                  Pager I guess), but don't add functionality to it. Now write some code
                  that passes in the Pager to whatever does the fetch. I'll call that a
                  Finder for the moment. Connecting them, together should yield some
                  possible points of contact. If the Finder uses a raw SQL query or
                  (preferably) some kind of Query class, then the Finder can even apply
                  the limit clause directly.

                  It's better if the pager will communicate with the query object
                  directly. You could then add a method to the Finder called addSelector()
                  or something. The Finder doesn't need to know it's a Pager at all, just
                  some kind of search modifier.

                  If you decide to write finder code, place it in a separate method. Now
                  if you want, you can create a subclass of the Finder called PagingFinder
                  and move all Pager related stuff into it. With either strategy, you have
                  gained a lot of flexibility as you can plug in the paging as required.

                  The Pager is part of the data layer here. Your app requests one as a
                  service of that layer.

                  I am sure you can come up with other strategies.
                  [color=blue]
                  >Thankyou for the heads-up. I think it's safe to assume, that
                  > if people are discussing OO design, they have some experience of the issues
                  > involved.[/color]

                  Well, my apologies again. I did not mean to insult your intelligence.

                  What exactly are you asking?
                  [color=blue]
                  >
                  > Matt[/color]

                  yours, Marcus
                  --
                  Marcus Baker, marcus@lastcraf t.com, nokia@appo.demo n.co.uk

                  Comment

                  • Tony Marston

                    #39
                    Re: What is/is not considered to be good OO programming

                    Marcus Baker <marcus@lastcra ft.com> wrote in message news:<3FDAADBE. 8010808@lastcra ft.com>...[color=blue]
                    > Hi...Matty wrote:[color=green]
                    > > Can't help wondering what the object composition argument was, and how
                    > > on earth you could do it in a logical manner.
                    > >
                    > > A table "has a" page of records? [snip][/color]
                    >
                    > There are a whole load of ways of skinning this particular cat. Here's
                    > one...
                    >
                    > A row has a data list.
                    > A row has a field list.
                    > A result set has rows.
                    > A result set has a table.
                    > A table has a name.
                    > A table has a field list.
                    > A field list has fields.
                    >
                    > With these arrangements I could completely describe the most commonly
                    > used database mappings with the following classes: Row, Field, Table,
                    > Query, Connection. By using factory methods to assemble these
                    > appropriately, I need no subclasses at all. This is actually a perfectly
                    > valid way of solving the problem. Anything you can do with inheritance
                    > you can do with composition, although the code may be less clear because
                    > everything happens at run time.
                    >
                    > Having one class per table and placing extra domain code in these
                    > classes is known as the "Table Gateway" pattern, or is sometimes called
                    > a DAO in Java circles (which is actually usually slightly different as
                    > they usually have dumb tables and smart rows). It is an effective
                    > solution if the application presents mostly tabular data and
                    > relationships between the data are not too complex. This approach gets
                    > really nasty once you get away from this. Choosing this is usually a
                    > sign that the system was designed from the data viewpoint, rather than
                    > the object viewpoint.[/color]

                    That is correct. Database design has primary importance as it directly
                    relates to the performance of the system. I therefore design my
                    database first, then build objects to access the data.
                    [color=blue]
                    > It should be efficient from the point of view of
                    > writing least code because of it's simplicity, but is a poor performer
                    > when it comes to responding to change.[/color]

                    I disagree. I have been building and maintaining systems for 25+
                    years, so I have some experience of what makes them easy or difficult
                    to update over a period of time. For me the most useful design
                    philosphy is the 3 Tier Architecture where the presentation, business
                    and data access layers are built from totally separate components.
                    Thus any layer can be changed without affecting the others. Using
                    Object-based programming is not that much different from
                    Component-based programming - the correct technique (IMHO) is to use
                    it as efficiently and effectively as possible.
                    [color=blue]
                    > Changing the app. means changing
                    > the table structure as well as all the code above, because of the
                    > isomorphic relationship cutting accross the layers. You can get away
                    > with it for a long time using views and table filters, so it isn't a bad
                    > approach by any means. It's just that it applies to only a small part of
                    > the enterprise problem space. One where the OO language is slave to the
                    > DB rather than the other way around.[/color]

                    The data is ALWAYS more important than the language used to access it.

                    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

                    • Tony Marston

                      #40
                      Re: What is/is not considered to be good OO programming

                      Marcus Baker <marcus@lastcra ft.com> wrote in message news:<3FDD16FC. 4020808@lastcra ft.com>...[color=blue]
                      > Hi...
                      >
                      > Matty wrote:[color=green]
                      > > Marcus Baker wrote:
                      > > Yes, thanks, I am aware of the method.[/color]
                      >
                      > Sorry, I didn't mean to be condescending. The question was a rather open
                      > one and so I started with the broadest answer.
                      >[color=green]
                      > > When Tony added a method to return a subset of the data
                      > > a-la "Display 1-10, 11-20, 21-30, etc", some people complained that this was
                      > > bad OO, that he was confusing presentation with application/business logic.[/color]
                      >
                      > Java developers don't have this problem as the data is cached between
                      > page requests. In Java I would definitely either load the whole set or
                      > place holders for later (lazy) loading. It's easier to do paging in this
                      > case as the data fetch is totally separated from use of the data.
                      >
                      > If we do that in PHP we end up pulling loads of data only to see it all
                      > disappear at the end of the script. This makes paging a performance
                      > issue. Optimisation tends to break the purity of paradigms pretty
                      > quickly, but you can usually rework things to keep code maintainable.[/color]

                      How you do things in Java (or any other language for that matter) is
                      irrelevant as this is a PHP newsgroup talking about techniques that
                      PHP programmers use. When retrieving subsets of data (i.e. 'paging')
                      with PHP/MySQL the recommended approach is to use the LIMIT clause on
                      the sql SELECT statement. Retrieving all available data and holding it
                      in memory sounds like a stupid idea to me.

                      <snip>

                      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

                      • Marcus Baker

                        #41
                        Re: What is/is not considered to be good OO programming

                        Hi...

                        Tony Marston wrote:[color=blue]
                        > Marcus Baker <marcus@lastcra ft.com> wrote in message news:<3FDD16FC. 4020808@lastcra ft.com>...
                        > How you do things in Java (or any other language for that matter) is
                        > irrelevant...[/color]

                        When responding to a post, at least try to understand the post first. It
                        makes the thread so much more useful. In particular...

                        1) I was pointing out the *difference* between the Java approaches and
                        PHP and hinting at why some opinions of this thread may reflect
                        different backgrounds. This is grist to your mill too. I look forward to
                        your apology.

                        2) How things are done in other languages is entirely relevant. I mean
                        relevant, not copied without thinking (to pre-emt another lame post).
                        You can learn a lot about designs by seeing how the same tradoffs are
                        managed in different environments. If I were a classical composer, I
                        would listen to world music. If I were a French chef, I would visit
                        Indian resturants. It's about learning.
                        [color=blue]
                        > Tony Marston[/color]

                        yours, Marcus
                        --
                        Marcus Baker, marcus@lastcraf t.com, nokia@appo.demo n.co.uk

                        Comment

                        • Marcus Baker

                          #42
                          Re: What is/is not considered to be good OO programming

                          Hi...

                          Tony Marston wrote:[color=blue]
                          >
                          > That is correct. Database design has primary importance as it directly
                          > relates to the performance of the system. I therefore design my
                          > database first, then build objects to access the data.[/color]

                          This only works for established, and pretty much solved, problems. Less
                          defined and rapidly changing systems need a different approach. There
                          are a host of studies in this area, now. See references by Rebecca
                          Wirfs-Brock, Scott Ambler and others. Basically it leads to "god"
                          classes in big systems which then get atrophied. There is a heavy onus
                          on upfront design there and weaker encapsulation.

                          Even the corporate DBAs are starting to see the light. There is at last
                          talk of "refactorin g" databases.
                          [color=blue][color=green]
                          >>It should be efficient from the point of view of
                          >>writing least code because of it's simplicity, but is a poor performer
                          >>when it comes to responding to change.[/color]
                          >
                          > I disagree. I have been building and maintaining systems for 25+
                          > years, so I have some experience of what makes them easy or difficult
                          > to update over a period of time.[/color]

                          So do plenty of other people. Guess what? They disagree with you. I do
                          too. It's sad that you think that quoting a number of years in a field
                          gives you some kind of right to "win" a discussion. What shows through
                          all of your posts is your lack of experience within OO and a hostile
                          attitude to help. Isaac Newton did not have to rediscover for himself a
                          thousand years of Science. He stood on the shoulders of giants.
                          [color=blue]
                          > Using
                          > Object-based programming is not that much different from
                          > Component-based programming - the correct technique (IMHO) is to use
                          > it as efficiently and effectively as possible.[/color]

                          If you are just creating a few big classes that match each part of the
                          system, then you are right. All you have done is used the flexibility of
                          OO to recreate a paradigm you are familiar with. You could just as
                          easily have written it in Modula 2 or used structs and pointers in C.

                          There is little wrong with this approach (we all go through it). It is
                          not the only solution available, though. You should at least try out
                          some other patterns to see what works and what does not. Any idiot can
                          get a twelve business class project working in almost any environment.
                          Some approaches scale better than others. Some have better performance.
                          Some can be produced quickly. Some can be produced with less skill. Some
                          with more flexibility. You have only one design so far.
                          [color=blue]
                          > The data is ALWAYS more important than the language used to access it.[/color]

                          I'll be more precise. This style of coding only applies to situations
                          where the business model is isomorphic with a single (unencapsulated )
                          data model. If only we had this luxury.

                          You picked up on the word "language" and so missed the point.
                          [color=blue]
                          > Tony Marston[/color]

                          You boasted in a previous post that it took 60 mins to add six tables
                          and classes. That is actually pretty dismal for what is pretty routine
                          coding. I just completely rewrote our charging and billing system.
                          That's about 15 tables, 15 DAOs and 4 business classes (now 3). That
                          took an hour and a half. We generate the data mappers and SQL, so that
                          was just an XML edit. The bulk of the time was thus writing the
                          automated tests and documentation. All whilst gently chatting to the
                          business development guy that I was working with. We like to take things
                          easy you see.

                          Unlike Andre I do not have the patience of saints. You sure as hell
                          better have an argument that advances the discussion for me to bother to
                          reply to any more of your posts.

                          yours, Marcus
                          --
                          Marcus Baker, marcus@lastcraf t.com, nokia@appo.demo n.co.uk

                          Comment

                          • Tony Marston

                            #43
                            Re: What is/is not considered to be good OO programming

                            Marcus Baker <marcus@lastcra ft.com> wrote in message news:<3FDE0BF4. 3040908@lastcra ft.com>...[color=blue]
                            > Hi...
                            >
                            > Tony Marston wrote:[color=green]
                            > > Marcus Baker <marcus@lastcra ft.com> wrote in message news:<3FDD16FC. 4020808@lastcra ft.com>...
                            > > How you do things in Java (or any other language for that matter) is
                            > > irrelevant...[/color]
                            >
                            > When responding to a post, at least try to understand the post first. It
                            > makes the thread so much more useful. In particular...
                            >
                            > 1) I was pointing out the *difference* between the Java approaches and
                            > PHP and hinting at why some opinions of this thread may reflect
                            > different backgrounds. This is grist to your mill too. I look forward to
                            > your apology.[/color]

                            I am not interested in how things can be done in Java, I am only
                            interested in how things can be done in PHP.
                            [color=blue]
                            > 2) How things are done in other languages is entirely relevant.[/color]

                            Then all my experience in other languages is relevant, then?
                            [color=blue]
                            > I mean
                            > relevant, not copied without thinking (to pre-emt another lame post).
                            > You can learn a lot about designs by seeing how the same tradoffs are
                            > managed in different environments.[/color]

                            I have seen too many development environments created by other people
                            where they get so tied up in their rules they lose sight of the fact
                            that the aim of the software developer is to produce software as
                            quickly as possible. A method which takes weeks to produce each
                            component is rubbish when compared to one that takes days, which in
                            turn is rubbish when compared with one that takes hours.
                            [color=blue]
                            > If I were a classical composer, I
                            > would listen to world music. If I were a French chef, I would visit
                            > Indian resturants. It's about learning.[/color]

                            I have been learning about software development for the past 25+
                            years, I am still learning today, and I expect to keep on learning in
                            the future. But most of what people are trying to teach me are methods
                            that I have already encountered in the past and discarded. Come up
                            with an idea that is better and I will listen, but if all you can do
                            is regurgitate the same worn-out crap as others then you are wasting
                            your breath.

                            Tony Marston

                            Comment

                            • Tony Marston

                              #44
                              Re: What is/is not considered to be good OO programming

                              Marcus Baker <marcus@lastcra ft.com> wrote in message news:<3FDE18D7. 1030401@lastcra ft.com>...[color=blue]
                              > Hi...
                              >[/color]
                              <snip>
                              [color=blue][color=green][color=darkred]
                              > >>It should be efficient from the point of view of
                              > >>writing least code because of it's simplicity, but is a poor performer
                              > >>when it comes to responding to change.[/color]
                              > >
                              > > I disagree. I have been building and maintaining systems for 25+
                              > > years, so I have some experience of what makes them easy or difficult
                              > > to update over a period of time.[/color]
                              >
                              > So do plenty of other people. Guess what? They disagree with you. I do
                              > too.[/color]

                              Some people liked my approach while others didn't. That's life. Other
                              people may choose a different solution, but if it works for them then
                              that's cool. It just goes to show that there is no single solution, no
                              single methodology. Each approach has its own set of advantages and
                              disadvantages, and may work better in some situations than others. I
                              am not saying that everybody *must* use my approach, which is why I
                              object when others try to tell mne that I *must* use their approach.
                              [color=blue]
                              > It's sad that you think that quoting a number of years in a field
                              > gives you some kind of right to "win" a discussion. What shows through
                              > all of your posts is your lack of experience within OO and a hostile
                              > attitude to help.[/color]

                              Nobody has tried to offer *help* in any shape or form. They have
                              simply objected to my approach because it is different from theirs,
                              because it breaks their set of rules.
                              [color=blue]
                              > Isaac Newton did not have to rediscover for himself a
                              > thousand years of Science. He stood on the shoulders of giants.[/color]

                              He had giants, I have pygmies.
                              [color=blue][color=green]
                              > > Using
                              > > Object-based programming is not that much different from
                              > > Component-based programming - the correct technique (IMHO) is to use
                              > > it as efficiently and effectively as possible.[/color]
                              >
                              > If you are just creating a few big classes that match each part of the
                              > system, then you are right. All you have done is used the flexibility of
                              > OO to recreate a paradigm you are familiar with. You could just as
                              > easily have written it in Modula 2 or used structs and pointers in C.[/color]

                              Probably, but I chose to write it in PHP.
                              [color=blue]
                              > There is little wrong with this approach (we all go through it). It is
                              > not the only solution available, though. You should at least try out
                              > some other patterns to see what works and what does not.[/color]

                              I have seen examples of other people's methods and I have not been
                              impressed.
                              [color=blue]
                              > Any idiot can
                              > get a twelve business class project working in almost any environment.
                              > Some approaches scale better than others. Some have better performance.
                              > Some can be produced quickly. Some can be produced with less skill. Some
                              > with more flexibility. You have only one design so far.[/color]

                              But at least it is a design that works, and more efficiently than
                              others I have seen.
                              [color=blue][color=green]
                              > > The data is ALWAYS more important than the language used to access it.[/color]
                              >
                              > I'll be more precise. This style of coding only applies to situations
                              > where the business model is isomorphic with a single (unencapsulated )
                              > data model. If only we had this luxury.
                              >
                              > You picked up on the word "language" and so missed the point.
                              >[color=green]
                              > > Tony Marston[/color]
                              >
                              > You boasted in a previous post that it took 60 mins to add six tables
                              > and classes.[/color]

                              No. One table, one class, 6 components.
                              [color=blue]
                              > That is actually pretty dismal for what is pretty routine
                              > coding. I just completely rewrote our charging and billing system.
                              > That's about 15 tables, 15 DAOs and 4 business classes (now 3). That
                              > took an hour and a half.[/color]

                              Congratulations , you have an efficient development environment. But
                              how many of those wierd ideas that people have tried to stuff down my
                              throat do you actually employ yourself?
                              [color=blue]
                              > We generate the data mappers and SQL, so that
                              > was just an XML edit. The bulk of the time was thus writing the
                              > automated tests and documentation. All whilst gently chatting to the
                              > business development guy that I was working with. We like to take things
                              > easy you see.[/color]

                              I like to take things easy as well, which is why I create development
                              environments which enable me to create working components in hours or
                              minutes instead of days or even weeks.
                              [color=blue]
                              > Unlike Andre I do not have the patience of saints. You sure as hell
                              > better have an argument that advances the discussion for me to bother to
                              > reply to any more of your posts.
                              >
                              > yours, Marcus[/color]

                              Unless you have something constructive to say then don't bother.

                              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

                              • André Næss

                                #45
                                Re: What is/is not considered to be good OO programming

                                Tony Marston:
                                [color=blue]
                                > I have seen too many development environments created by other people
                                > where they get so tied up in their rules they lose sight of the fact
                                > that the aim of the software developer is to produce software as
                                > quickly as possible. A method which takes weeks to produce each
                                > component is rubbish when compared to one that takes days, which in
                                > turn is rubbish when compared with one that takes hours.[/color]

                                I must respectfully disagree.

                                The software lifecycle is generally dominated by it's live time (the time it
                                is in actual use) rather than it's development time. This means that for
                                most software the amount of time spent maintaining it dwarfs the amount of
                                time it takes to develop it. The prime goal of the software developer is
                                thus to reduce the time actually spent on a piece of software, including
                                both development and maintenance.

                                What this means in practice is that if you by have this piece of software
                                which takes 1 week to develop, and 3 weeks to maintain, you're better off
                                if you can spend 2 weeks developing and only 1 week maintaining. Building
                                scalable and maintainable software is indeed a difficult challenge, and the
                                solution which seems fastest at first may not be the most efficient over
                                the entire lifespan of the software.

                                What constitutes a scalable and maintainable software system is a rather
                                more involved discussion, however.

                                André Næss

                                Comment

                                Working...