Loading ...
Sorry, an error occurred while loading the content.

[extremeprogramming] Re: All the extras (I don't know about: Elves in the Night)

Expand Messages
  • Dave Thomas
    ... Just the effort of adding the calls to the hundreds of potential sites across the code... ... In Ruby, you define a class using something like: class
    Message 1 of 38 , Jan 3, 2000
      Patrick Logan <patrickdlogan@...> writes:

      > Used to be we were discussing XP in a programming forum. Now we're
      > discussing programming in an XP forum. Turn-about is fair play? 8^/
      > Dave Thomas writes:
      > >
      > > Sometimes, though, tracing is what you do to find out _why_ a unit
      > > test failed. Adding tracing retroactively when a particular test
      > > fails way down the development pike may be far more expensive that
      > > asking for it as you go along.
      > (1) What kind of tracing is *that* expensive?

      Just the effort of adding the calls to the hundreds of potential sites
      across the code...

      > I don't know about Ruby or AOP, so I am not sure what you mean by
      > adding tracing "orthogonally".

      In Ruby, you define a class using something like:

      class Person

      attr :age, writable
      attr :sex

      <method definitions etc...>

      'class Person' declares a class. The 'attr's declare two attributes
      (externally accessible object state), the first one mutable. I could
      change Dave's age using

      dave = person.new('Male')
      dave.age = 137 # seems like it some days

      Now, say I was having a problem with someone, somewhere, setting Dave's
      age wrongly. I can override the mutator for the object 'dave'. I can
      do this without touching the original definition of class Person-this
      changes the definition for just this instance of a Person:

      def dave.age=(newAge) {
      trace "Age changed from #{@age} to #{newAge}"
      @age = newAge

      All assignments to dave.age now get traced.

      Alternatively, I could write code that changes the meaning of 'attr'
      for all Person objects, so every assignment to any Person attribute
      will get logged. I could even change the system so that every
      assignment to every attribute in any object gets traced.

      It's orthogonal because I can do all this without changing the files
      containing the class definitions themselves - the tracing is
      orthogonal to the application.

      Ruby is like Smalltalk, in that it lets you get to get guts of the
      language. It supports meta-classes, so you can effectively change the
      semantics of the language if you need to. Andy and I are currently
      looking to see if we can implement DbC for Ruby exclusively in Ruby
      (the jury's still out).

      AOP is a different way of inserting code at certain spots throughout a
      system. Again, the code to insert, and the patterns defining where to
      insert it, is outside the body of the application.



      Thomas Consulting.
      Innovative and successful developments with Unix, Java, C, and C++.

      Now in bookstores:
      The Pragmatic Programmer. www.pragmaticprogrammer.com/ppbook/
    • Robert C. Martin
      Tom Kreitzberg wrote in message news:387364E4.C0A3E6CC@jhuapl.edu... ... There is no fundamental difference between pre XP Object
      Message 38 of 38 , Jan 5, 2000
        Tom Kreitzberg <Tom.Kreitzberg@...> wrote in message

        > But I think "flexibility" means different things to XP and,
        > shall we say, pre-XP OMA. In XP, doesn't it primarily mean
        > once and only once? In pre-XP OMA, doesn't it primarily mean
        > OCP and low coupling? When I wrote that XP "is structured so
        > that inflexible designs are cheap to change," I meant inflexible
        > in this second sense.

        There is no fundamental difference between pre XP Object Mentor, and
        post XP
        Object Mentor except that we have identified XP as the process we like
        use. Even this is not a big shift for us, since XP is very similar in
        spirit and practice to the unnamed process we have used for years.
        are differences, certainly -- specifically in the areas of pair
        and test first programming; but these are differences in intensity, not
        philosophy. As for the rules governing simplity, the planning game,
        iterations, etc, we were very closely aligned.

        Flexibility means the same to me now as it did five years ago. The
        to add or change significant amounts of functionality while changing a
        minimum of exsiting code -- i.e. the OCP. OnceAndOnlyOnce leads to this
        goal just as the OO design principles do. It is my goal over the next
        several months to integrate the principles and XP.
      Your message has been successfully submitted and would be delivered to recipients shortly.