Can your implementation and the generated software benefit from this design approach?
Logged In: YES
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.
Logged In: YES
Would you like to reuse anything from the evolving tools and libraries?
Are any pointcuts and advices provided by your software already?
I would appreciate the addition of a dedicated chapter in the documentation.
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.
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.