On Interplay between Separation of Concerns and Genericity Principles: Beyond Code Weaving


Stan Jarzabek, Kuldeep Kumar




Ideally, we would separate concerns by designing a program so that each concern is contained in a module. Unfortunately, we often have to deal with concerns that cannot be modularized, but instead cross-cut modules of our primary decomposition. Some of the cross-cutting concerns can be separated using compositional techniques such as Aspect-Oriented Programming (AOP) that weave code into modules at specified program points. Here, we focus on crosscutting concerns that would not be easily separable with code weaving compositional techniques due to their frequent and complex interactions with the modules of primary decomposition. Separation of Concerns (SoC) and genericity are two important Software Engineering principles to better control software complexity during development, maintenance, and reuse. In this paper, we study the interplay between these two principles, showing that there is an overlapping area where the goals of SoC and genericity, as well as means to achieve these goals, are the same. We make a case that by integrating the principles of SoC and genericity we can achieve non-redundancy, and at the same time enhance the visibility of inseparable concerns, offering a weaker, but still useful form of SoC. We illustrate the points we make with examples of program representations built with the Adaptive Reuse Technique (ART) that supports both SoC and generic mechanisms.