Towards the Support for Crosscutting Concerns in Activity Diagrams: a Graphical Approach Jo˜ ao Paulo Barros 1,2,3 1 Instituto Politécnico de Beja, Escola Superior de Tecnologia e Gest ˜ ao, Área Departamental de Engenharia Rua Afonso III, n.” 1, 7800-050 Beja, Portugal jpb@uninova.pt 2 UNINOVA 2829-516 Monte de Caparica, Portugal Luis Gomes 2,3 3 Universidade Nova de Lisboa Fac. de Ciˆ encias e Tecnologia, Dep. de Engenharia Electrot ´ ecnica, Campus da FCT, 2825 Monte de Caparica, Portugal lugo@uninova.pt ABSTRACT The current proposal for activity diagrams in UML 2.0 al- lows for very complex graphs, reflecting the numerous inter- dependencies among the several actions and resources. This paper proposes a graphical composition operation support- ing the addition of crosscutting requirements in activity dia- grams through node fusion, addition, and subtraction. The operation has a highly readable and intuitive graphical rep- resentation and allows simple traceability and coupling. It is illustrated by a set of examples related to the inclusion of mutual exclusion and fair execution across several activity nodes. Keywords Crosscutting requirements, activity diagrams, composition, aspect-oriented design 1. INTRODUCTION When reviewing the extensive UML literature it is easy to notice that, when compared to other UML diagrams, ac- tivity diagrams have been given little attention. This is probably due to their status relatively to state diagrams: in UML 1.x [9] activity diagrams are defined as a state dia- grams subset. Yet, UML 2.0 [8] clearly separates activity diagrams from state machines. Furthermore, activity dia- grams are brought much closer to Petri nets [11]. As stated in [8], ”this widens the number of flows that can be mod- elled”. This fact and the additional defined activity node types, clearly increase the activity diagrams modelling ca- pabilities. We believe the added modelling power, and its independence towards state machines, will certainly give rise to a more frequent use of activity diagrams and to its application in the modelling of a larger number of system types. Also, the different applications and the increase in the number of flows to be modelled will mean more complex models. Finally, the trend towards Model Driven Architecture will certainly contribute to further increase model complexity. To counter model complexity, which easily gives rise to un- readable graphs, this paper proposes the use of an addi- tional composition operation for activity diagrams. It al- lows model modification in a traceable and additive way. More specifically, the conducted modifications are encapsu- lated as concerns (in the sense defined by Dijkstra [3]) that can be added to the initial model. The objective is also to maximise model readability even after modifications whose effect is spread across the model. At the coding level, aspect- oriented programming [7] shares these goals. There, the well-modularised modifications with effect across the model are named aspects. More exactly, aspects are defined as well-modularised crosscutting concerns. A previous paper [2] proposed the use of sub-activities (in- voked activities) as aspects. There the aspects ”are partial models (diagrams) that, when connected to the model, im- pose a new behaviour to a set of existent activities”. Yet, it was pointed out that the proposed use of sub-activities introduces additional steps in the activity flow. These re- sult from the use of a non-orthogonal construct for compo- sition, namely the asynchronous interface between the ex- istent graph and the added sub-activities, which is based upon the addition of parameter object nodes. Differently from [2], this position paper proposes the use of a new composition operation (named activity addition ) for weaving a crosscutting concern into a primary model. This is achieved through fusion of activity nodes in the primary model with activity nodes (of the same class) in the activ- ity diagram modelling the crosscutting concern. Besides the known advantages in the use of an orthogonal composition construct [14], the node fusion also avoids the use of the additional interface nodes, which introduced potential addi- tional steps (depending on the used semantics). The activity addition operation is inspired by works in the