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

Re: [XP] Generative Programming

Expand Messages
  • Armin Roehrl
    Thanks, Kenneth. Could you please elaborate the difference between reuse and generative programming? In the big picture generative programming puts components
    Message 1 of 4 , Jan 1, 2002
    • 0 Attachment
      Thanks, Kenneth.

      Could you please elaborate the difference between reuse
      and generative programming? In the big picture generative programming
      puts components with the right glue together (maybe the
      glue or part of the components get created automatically).
      Is that correct?

      My first three impressions are:
      - Generative programming only makes sense when you do a long
      term invest in a domain -- otherwise a write once solution is faster
      and certainly far less general than an entire family of solutions.

      - too little concrete how-to aid is given.

      - If the domain is not very restricted, specifying what you want (exactly)
      might take up as much time as writing it in a high-level language.
      If I've already defined the "right" specification language for a specific
      domain, it might be easier to say: Give me a Mercede C-Klass
      with all the extras and make it light-blue, then to start coding from what
      components and in what order such a car is made up. This is part of
      the generator to figure out.

      Bye,
      Armin

      On Tuesday 01 January 2002 19:36, you wrote:
      > I have been using the approach since reading the book. It is a different
      > approach from "reuse" (which doesn't really seem to work in practice) and
      > in my limited experience it does seem to work. I have done things like
      > writing code that took table structures and generated stored procedures and
      > script code templates to call the stored procedures. Actually I think a
      > Wiki is an example of "generative programming", you can see my wiki work at
      > www.seedwiki.com a public wiki farm (free).
      >
      > Kenneth Tyler
      > ----- Original Message -----
      > From: "Armin Roehrl" <armin@...>
      > To: <extremeprogramming@yahoogroups.com>
      > Sent: Tuesday, January 01, 2002 10:03 AM
      > Subject: [XP] Generative Programming
      >
      > > Hi,
      > >
      > > been looking at: " Generative Programming: Methods, Tools, and
      >
      > Applications"
      >
      > > by Krzysztof Czarnecki, Ulrich Eisenecker, Addison Wesley, 2000
      > >
      > > The book claims: Using generative programming techniques, you can solve
      > > software engineering problems in families, rather than individually,
      >
      > saving
      >
      > > time and coding effort.
      > >
      > > Does anybody have any experience with Generative programming?
      > > I'm still rather unconvinced.
      > >
      > > What do you think?
      > >
      > > Thx,
      > > Armin.
      > >
      > > -----------------------------------------------
      > > Armin Roehrl, http://www.approximity.com
      > >
      > > To Post a message, send it to: extremeprogramming@...
      > >
      > > To Unsubscribe, send a blank message to:
      >
      > extremeprogramming-unsubscribe@...
      >
      > > ad-free courtesy of objectmentor.com
      > >
      > > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
      >
      > To Post a message, send it to: extremeprogramming@...
      >
      > To Unsubscribe, send a blank message to:
      > extremeprogramming-unsubscribe@...
      >
      > ad-free courtesy of objectmentor.com
      >
      > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

      --
      Armin.

      -----------------------------------------------
      Armin Roehrl, http://www.approximity.com
    • Kenneth Tyler
      I have been using the approach since reading the book. It is a different approach from reuse (which doesn t really seem to work in practice) and in my
      Message 2 of 4 , Jan 1, 2002
      • 0 Attachment
        I have been using the approach since reading the book. It is a different
        approach from "reuse" (which doesn't really seem to work in practice) and in
        my limited experience it does seem to work. I have done things like writing
        code that took table structures and generated stored procedures and script
        code templates to call the stored procedures. Actually I think a Wiki is an
        example of "generative programming", you can see my wiki work at
        www.seedwiki.com a public wiki farm (free).

        Kenneth Tyler
        ----- Original Message -----
        From: "Armin Roehrl" <armin@...>
        To: <extremeprogramming@yahoogroups.com>
        Sent: Tuesday, January 01, 2002 10:03 AM
        Subject: [XP] Generative Programming


        > Hi,
        >
        > been looking at: " Generative Programming: Methods, Tools, and
        Applications"
        > by Krzysztof Czarnecki, Ulrich Eisenecker, Addison Wesley, 2000
        >
        > The book claims: Using generative programming techniques, you can solve
        > software engineering problems in families, rather than individually,
        saving
        > time and coding effort.
        >
        > Does anybody have any experience with Generative programming?
        > I'm still rather unconvinced.
        >
        > What do you think?
        >
        > Thx,
        > Armin.
        >
        > -----------------------------------------------
        > Armin Roehrl, http://www.approximity.com
        >
        > To Post a message, send it to: extremeprogramming@...
        >
        > To Unsubscribe, send a blank message to:
        extremeprogramming-unsubscribe@...
        >
        > ad-free courtesy of objectmentor.com
        >
        > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
        >
      • Kari Hoijarvi
        I did some generative programming in my last big project. We used Design-By-Contract in the spirit of Eiffel language on C++ and COM platform. I wrote a
        Message 3 of 4 , Jan 2, 2002
        • 0 Attachment
          I did some generative programming in my last big project.

          We used Design-By-Contract in the spirit of Eiffel language on C++ and COM
          platform. I wrote a generator to generate precondition/postcondition checks
          straight from IDL. There were some other domain-specific attributes that I
          also used to generate some code.

          The benefits of this approach was, that using DBC became much less painful
          and it was therefore more accepted by the rest of the team. The result was,
          that I hardly ever had to debug a running system: tests that failed usually
          failed in DBC assertion which is easy to find.

          The downside of this is that there's some amount of work to get it done. In
          my opinion, it was worth it. For a small project, no way.

          I didn't do generative programming in another place I should have: ATL.
          Next time I have to use ATL I'll probably write a script to generate the
          following when adding a new class. The ATL wizard usually does this all, but
          as soon as the code gets too confusing, it's broken and you have to modify
          six files to add one class.

          >> 1. copy+paste+edit create interfaces into scmaster.idl
          >> - insert new GUID
          >> - add attributes oleautomation and object
          >> - add _COM_SMARTPTR_TYPEDEF to sp.h
          >> 2. copy+paste+edit coclass into scmaster.idl
          >> - declare all the interfaces in coclass and new_class.h
          >> - declare outgoing intefaces into coclass
          >> 3. edit scmaster.cpp
          >> - include new_class.h
          >> - add new_class into object map
          >> 4. copy+paste+edit new_class.rgs
          >> - copy guids from idl file
          >> - fix progids
          >> 5. add IDR_NEW_CLASS into new_class.h, resource.h and
          >> scmaster.rc
          >> 6. copy+paste+edit new_class.cpp
          >>

          all the information you really need is in the coclass section in the type
          library. A script, that generates the ATL implementation if it is probably
          less than 100 lines long and much more realiable than copy+pasting GUID's
          from one file to another. Guess how many times I was debugging a class that
          didn't load and found out that guid's were wrong?

          On the other hand, my knowledge of ATL is hopefully obsolete.

          Kari

          Some comments included:

          -----Original Message-----
          >Could you please elaborate the difference between reuse
          >and generative programming? In the big picture generative programming
          >puts components with the right glue together (maybe the
          >glue or part of the components get created automatically).
          >Is that correct?

          in generative programming, you are making a translator. In my case, it's
          usually been a declarative language to C++.

          >- Generative programming only makes sense when you do a long
          >term invest in a domain -- otherwise a write once solution is faster
          >and certainly far less general than an entire family of solutions.

          Right. It's not the simplest thing.

          >- too little concrete how-to aid is given.

          Tools very primitive, usually text is an in between medium. Reflection API's
          in Java and .NET help, as well as all the embedded information in python
          2.2.

          Of the high-level tools:

          The best tool I know is AspectJ, aspect oriented extension to Java. It's not
          general purpose, but for DBC kind of stuff it's excellent. OpenC++ is more
          general, but much more difficult to use.
        • Glew, Andy
          ... I pretty much buy into the good things that generative programming gets you. Trouble is, I haven t really figured out if generative programming is anything
          Message 4 of 4 , Jan 3, 2002
          • 0 Attachment
            > Does anybody have any experience with Generative programming?
            > I'm still rather unconvinced.

            I pretty much buy into the good things that generative programming
            gets you.

            Trouble is, I haven't really figured out if generative programming is
            anything more than a more structured macro language.
          Your message has been successfully submitted and would be delivered to recipients shortly.