Aesthetics and Automatic Layout of UML Class Diagrams

Total Page:16

File Type:pdf, Size:1020Kb

Aesthetics and Automatic Layout of UML Class Diagrams 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.
Recommended publications
  • Some Words About Networks. Dr. Peter G. Gyarmati
    Some words about Networks. II. part Compiled by Dr. Peter G. Gyarmati for research purposes. TCC COMPUTER STUDIO 2010. P. G. Gyarmati, dr.: Some words about network. I I.part. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 P. G. Gyarmati, dr.: Some words about network. I I.part. ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Some words about Networks. II. part Compiled by Dr. Peter G. Gyarmati for research purposes, based on Wikipedia pages, 2010. 03. 6. 1. Cluster diagram ..................................................................................................................... 5 2. Scale-free network................................................................................................................6 3. Power law.............................................................................................................................10 4. Pareto principle....................................................................................................................15 5. Natural monopoly ................................................................................................................18 6. The rich get richer and the poor get poorer ....................................................................... 23
    [Show full text]
  • SOME WORDS ABOUT NETWORKS Gives a Collection About His Lectures and Offered As a Breviary for Scientists
    P E T E R G . G Y A R M A T I ( 1 9 4 1 ) a PETER G. GYARMATI mathematician and electronic engineer worked trough years as a research professor with networks. The object of his many lectures gave us an overview about network science and also some of us went into deep research with him on details using hard math disciplines. This book SOME WORDS ABOUT NETWORKS gives a collection about his lectures and offered as a breviary for scientists. 2011. TI: SOME WORDS ABOUT NETWORKS ARMA PETER G. GY TCC COMPUTER STUDIO Peter G. Gyarmati Some words about Networks SOME WORDS ABOUT NETWORKS Compiled by Peter G. Gyarmati TCC COMPUTER STUDIO 2011. Some articles of this compilation originated from different sources. Unfortunately I could not list of them. Anyway, I have to express my thanks to all the contributors making possible this compilation. I also have to express thanks to them in the name of all the hopeful Readers. Imagine a world in which every single human being can freely share in the sum of all knowledge. ---------------------------------------------------------------------------------------------------- For additional information and updates on this book, visit www. gyarmati.tk www.gyarmati.dr.hu ---------------------------------------------------------------------------------------------------- Copying and reprinting. Individual and nonprofit readers of this publication are permitted to make fair use, such as to make copy a chapter for use in teaching or research, provided the source is given. Systematic republication or multiple reproductions requires the preliminary permission of either the publisher or the author. ISBN 978-963-08-1468-3 Copyright © Peter G. Gyarmati, 2011 Some words about Networks Table of contents 1.
    [Show full text]
  • Visual-Paradigm-Full-Features.Pdf
    UML Diagram Enterprise Professional Standard Modeler Community Use case diagram Class diagram Sequence diagram Communication diagram Activity diagram State machine diagram Component diagram Deployment diagram Package diagram Object diagram Composite structure diagram Timing diagram Interaction overview diagram SysML Diagram Enterprise Professional Standard Modeler Community SysML Requirement diagram User-defined requirement types Export and import requirements to Excel Block definition diagram Internal block diagram Parametric diagram Activity diagram Sequence diagram State machine diagram Use case diagram Package diagram Database Design Toolset Enterprise Professional Standard Modeler Community Entity relationship diagram Conceptual, logical and physical ER model Sample records editor Database domain Automatic foreign key generation Database View editor Split table into two Stored procedure support Trigger support Import ErWin Data Modeler project Import PowerDesigner Business Model Canvas Tool Enterprise Professional Standard Modeler Community Business Model Canvas editor Basic sticky notes and memos Diagram Templates and Examples Enterprise Professional Standard Modeler Community Hundreds of Diagram Templates and Examples IDE Integration ^ Enterprise Professional Standard Modeler Community Seamless Eclipse integration Seamless NetBeans integration
    [Show full text]
  • A User-Oriented Enterprise Proces Modeling Language
    A USER-ORIENTED ENTERPRISE PROCES MODELING LANGUAGE By AMIT A. CHAUGULE Bachelor ofEngineering Bombay University Bombay, India 1995 Submitted to Graduate College ofthe Oklahoma State University in partial fulfillment of the requirements for the Degree of MASTER OF SCIENCE August, 2001 A USER-ORIENTED ENTERPRISE PROCESS MODELING LANGUAGE Thesis Approved: Thesis Adviser ----D~-Ol-le-g-e--- 11 PREFACE Enterprise process modeling has been an emerging topic of interest since the early nineties. The research in this area has been driven by the vision ofprocess improvement. There are two key steps in applying process modeling tools and techniques to support process improvement initiatives. These are (i) the correct representation of the processes in the fonn of a process model, and (ii) the analysis of the processes to identify improvement opportunities. Process modeling is representing processes and the relevant details usually in a graphical language. These details are the inputs to and the outputs from a process, the description of the resources used or consumed by a process, and the relationship of the subjects involved in the process with respect to each other. The literature contains many process modeling tools and techniques. A technique typically involves graphical symbols with their semantics and syntax to capture process details. This thesis presents a brief review of several enterprise process modeling languages that have been developed so far. The strengths and the limitations of these languages are also presented. These fonn the basis for the requirements ofa new enterprise process modeling language. The proposed enterprise process modeling language exploits the strengths of existing process modeling languages.
    [Show full text]