Sorting out Concerns

Sorting out Concerns

∗ Sorting out Concerns Lee Carver and William G. Griswold {lcarver, wgg}@cs.ucsd.edu Computer Science and Engineering UC San Diego La Jolla, CA 92093 Abstract These mechanisms underlie much of the progress in software Realizing the dream of additive, rather then invasive, software engineering, and they are fundamental to the notion of object- development requires support for the components and compo- oriented programming. sition methods used to implement production quality software. An important insight is that standard practice allows only The invasive changes common in most development indicate some concerns to be separated. The conventional mechanisms the inadequacy of standard practice. Several recent proposals rely heavily on hierarchical structures. This does allow ready (Hyperspaces, Aspect Oriented Programming) suggest that the separation of many concerns. However, it is inadequate when problems are inherent in hierarchical nature of the standard there are multiple independent concerns. Features, perform- mechanisms. These proposals define new mechanisms that ance, and error handling are independent and common con- can support a richer set of software construction methods. cerns in many production quality applications. Standard These new mechanisms have been used to guide a dissection practice uses the features to define a module hierarchy. This forces the performance and error handling concerns to be dis- of Gnu sort.c (2145 text lines). The goals of this experiment persed throughout the feature modules. These dispersed con- include the identification and analysis of concerns and compo- cerns are often referred to as cross-cutting aspects. The use of sition mechanisms used in real, production quality software. a single hierarchy forces independent concerns to be dispersed Preliminary results indicate that the new proposals do a good across the software modules. job of describing many forms of program composition. Al- Recently, several new mechanisms have been proposed for though 60 concerns have been identified, the interactions be- organizing and composing concerns. These new mechanisms tween 27 of them can be described by a single hyperspace. directly support non-hierarchical collections of concerns. This hyperspace describes most of the program’s external Aspect oriented programming (AOP)[4] and subject oriented behavior. It consists of one dimension with 20 configuration programming (SOP)[5] provide mechanisms to integrate mod- concerns cross-cutting 3 dimensions defined by 7 feature con- ules from independent hierarchies. The concern hyperspace cerns. However, some compositions are more troubling. In 3 model supports a behavioral definition of concerns and allows cases, adding a concern inserts code into the middle of already concerns to be organized into multiple dimensions[7]. established behaviors. These compositions appear to violate These mechanisms create a new context for understanding the notion that join points can be restricted to individual meth- program structure. We expect that these new mechanisms will ods or operations. allow us to completely describe sort.c’s structure. This description will be complete in the sense that every character 1. Introduction in the source is associated with at least one concern. Its mod- Any non-trivial software system is the conglomeration of con- est size (2145 text lines) allows for a detailed analysis. De- cerns and algorithms. Ideally, each concern and algorithm spite its small size, it offers a rich set of capabilities: large file would be separately specified and then composed to form the support, complex sort keys, and excellent performance. We final system. Such an approach has great intellectual appeal expect hyperspaces to provide simple representations for con- and numerous pragmatic advantages. The advantages include cern interactions and AOP/SOP to provide mechanisms for support for evolutionary software development, increased generating the application from the identified concerns. reuse of code and other artifacts, improved robustness, and Traditional notions of software composition and architecture shorter time to market. fail to describe all of the interconnected behaviors in the pro- Unfortunately, too much of development involves invasive gram. The interactions between usage() text, command line and repetitive modification of a program text. The inability to parsing, configuration options, and sorting features cannot be isolate the modifications for a change indicates an inability to described hierarchically. The hyperspace model captures these maintain a separation of concerns. A key factor in this inabil- connections with four dimensions. The traditional mecha- ity is inadequate techniques for organizing concerns and defin- nisms also fail to explain the program’s synthesis or evolution. ing their composition. Ideally, each concern is encapsulated as The transition from an object model to source code is essen- a single, self-contained software module. Several mechanisms tially a black art. Hyperspaces and hypermodules offer a way for defining modules are in common practice. These include to experiment with clusters of concerns. AOP and SOP allow layering[1], stepwise refinement[2], and information hiding[8]. a developer to realize code from these clusters. We expect that this experiment will validate the theories of ∗ This research was supported in part by NSF grant CCR-9508745 and took software hyperspaces and to provide practical experience with place in part while the second author was on sabbatical with the AOP group at AOP and SOP. Early results indicate that hyperspaces, AOP, Xerox PARC. Sorting out Concerns and SOP do good job of supporting the methods used to im- The concerns that we have identified come from a single arti- plement production quality software. fact: the code. This limits the class of concerns that can be The following sections provide details on this experiment. identified. The identified concerns are largely functional ca- Section 2 introduces the concepts used throughout this docu- pabilities such as sorting, key extraction, and file transfers. ment. Section 3 describes how concerns are identified and Concerns related to global issues are difficult to attach to spe- isolated from the rest of the program source. Section 4 pre- cific program text. This includes the “-ilities” such as main- sents some preliminary results based on the concerns that have tainability, supportability, and traceability. We assume that been identified. The final section presents some conclusions these concerns exist in other artifacts (requirements, designs), and suggests areas for future work. even when these artifacts are not physically realized. 2. Concepts Minimal Increments The basic notion of a concern is too general to identify the In order to enumerate and classify the concerns in sort.c a concerns that are useful for software development. We have concise definition of concerns is required. The general notion found that the complementary notion of minimal subsets[9] is of a concern is any coherent issue in the problem domain. This an effective way to identify concerns that are practical to soft- definition covers very complex situations, but provides little ware development. guidance for the enumeration of the practical concerns within a The minimal subsets method is normally used to construct program. software. The first step is to define a minimal subset of the The complementary notion of minimal subsets and minimal desired capabilities that might conceivably perform a useful increments provides the required guidance for enumerating service. Next, one defines a set of minimal increments to the concerns. It is especially appropriate for concern hyperspaces, system. The goal in defining the core subset and the incre- since minimal subsets define a mapping from program text to ments is to avoid components that perform more then one concerns. Each subset or increment defines a single concern. function. By including or excluding different sets of incre- The code that implements each increment is the code that ad- ments, a developer can readily create a whole family of appli- dresses that concern. cations[10]. Concerns Hyperspaces and minimal subsets work well together. Each An essential technique in software engineering is the separa- subset and increment defines a concern. The software entities tion of concerns[3]. In normal practice, this is mostly a phi- that address such concerns are simple to determine. The code losophical approach to the task. Clear guidance on the use and that implements the minimal increment is the code that ad- practice of this technique can provide a more constructive dresses that concern. In reverse, hyperspaces provide an effec- element in software development. A practical definition of a tive way to manage a large number of small increments. concern is needed. The dissection of sort.c reverses the construction process. The basic notion of a concern is that it is any coherent issue Capabilities that are not part of the minimal subset are rele- in the problem domain. This definition allows the notion of gated to an increment. The minimal sorting program simply concern to deal with arbitrarily complex concepts. Unfortu- reads a small file, sorts the lines, and writes the result. This nately, it gives no guidance on which concerns are reasonable minimal program contains a number of minimal subroutines. and which concerns should be separated. The utility of a con- The minimal sort routine appears to be a 51-line

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    6 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us