ts 8245 system components using design patterns on the...
TRANSCRIPT
![Page 1: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/1.jpg)
www.lowell.edu/dct
TS 8245 System Components Using Design Patterns on the Discovery
Channel Telescope
Paul J. Lotz, Software Engineering Manager with Michael J. Lacasse, Ryan C. Godwin
(Lowell Observatory)
NI Week 2012 -- Aug 05
![Page 2: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/2.jpg)
www.lowell.edu/dct
Discovery Channel Telescope (DCT)
NI Week 2012 -- Aug 05
![Page 3: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/3.jpg)
www.lowell.edu/dct
DCT
NI Week 2012 -- Aug 05
![Page 4: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/4.jpg)
www.lowell.edu/dct
First Light Images
NI Week – 2012 Aug 05
These results made use of the Discovery Channel Telescope at Lowell Observatory. Lowell is a private, non-profit institution dedicated to astrophysical research and public appreciation of astronomy and operates the DCT in partnership with Boston University, the University of Maryland and the University of Toledo.
![Page 5: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/5.jpg)
www.lowell.edu/dct
Software Team
![Page 6: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/6.jpg)
www.lowell.edu/dct
Some System Components
NI Week 2012 -- Aug 05
A note on modeling: We use the Unified Modeling Language (UML). The modeling tool we employ is Enterprise Architect (EA).
![Page 7: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/7.jpg)
www.lowell.edu/dct
System Concept
• Each system consists of a set of components that work together to achieve a larger goal.*
NI Week 2012 -- Aug 05
*Weilkiens, T., [Systems Engineering with SysML/UML: Modeling, Analysis, Design], Morgan-Kaufmann, Amsterdam, 8 (2006).
![Page 8: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/8.jpg)
www.lowell.edu/dct
Component Definitions
• Component* – Modular – Encapsulates contents – Replaceable with another implementation that satisfies
interfaces
• DCT component – Stand-alone – State-based – Interfaces: SubData, PubData
*Larman, C., [Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and Iterative Development], Pearson, Upper Saddle River, 654 (2005).
NI Week 2012 -- Aug 05
![Page 9: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/9.jpg)
www.lowell.edu/dct
Publish-Subscribe
• Publish-subscribe (Observer Pattern) – Multiple subscribers – Multiple publishers
• Flexible deployment
NI Week 2012 -- Aug 05
![Page 10: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/10.jpg)
www.lowell.edu/dct
Publish-Subscribe
NI Week 2012 -- Aug 05
![Page 11: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/11.jpg)
www.lowell.edu/dct
Motivations for Template
• Issues with independent implementation – Repetition – Inconsistency – Mistakes
• Considerations – Uniqueness – Flexibility – Embraceability
NI Week 2012 -- Aug 05
![Page 12: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/12.jpg)
www.lowell.edu/dct
Template Demonstration
NI Week 2012 -- Aug 05
![Page 13: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/13.jpg)
www.lowell.edu/dct
Template Characteristics
• Common vs. modifiable
• Best practices – Design patterns – Existing
implementations – Collaboration
• Simplicity • Completeness
NI Week 2012 -- Aug 05
![Page 14: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/14.jpg)
www.lowell.edu/dct
Template Application
• Copy • Customize
NI Week 2012 -- Aug 05
![Page 15: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/15.jpg)
www.lowell.edu/dct
Why National Instruments LabVIEW?
• Supports our Windows, RT (VxWorks), FPGA targets • Dataflow—easily specify parallel operations • Graphical programming
NI Week 2012 -- Aug 05
![Page 16: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/16.jpg)
www.lowell.edu/dct
Architecture
NI Week 2012 -- Aug 05
![Page 17: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/17.jpg)
www.lowell.edu/dct
M/V/C with D
• Model/View/Controller (M/V/C) with Data Listener
NI Week 2012 -- Aug 05
![Page 18: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/18.jpg)
www.lowell.edu/dct
Heartbeat
NI Week 2012 -- Aug 05
![Page 19: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/19.jpg)
www.lowell.edu/dct
Interfaces
• Background definitions: – Abstract class – Pure virtual method (abstract method) – Interface
• As an interface in National Instruments LabVIEW we use a class with all pure virtual methods.*
• Motivations – Source code isolation – Design by contract
NI Week 2012 -- Aug 05
A close approximation to a pure virtual method.
*Cf. Budd, T. [An Introduction to Object-Oriented Programming, 3d ed.], Addison-Wesley, Boston, 170 (2002).
![Page 20: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/20.jpg)
www.lowell.edu/dct
Design Patterns
• Proven solutions • Cataloged*
– Name – Problem – Solution – Consequences
*Gamma, E., Helm, R., Johnson, R., and Vlissides, J., [Design Patterns: Elements of Reusable Object-Oriented Software], Addison-Wesley, Boston, (1995).
NI Week 2012 -- Aug 05
![Page 21: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/21.jpg)
www.lowell.edu/dct
Command Pattern
NI Week 2012 -- Aug 05
![Page 22: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/22.jpg)
www.lowell.edu/dct
State Pattern
NI Week 2012 -- Aug 05
• Objects for States
Attend my session TS8237 at 16:45 today to learn more about the State Pattern!
![Page 23: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/23.jpg)
www.lowell.edu/dct
Adaptation of State Pattern
• Differentiate Context and Model – IContext à interface available to clients – IModel à interface available to state objects
NI Week 2012 -- Aug 05
![Page 24: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/24.jpg)
www.lowell.edu/dct
Factory Method Pattern
• Dynamic object creation • Source code isolation
NI Week 2012 -- Aug 05
![Page 25: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/25.jpg)
www.lowell.edu/dct
Using a Factory: Call Interface Method
![Page 26: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/26.jpg)
www.lowell.edu/dct
Composite View -- Demonstration
NI Week 2012 -- Aug 05
![Page 27: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/27.jpg)
www.lowell.edu/dct
Configuration Editor -- Demonstration
NI Week 2012 -- Aug 05
![Page 28: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/28.jpg)
www.lowell.edu/dct
Generic Component State Machine
NI Week 2012 -- Aug 05
![Page 29: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/29.jpg)
www.lowell.edu/dct
Component Relationships
• Hierarchical • Relationship rules
– Knowledge of child – Knowledge of parent
NI Week 2012 -- Aug 05
![Page 30: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/30.jpg)
www.lowell.edu/dct
Component Relationships
NI Week 2012 -- Aug 05
![Page 31: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/31.jpg)
www.lowell.edu/dct
Component Example Part 1
NI Week 2012 -- Aug 05
![Page 32: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/32.jpg)
www.lowell.edu/dct
Component Example Part 2
NI Week 2012 -- Aug 05
![Page 33: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/33.jpg)
www.lowell.edu/dct
Template Benefits
• Reuse • Complete, functional framework • Best practices • Flexibility • A place for everything • Consistency • Maintainability • Scalable • Working software!
NI Week 2012 -- Aug 05
![Page 34: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/34.jpg)
www.lowell.edu/dct
Features LabVIEW Needs
Critical features LabVIEW must have for competitive development of large systems • View improvements [Composite views should be the norm] • Object serialization [Serialize in interchangeable format—possible now only with per-class methods] • Integration with UML modeling tool [Round-trip connection to a model from standards-compliant, competitive UML tool]
NI Week 2012 -- Aug 05
![Page 35: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/35.jpg)
www.lowell.edu/dct
Questions
[email protected] TS8237: State Pattern Implementation for Scalable Control Systems Date: 8/7/12 Time: 16:45-17:45 Room: 12A
NI Week 2012 -- Aug 05
![Page 36: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/36.jpg)
www.lowell.edu/dct
Thank You!
TS8237: State Pattern Implementation for Scalable Control Systems Date: 8/7/12 Time: 16:45-17:45 Room: 12A
NI Week 2012 -- Aug 05
![Page 37: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/37.jpg)
www.lowell.edu/dct
Support Slides
NI Week 2012 -- Aug 05
![Page 38: TS 8245 System Components Using Design Patterns on the …download.ni.com/pub/gdc/tut/discovery_channel.pdf · 2013. 11. 13. · Design Patterns on the Discovery Channel Telescope](https://reader033.vdocuments.us/reader033/viewer/2022060520/604e0e2452710539db570649/html5/thumbnails/38.jpg)
www.lowell.edu/dct
Messaging with Objects
Data to send
Cast to parent, if necessary
(or get it that way)
Flatten to string
Unflatten from string
Original object on the wire!
Serialize Prepare data Deserialize Use data
Convert to byte array
Convert to string
(Optional: For RT-FIFO-enabled shared variable)
Favorite messaging system
Sender Receiver