#51 aspect-oriented software development

open
None
5
2007-04-23
2007-04-23
No

Can your implementation and the generated software benefit from this design approach?
http://en.wikipedia.org/wiki/Aspect-oriented_programming

Discussion

  • William Fulton

    William Fulton - 2007-04-23

    Logged In: YES
    user_id=242951
    Originator: NO

    I see the SWIG features and typemaps as aspects. The aspects are concerned with code marshalling and error checking. What SWIG does is take the snippets of code from these aspects to generate code before and after a function call. Can you please elaborate if there is some particular feature of AOP that you are interested in seeing SWIG support?

    Aspects and AOP terminology isn't used in the SWIG documentation, but putting a section on AOP techniques and SWIG directives might be useful.

     
  • Markus Elfring

    Markus Elfring - 2007-04-23
    • assigned_to: nobody --> wsfulton
     
  • William Fulton

    William Fulton - 2007-04-23

    Logged In: YES
    user_id=242951
    Originator: NO

    If you are looking for pure C++ aspects, then there is a missing part to SWIG. One day someone will provide a C++ language module which will then fill in the missing piece. This would basically be a C++ generator when parsing C or C++ code. Right now the aspects are for cross language interoperation where the code being generated for use by Java/Python etc is tailored using various SWIG directives. Directives like SWIG's %extend/($this or $action) (akin to FEATUREC++'s refines/super) solve the extensibility problem and constructor propagation by generating target language proxy classes. The canonical logging example is solved using the %exception feature, see the Customization.html chapter or even just Customization.html#Customization_clearing_features for an example on logging.

    Typemaps and %feature provide what seems to be called pointcuts. Introduction advices, such as adding in new methods/constructors are supported by %extend. Removal of methods/classes is done with %ignore and we even have %rename to rename methods/classes.

    I'm not sure what we can reuse as we have our own parser. SWIG parses standard C++, so I'm not sure about C++ extensions. If someone wants to wrap code with these aspects, then I guess support for the extension could be added.

     
  • Markus Elfring

    Markus Elfring - 2007-04-23

    Logged In: YES
    user_id=572001
    Originator: YES

    Would you like to prepare your software for target environments that support source code generation with aspects (weaving)?

    How do you think about to extract any parts from your own source files as explicit aspects?

     

Log in to post a comment.