1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D...

25
1

Transcript of 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D...

Page 1: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

1

Page 2: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

2

Introduction to the Actor Framework

Stephen R. MercerSenior Software EngineerLabVIEW R&D

Allen C. SmithSenior Systems EngineerSystems Engineering

Page 3: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

3

Agenda

• What Actor Framework Replaces• How AF Minimizes Code Replication• How AF Standardizes Module Communication• Getting started with Actor Framework• Where to Learn More

Page 4: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

4

Queue-Driven State Machine

Page 5: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

5

Larger Systems

Page 6: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

6

Three Sources of Code Replication

1. Override the handling of one message2. Extend the set of handled messages3. Decorate the machine with additional behavior

Override

Extend

Decorate

Page 7: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

7

Source 1: Override

Speed

Direction

ToggleOn

Speed

Direction

Toggle/Notify

Page 8: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

8

Cluster and Node...

Page 9: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

9

… become Class and Method

Page 10: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

10

… become Class and Method

Page 11: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

11

Source 2: Extend

Speed

Direction

Speed

E-Stop

ToggleOn

ToggleOn

Direction

Page 12: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

12

Message and Case Structure…

Page 13: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

13

… become Class and Dynamic Dispatch

Page 14: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

15

Source 3: Decorate

Page 15: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

16

New Class: Actor.lvclass

Page 16: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

17

Using the Parent

Page 17: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

18

Fan UI.lvclass:Actor Core.viUsing the Child

Page 18: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

19

Standardizing Communication:Launch Actor.vi

Page 19: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

21

Demonstration

• Making an Actor…• Making a Message…

Page 20: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

24

For Best Results

• Announcement messages, not request messages• No message should get or set the entire actor• Embrace peer-to-peer messaging• Actors may register as listeners for other Actors• Synchronous messages can be created at your risk

Real-world applications demonstrate scalability

Page 21: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

25

Watch Tomorrow’s Keynote…

When you see this, you’re seeing the Actor Framework in action!

Page 22: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

32

Recap• Extensible along three axes without replication:

Override Extend Decorate

• Messages have strict type and direction• Standard for highly scalable communications• Reduced the risk associated with by-reference

architectures in a dataflow environment

Page 23: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

33

Download the Actor Framework

• QUESTIONS?

Page 24: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

34

Other Object-Oriented Sessions• Tuesday

2:15 Intro to OOP 3:30 Trends in LabVIEW OOP 4:45 Hands-On: Intro to OO Design Patterns in LV

• Wednesday 1:00 Hands-On: Intro to OO Design Patterns in LV

• Thursday 1:00 Building Plug-in Architectures and HALs

Page 25: 1. 2 Introduction to the Actor Framework Stephen R. Mercer Senior Software Engineer LabVIEW R&D Allen C. Smith Senior Systems Engineer Systems Engineering.

35

Alliance Partner Network 20th Anniversary Celebration

Join us for an evening of drinks, music, networking, and a celebratory toast by Dr. James Truchard at

5:30 p.m. in the exhibition hall.