Actor Oriented Design Patterns: Difference between revisions
Drjdpowell (talk | contribs) |
Combined information from design pattern page |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
'''Actor Oriented Design Patterns''' are software patterns that utilize the Actor Model (for example [[Actor Framework]]). Actors are a powerful tool when creating large, highly parallelized, scalable systems in LabVIEW. | '''Actor Oriented Design Patterns''' are software patterns that utilize the Actor Model (for example [[Actor Framework]]). Actors are a powerful tool when creating large, highly parallelized, scalable systems in LabVIEW. | ||
''Transition from thinking in dataflow to thinking in message flow.'' In larger applications with parallel modules in multiple threads, dataflow is insufficient to describe the interaction. Instead, think of the flow of the messages (methods plus data) exchanged between those modules. Dataflow makes sense for single processes with shorter lifetimes inside self-contained components. In large complex applications, the messaging may be such that a dedicated message broker would be needed. Dataflow will still govern the self-contained code pieces inside the components.<ref>"NI Architect Summit: Object Oriented Programming In LabVIEW" by Nate Chandler-Smith. (https://www.distek.com/blog/national-instruments-architect-summit-object-oriented-programming-labview/) | |||
</ref> | |||
== Actor Framework Designs== | == Actor Framework Designs== | ||
Line 18: | Line 21: | ||
== Other Actor Implementation Designs == | == Other Actor Implementation Designs == | ||
[[DQMH]] | ==== LabVIEW Tools Network Addons: ==== | ||
* [[Messenger Library]] | |||
* [[DQMH]] | |||
==== Some Actor implementations in other languages: ==== | |||
* [https://doc.akka.io/docs/akka/2.5/guide/introduction.html Akka] | |||
* [https://www.erlang.org/ Erlang] | |||
* [https://actor-framework.org/ C++ Actor Framework] | |||
* [https://www.pykka.org/en/latest/api/# Pykka (Python)] | |||
== Articles == | == Articles == | ||
Line 28: | Line 38: | ||
''If you are familiar with the Queued Message Handler (QMH) Design Pattern and Object-Oriented Programming (OOP) then you already know everything you need to start with Actor Framework. The purpose of this article is to show the parts of the Actor Framework that are comparable to the QMH Design Pattern and provide a step-by-step procedure for converting a QMH project to an Actor Framework project.'' | ''If you are familiar with the Queued Message Handler (QMH) Design Pattern and Object-Oriented Programming (OOP) then you already know everything you need to start with Actor Framework. The purpose of this article is to show the parts of the Actor Framework that are comparable to the QMH Design Pattern and provide a step-by-step procedure for converting a QMH project to an Actor Framework project.'' | ||
== See Also == | |||
* [[wikipedia: Actor_model| Actor_model]] | |||
== References == | == References == | ||
[[Category:Design | [[Category:Actor Oriented Design Patterns]] | ||
Latest revision as of 19:11, 3 June 2020
Actor Oriented Design Patterns are software patterns that utilize the Actor Model (for example Actor Framework). Actors are a powerful tool when creating large, highly parallelized, scalable systems in LabVIEW.
Transition from thinking in dataflow to thinking in message flow. In larger applications with parallel modules in multiple threads, dataflow is insufficient to describe the interaction. Instead, think of the flow of the messages (methods plus data) exchanged between those modules. Dataflow makes sense for single processes with shorter lifetimes inside self-contained components. In large complex applications, the messaging may be such that a dedicated message broker would be needed. Dataflow will still govern the self-contained code pieces inside the components.[1]
Actor Framework Designs
The Actor Framework is a powerful tool there are many aspects to how it can be implemented. Below are three Actor Oriented Design Patterns implemented with the Actor Framework. These resemble their non Object-Oriented counterparts, see Design Patterns, where these are an implementation of a single actor. There real power lies in multiple Actors working together. These patterns are:
- State Machine Actor
- Queued State Machine Actor
- Queued Message Handler Actor
State Machine Actor
The State Machine Actor (SMA) is completely implemented in Messages, it does not override the Actor Core. It sends the first Message on Pre Launch Init Method. Each subsequent Message sends the next Message in the state.
Because it doesn't override the Actor Core the pattern does not have a UI of its own. It could be paired with another Actor that implements the UI and sends Messages to it to update UI elements. The paired Actor would follow one of the other patterns. See more about the State Machine Actor (SMA) Design Pattern.
Queued State Machine Actor
More to come.
Queued Message Handler Actor
More to come
Other Actor Implementation Designs
LabVIEW Tools Network Addons:
Some Actor implementations in other languages:
Articles
"Actor Framework is not as hard as you think and here is why…" - by Quentin "Q" Alldredge, Q Software Innovations, LLC
If you are familiar with the Queued Message Handler (QMH) Design Pattern and Object-Oriented Programming (OOP) then you already know everything you need to start with Actor Framework. The purpose of this article is to show the parts of the Actor Framework that are comparable to the QMH Design Pattern and provide a step-by-step procedure for converting a QMH project to an Actor Framework project.
See Also
References
- ↑ "NI Architect Summit: Object Oriented Programming In LabVIEW" by Nate Chandler-Smith. (https://www.distek.com/blog/national-instruments-architect-summit-object-oriented-programming-labview/)