
Aesthetics and Automatic Layout of UML Class Diagrams Dissertation zur Erlangung des naturwissenschaftlichen Doktorgrades der Bayerischen Julius-Maximilians-Universität Würzburg vorgelegt von Holger Eichelberger aus Dinkelsbühl Würzburg, 2005 Eingereicht am: 22.03.2005 bei der Fakultät für Mathematik und Informatik 1. Gutachter: Prof. Dr. Jürgen Wolff von Gudenberg, Universität Würzburg 2. Gutachter: Prof. Dr. Franz Josef Brandenburg, Universität Passau Tag der mündlichen Prüfung: 15.06.2005 To Mum, Mone, Doris and Roswita. Contents 1 Introduction 1 2 Diagram Basics 7 2.1 The Unified Modeling Language . 7 2.1.1 Diagrams of UML . 8 2.1.2 UML Class Diagrams . 10 2.1.3 Criticism on UML . 20 2.1.4 Alternative Visualizations . 24 2.2 Automatic Diagram Layout . 26 2.2.1 Why to Draw a Class Diagram Automatically? . 26 2.2.2 Graph Drawing – an Overview . 28 2.2.3 State-of-the-Art in Drawing UML Class Diagrams . 36 3 Functional Specification 43 3.1 Requirements for UML Class Diagram Layout . 43 3.2 Input and Output . 47 3.3 Aesthetics . 51 3.3.1 Terminology . 52 3.3.2 Traditional Graph Drawing Aesthetics . 54 3.3.3 Human Computer Interaction and Cognitive Psychology . 61 3.3.4 Software Engineering . 65 3.3.5 Software Visualization (SV) . 69 3.3.6 Semantic Aesthetic Principles for UML Class Diagrams . 71 3.3.7 Aesthetic Conclusions . 85 4 The Layout Algorithm 93 4.1 SugiBib – Just Another Hierarchical Algorithm? . 93 4.2 Structural Conventions for Graphs . 105 4.3 Basic Definitions . 112 4.3.1 Notational Conventions . 112 4.3.2 Primitives . 113 4.3.3 Graphs, Nodes, Edges and Operations . 114 4.3.4 The Node Naming Function . 118 ii CONTENTS 4.4 Preprocessing Steps . 123 4.4.1 Adjust Semantical Issues . 123 4.4.2 Semantic Ordering . 124 4.4.3 Deduce Hierarchy . 126 4.4.4 Insert Nesting Relations as Edges . 127 4.4.5 Compress Hyperedge Connection Nodes . 127 4.4.6 Remove Direct Cycles . 128 4.4.7 Compress Association Classes . 129 4.4.8 Compress Comments . 130 4.4.9 Remove Disconnected Nodes . 132 4.4.10 Virtual Root and Leaf . 132 4.4.11 Breaking Cycles . 133 4.4.12 Conclusions . 134 4.5 Rank Assignment . 136 4.5.1 Previous Work . 136 4.5.2 Basic Definitions . 138 4.5.3 Validity Rules . 140 4.5.4 The Core Algorithm . 143 4.5.5 UML and Cluster Specific Adjustments . 145 4.5.6 Conclusions . 154 4.6 Edge Crossings . 156 4.6.1 Previous Work . 156 4.6.2 Basic Definitions . 160 4.6.3 Crossing Theory . 162 4.6.4 Cluster Handling . 190 4.6.5 Extended Crossing Algorithms . 197 4.6.6 Conclusions . 203 4.7 Intermediary Processing . 204 4.7.1 Expand Composite Nodes for Association Classes or Hyperedges . 204 4.7.2 Remove Nesting Edges . 205 4.7.3 Conclusions . 205 4.8 Coordinates Assignment . 206 4.8.1 Previous Work . 207 4.8.2 Basics . 210 4.8.3 The Coordinates Assignment Algorithm . 215 4.8.4 Coordinates Preprocessing . 217 4.8.5 Iterative Coordinates Assignment . 223 4.8.6 Postprocessing . 230 4.8.7 Conclusions . 234 4.9 Postprocessing . 236 4.9.1 Association Classes . 236 4.9.2 Hyperedges and Constraints . 237 4.9.3 Annotations . 238 CONTENTS iii 4.9.4 Disconnected Nodes . 239 4.9.5 Alignment to a Specified Grid . 239 4.9.6 Create the Result Graph . 241 4.9.7 Conclusions . 241 4.10 Summary . 242 5 Measurements 245 5.1 Measuring Aesthetics . 245 5.2 Layout Comparison . 262 5.3 Runtime Measurements . 269 6 Implementation 281 6.1 Architecture of SugiBib . 281 6.2 Layout Algorithm . 288 6.2.1 Preprocessing . 288 6.2.2 Rank Assignment . 291 6.2.3 Edge Crossings . 292 6.2.4 Intermediary Processing . 294 6.2.5 Coordinates Assignment . 295 6.2.6 Postprocessing . 296 6.3 Applications for UML class diagrams . 298 6.3.1 Information Classes for UML Class Diagrams . 298 6.3.2 Application Library . 303 6.3.3 Layout Metrics . 305 6.4 Testing & Debugging SugiBib . 307 6.5 Runtime Optimizations . 312 6.6 Extensions & Modifications to SugiBib . 321 7 Drawing Class Diagrams – an Ongoing History 327 7.1 Future Work . 327 7.2 Conclusions . 330 A1 Example Drawings by SugiBib 333 A2 Lists and Hashtables 344 A3 Improved Algorithms 347 A3.1 Cluster Validity . 347 A3.2 Edge Crossing Reduction . 349 A4 Bibliography 350 A5 List of Figures 372 iv CONTENTS A6 List of Algorithms 376 A7 List of Tables 377 A8 Index 378 1 Introduction One fine day, in a company, a software engineer is told to participate in a process for specify- ing and implementing an object-oriented software system. The engineer knows that these days, specifying software is one of the most convenient tasks one could be assigned to do. Different kinds of tools are available to support that work to create a product of high quality. One of these tools is a unified, visual specification language introduced by an international standard. That visual language simplifies the communication with other software engineers presumably work- ing in different companies located in several countries by providing highly intuitive diagrams which lead to a precise description of the software system. That visual language is furthermore supported by various software tools, all interacting with each other without any problem. Using these tools, all engineers involved could change all specification documents in parallel. Consid- ering static and dynamic information from the model nearly perfect code is generated. When requirements change, modifications in the diagrams are registered by the tool and the layout of the diagrams is perfectly adjusted with minimum number of changes to maintain the mental map of the engineer. Even if the engineer had been assigned to a maintenance project for documenting and maintaining ancient code, which was produced neither with standardized specification nor documentation, this would have been also a convenient task. The same tools mentioned above are able to analyze the old sources, to automatically recognize design patterns according to a pattern catalog and to produce perfect diagrams and documentation. Software engineers have created for themselves the perfect world to work in. Wouldn’t it be nice if that was true? The present situation however, is far from that perfect situa- tion. In the future, this software engineering fairy tale may become reality, the current situation, however, looks more like a horror story: The international standard language mentioned above, the Unified Modeling Language (UML) exists, but it is far away from reaching that state of preci- sion. Most of the tools supporting UML are not compliant to the current version of the standard, and even ancient versions are not completely supported. Most of.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages390 Page
-
File Size-