ni - Bloomy · 2019. 12. 16. · ni.com 23 LowUML Expo Booth #305 • Many stakeholders do not have...
Transcript of ni - Bloomy · 2019. 12. 16. · ni.com 23 LowUML Expo Booth #305 • Many stakeholders do not have...
1 ni.com
ni.com
ni.com
Jon McBee
Senior Project Engineer
LabVIEW Champion
Bloomy
Expo Booth #305 www.bloomy.com
ni.com
How to Eat the Elephant
Turning Ideas Into Architecture
Expo Booth #305 www.bloomy.com
5 ni.com
Overview
• Introduction
• What is Architecture
• How do you communicate
• UML
• Sketches
• Example
• Questions
Expo Booth #305 www.bloomy.com
6 ni.com
Background Information
• Bloomy Quick Facts • 22 year NI Alliance Partner - Platinum level
• Products, platforms, and custom systems for ATE, DAQ, and Control
• NI Electronic Design Specialty, Vision Specialty, and Embedded Control Specialty
• 19 NI Certified LabVIEW Architects
• 3 NI Certified Training Centers
Expo Booth #305 www.bloomy.com
7 ni.com
Introduction
• A new project comes in, where do you start?
Expo Booth #305 www.bloomy.com
8 ni.com
Typical Software Lifecycle
Expo Booth #305 www.bloomy.com
Requirements
Gathering Design Development
Debugging &
Testing Deployment Architecture
12 ni.com
What is Architecture?
“A good architecture avoids complicated systems by building them out of lots of simple components whose interactions can certainly create a complex system but not one that needs to be overly complicated” -Peter Cripps
Expo Booth #305 www.bloomy.com
“The high level structure of a system, the discipline of creating such a high level structure, and the documentation of this structure” -Wikipedia
15 ni.com
Architecture Components
• Software Model • Defines how components interact at different levels of
abstraction
• Diagrams/Sketches
• What we are building
• Software Design • Structure of the software system
• Design Patterns/SDK/API/Data Structures
• How we are building
Expo Booth #305 www.bloomy.com
16 ni.com
Software Models
• A visual representation of a software application • Defines how components interact
• Comprised of multiple views at different levels of abstraction
• Context Sketch
• Container Sketch
• Component Sketch
• UML Model
• Target Audience • Who will use these models?
• Everyone must understand model paradigm
Expo Booth #305 www.bloomy.com
19 ni.com
Who Uses UML on a Regular Basis?
• Unified Modeling Language • General purpose modeling language
• Provides standard way to visualize system design
Expo Booth #305 www.bloomy.com
20 ni.com
What UML Diagrams do you Use?
• Behavioral • Activity
• Sequence
• State
• Structural • Class
Expo Booth #305 www.bloomy.com
21 ni.com
Why Don’t you use UML?
• I don’t know it • My team doesn’t know it
• My customers don’t know it
• I don’t need it • There is too much there/High barrier to entry
• My software is simple
• We don’t use object-oriented programming/design
• I don’t have it • I don’t have a tool
• Other reasons? • LabVIEW is self documenting…
Expo Booth #305 www.bloomy.com
22 ni.com
How do you communicate?
Expo Booth #305 www.bloomy.com
• Unexplained definition of diagram elements like the styles of boxes and lines
• Missing or ambiguous relationships between diagram elements
• Omission of technology choices (or options)
• Mixing different levels of abstraction.
23 ni.com
LowUML
Expo Booth #305 www.bloomy.com
• Many stakeholders do not have an understanding of UML, and this makes UML a difficult tool to use at higher levels of abstraction
• Using a simpler notation makes it easier to communicate the architecture • Using well defined levels of abstraction allows us to target different stakeholder
perspectives
When we reach the lower levels of abstraction, closer to design, a simple notation may not be sufficient and it is at this point we can switch to using a notation such as UML which can help describe complex designs.
25 ni.com
System Context
• High-Level Diagram • What are we building?
• Who is using it?
• How does it work with existing infrastructure?
Expo Booth #305 www.bloomy.com
System
Actor
Actor
Existing System
Existing System
26 ni.com
System Context
• Makes the context explicit, minimizing assumptions
Expo Booth #305 www.bloomy.com
System
Actor
Actor
Existing System
Existing System
System X? System
X
27 ni.com
System Context
• Helps identify who you need to talk to regarding which pieces of the system
Expo Booth #305 www.bloomy.com
System
Actor
Actor
Existing System
Existing System
System X Tom
28 ni.com
System Context
• Doesn’t show much detail • Acts as a starting point for other diagrams
• Acts as a starting point for conversations
Expo Booth #305 www.bloomy.com
System
Actor
Actor
Existing System
Existing System
29 ni.com
Containers
• Multiple containers make up a context • High-level technology decisions
• Overall shape of the system
Expo Booth #305 www.bloomy.com
System
Container
Container
Container
30 ni.com
Containers
• Each container has a • Name
• (Technology)
• Responsibility
Expo Booth #305 www.bloomy.com
DB
SPC UI (HTML)
• Display
SPC Charts
• Can select by UUT
DB Query Engine
(LabVIEW)
• Structures SPC data
• Queries DB
31 ni.com
Containers
• Illustrates • Purpose of interaction
• (Communication method) • Protocols
Expo Booth #305 www.bloomy.com
DB
SPC UI (HTML)
• Display
SPC Charts
• Can select by UUT
DB Query Engine
(LabVIEW)
• Structures SPC data
• Queries DB
Requests Data (Web Service) • HTTP
Returns Data (Web Service) • HTTP
32 ni.com
Containers
• Can show interaction of containers with actors external to context
Expo Booth #305 www.bloomy.com
DB
SPC UI (HTML)
• Display
SPC Charts
• Can select by UUT
DB Query Engine
(LabVIEW)
• Structures SPC data
• Queries DB
Requests Data (Web Service) • HTTP
Returns Data (Web Service) • HTTP
Manufacturing Engineer
QA Engineer
Tracks production by
station
Tracks failures by part
Queries DB (SQL) • TCP
33 ni.com
Containers
• Frames question: “Where do I need to write code in order implement features?”
Expo Booth #305 www.bloomy.com
DB
SPC UI (HTML)
• Display
SPC Charts
• Can select by UUT
DB Query Engine
(LabVIEW)
• Structures SPC data
• Queries DB
Requests Data (Web Service) • HTTP
Returns Data (Web Service) • HTTP
Manufacturing Engineer
QA Engineer
Tracks production by
station
Tracks failures by part
Queries DB (SQL) • TCP
34 ni.com
Components
Expo Booth #305 www.bloomy.com
System
Container
Container
Container
Component Component
• Building blocks of system
35 ni.com
Components
Expo Booth #305 www.bloomy.com
Web Service (Actor)
• Called by Web Resource methods
DB Interface (Actor)
• Queries database
• Each Component has a • Name • (Technology) • Responsibility
SPC UI DB
36 ni.com
Components
Expo Booth #305 www.bloomy.com
Web Service (Actor)
• Called by Web Resource methods
DB Interface (Actor)
• Queries database
• Illustrates • Interaction • Communication Method • Protocols
SPC UI DB Class based messaging (Actor Framework)
37 ni.com
Components
Expo Booth #305 www.bloomy.com
Web Service (Actor)
• Called by Web Resource methods
DB Interface (Actor)
• Queries database
• Should map to requirements • Use Cases • User Stories • Feature Request
SPC UI DB Class based messaging (Actor Framework)
38 ni.com
UML
• Use where necessary
Expo Booth #305 www.bloomy.com
System
Container
Container
Container
Component Component
UML UML UML UML
39 ni.com
UML
• UML fits well at this lower level of abstraction
• UML may fit at higher levels • Sequence diagram of component interaction within a container
• Sketches focus on structure, UML can inject processes and detailed behavior when needed
Expo Booth #305 www.bloomy.com
40 ni.com
Define Your Notation
Expo Booth #305 www.bloomy.com
Symbols Colors
Context
Container
Component
Data
Actor
Internal
External
42 ni.com
Ex. System Context
Expo Booth #305 www.bloomy.com
Customer
• Check Balance • Deposit • Withdraw • Transfer
Enterprise Database
Physical Console
• Retrieve Account • Update Account
• Button Press • Debit Card • Display Info
Automatic Teller Machine Simulator
Enterprise Database
Physical Console
43 ni.com
Ex. Containers
Expo Booth #305 www.bloomy.com
Simulation Interface (LabVIEW)
• Program run to test ATM algorithms
Account Database (Text File) • Interface by which the ATM
accesses and changes account information
ATM Message Table (Text File) • Table of message names and
message text displayed on console
ATM Error Log (Text File) • Error Log file which can be
checked by ATM maintenance personnel
Reads from and writes to
Reads from and writes to
Reads from and writes to
ATM Simulator
44 ni.com
Ex. Components/Modules
Expo Booth #305 www.bloomy.com
Uses Uses Uses
Simulation Interface
Simulation Interface (Actor)
• Run to test ATM algorithms
Simulated Database (Actor)
• Mimics access to an Enterprise Database
ATM Controller (Actor)
• Manages users, accounts, and transactions
Simulated Console (Actor)
• Mimics physical console
45 ni.com
How to eat the elephant
• Understand how your stakeholders see the elephant
• Use sketches to establish structure at different levels of abstraction
• Use sketches to communicate with stakeholders • Both external and internal
• Use UML where and how it most benefits your design • LowUML
Expo Booth #305 www.bloomy.com
46 ni.com
Further Reading
• http://www.codingthearchitecture.com/
• http://www.umlzone.com/articles/agile-software-architecture-and-nouml/
• http://softwarearchitecturezen.blogspot.com/2011/05/sketching-with-uml.html
• http://martinfowler.com/articles/designDead.html
Expo Booth #305 www.bloomy.com
49 ni.com
Questions?
• Please visit Expo Booth #305
• Check out the new: www.bloomy.com
• Email: [email protected]
Expo Booth #305 www.bloomy.com
50 ni.com
51 ni.com
Sketches...
Expo Booth #305 www.bloomy.com
• Help everybody understand the “big picture” of what is being built
• Create shared vision of what you’re building within the development team
• Provide a point of focus for those technical conversations about how new features
should be implemented
• Provide a map that can be used by software developers to navigate the source
code
• Help people understand how what they are building fits into the “bigger picture”
• Help you to explain what you’re building to people outside of the development
team (e.g. operations and support staff, non-technical stakeholders, etc)
• Fast-track the on-boarding of new software developers to the team
52 ni.com
What UML Diagrams do you Use?
• Class Diagrams • The top part contains the name of the class
• The middle part contains the attributes of the class
• The bottom part gives the methods or operations the class can take or undertake
Expo Booth #305 www.bloomy.com
• Relationships • Association
• Composition
• Aggregation
• Inheritance
53 ni.com
What UML Diagrams do you Use?
• Sequence Diagram • Messages, written with
horizontal arrows with the message name written above them, display interaction.
• Solid arrow heads represent synchronous calls
• Open arrow heads represent asynchronous messages
• Dashed lines represent reply messages
Expo Booth #305 www.bloomy.com
54 ni.com
What UML Diagrams do you Use?
• State Machine Diagram • Filled circle, pointing to the initial
state
• Hollow circle containing a smaller filled circle, indicating the final state (if any)
• Rounded rectangle, denoting a state. Top of the rectangle contains a name of the state. Can contain a horizontal line in the middle, below which the activities that are done in that state are indicated
• Arrow, denoting transition. The name of the event (if any) causing this transition labels the arrow body.
Expo Booth #305 www.bloomy.com
55 ni.com
What UML Diagrams do you Use?
• Activity Diagram • Rounded rectangles represent actions
• Diamonds represent decisions
• Bars represent the start (split) or end (join) of concurrent activities
• A black circle represents the start (initial state) of the workflow
• An encircled black circle represents the end (final state)
Expo Booth #305 www.bloomy.com
56 ni.com
State vs. Activity
Expo Booth #305 www.bloomy.com
State Machine Diagram Activity Diagram