400 likes | 618 Views
Visualizing Architectures. INF 123 – Software architecture tdebeauv@uci.edu. Outline. Some theory The tools Examples Socket networking in the Linux kernel Vivox : VOIP for Second Life. Some theory. Software Architecture. The set of most important design decisions “Most important”
E N D
Visualizing Architectures INF 123 – Software architecture tdebeauv@uci.edu
Outline • Some theory • The tools • Examples • Socket networking in the Linux kernel • Vivox: VOIP for Second Life
Software Architecture • The set of most important design decisions • “Most important” • According to the stakeholders • “Design decisions” • Aware of the options • Also called constraints • More than just the code structure
Architectural Model • Aka architectural view • A subset of the design decisions • Focused on a particular concern • Separation of concerns! MASC! • Examples • Server-side of an online game • How the Linux kernel handles networking • Authentication process
Architectural Model A visualization of the model “protect an entrance” Architecture
How do we choose what to model? • Stakeholders decide • What should be modeled/modelled • Components, connectors, configurations, rationales, constraints, behaviors, non-functional requirements, … • At what level of detail • At what level of fidelity • More faithful = more expensive to maintain
Inconsistent models • Models contradicting each other
Reasons for inconsistencies • Architects with different opinions • Level of detail • High-level view has components absent in a lower-level view • Static vs dynamic concerns • Component structure != protocol • Functional vs non-functional concerns • Broadcast the message to everyone vs scalability • Physical vs logical concerns • 2 self-contained subsystems for 3 machines
Visualizing models • A model is abstract • Abstraction! MASC! • A visualization must allow… • Architects to present their models • Stakeholders to discuss the models • A visualization is concrete
Describing a Software Architecture • “Just look at the source code!” • Natural language • Easy to discuss and contract-like, but long to read • XML, JSON • Good for hierarchical structures, but hard to read • Images/screenshots • Good for usability arch, not for system or deploy • Box-and-arrow diagrams • Back and forth with XML/JSON
Natural language The system has 3 components: C1, C2, and C3. C1 receives inputs from the user and forwards them to C2. C1 also receives information from C2 and displays it to the user. C2 …
XML <instance:xArchxsi:type=”instance:XArch”> <types:archStructurexsi:type=”types:ArchStructure” types:id=”ClientArch”> <types:descriptionxsi:type=”instance:Description”> Client Architecture </types:description> <types:componentxsi:type=”types:Component” types:id=”WebBrowser”> <types:descriptionxsi:type=”instance:Description”> Web Browser </types:description> <types:interfacexsi:type=”types:Interface” types:id=”WebBrowserInterface”> <types:descriptionxsi:type=”instance:Description”> Web Browser Interface </types:description> <types:directionxsi:type=”instance:Direction”> inout </types:direction> </types:interface> </types:component> </types:archStructure> </instance:xArch>
JSON xArch{ archStructure{ id = “ClientArch” description = “Client Architecture” component{ id = “WebBrowser” description = “Web Browser” interface{ id = “WebBrowserInterface” description = “Web Browser Interface” direction = “inout” } } } }
Screenshots Fast, 12pts Static, 1pt Slow, 70pts
Box and Arrow • The most appropriate most of the time • UML • Other standard diagrams Display Logic State
UML • Structure • Class diagram • Component diagram • Interaction • Communication diagram • Sequence diagram • Behavior • State machine • Flowchart/Activity diagram
Other standard diagrams • Control flow graph • Data flow diagram • Swimming lane diagram
Your own diagrams • Use the same symbol for the same things • Use standard symbols and representations • Don’t use the same symbol for different things • Add a legend if needed Client 1 Client 2 Send position Has a 2-way connection server
Tools for diagrams • Dia https://wiki.gnome.org/Apps/Dia • Not just UML • ArgoUMLhttp://argouml.tigris.org/ • Eclipse UML plugins • Visio, PowerPoint • Gliffy, Lucidchart, online tools • Paint (please don’t …)
Swimming lane diagram http://www.cs.unh.edu/cnrg/people/gherrin/linux-net.html
Flowchart http://www.cs.unh.edu/cnrg/people/gherrin/linux-net.html
Data flow diagram http://wiki.openwrt.org/doc/networking/praxis
High-level diagram Why is Vivox a separate server process?
Separation of concerns! Still working. But chat is down. Still working Down! Chat is down
Sequence diagram without Vivox http://bowling-bash.blogspot.com/2010/03/vivox-integration.html
Sequence diagram with Vivox Server-side Client-side http://bowling-bash.blogspot.com/2010/03/vivox-integration.html
Client-side protocol http://bowling-bash.blogspot.com/2010/03/vivox-in-sl-client-server-and-protocols.html
Class diagram (sort of) http://bowling-bash.blogspot.com/2010/03/vivox-in-sl-client-side-components.html
Component diagram http://bowling-bash.blogspot.com/2010/03/vivox-in-sl-client-side-components.html
Communication diagram http://bowling-bash.blogspot.com/2010/03/vivox-in-sl-client-side-components.html