SlideShare a Scribd company logo
Weave 
Grouped & Immediate 
Callback 
Architecture
AVM2 
Virtual Machine 
ABC file 
(compiled programs – 
Constant data, 
instructions from AVM2 instruction set 
And metadata) 
VM is a mechanism that takes as its input description of a computation
AVM2 - $cinit – Class Initializer 
• $cinit is the method that is called before any use of the class is required. 
• It initializes all static members and runs any code that is in the static initializer 
• Then the $cinit method would run before the class was ever used or even made reference to, 
• and it would initialize the memory for SOME_STATIC_VAR and set its value to 4. 
AVM2 - $init – class instance Initializer 
• $init is the classes instance initializer. It's basically the classes constructor. For example
1. Event.ENTER_FRAME dispatched 
2. Event.FRAME_CONSTRUCTED dispatched 
3. Event.EXIT_FRAME dispatched 
4. Event.RENDER dispatched 
Loop 1 Loop 2 
ENTER_FRAME 
ENTER_FRAME
Static Keyword 
• With the help of $cinit method , 
• static variables and functions are initialized 
globally and 
• they are accessible for entire project by calling 
their Class (not instance) .
addimediateCallback 
Creates new callBackEntry Object and set its callback property to programmer 
defined function, which is required to execute when there is a state change in the 
object (ILinkableObject) 
addGroupedCallback 
• Creates new callBackEntry object (triggerEntry) and to its callback property a new 
inline function, which wraps the programmer defined function is set. 
• callBackEntry object (triggerEntry) is then added to global memory (static) with 
key as programmer defined function 
• And then through addImmediateCallback callBackEntry object (triggerEntry) is 
added to local memory, instead of original function
addimediateCallback 
Creates new callBackEntry Object and set its callback property 
to programmer defined function, which is required to execute 
when there is a state change in the object (ILinkableObject 
“Store locally”
addGroupedCallback 
• It creates new callBackEntry object (triggerEntry) and to its callback 
sets a new inline function, which wraps the programmer defined 
function. 
• callBackEntry object (triggerEntry) is then added to global memory 
(static) with programmer defined function being key to access 
callBackEntry object (triggerEntry) . 
• And then through addImmediateCallback callBackEntry object 
(triggerEntry) is added to local memory), instead of original 
function 
“Wrap it and store the trigger Locally to a 
programmer defined function globally ”
inlineFunction 
A function can be executed in 
two ways by adding flag 
• inline function – (triggerEntry.callback) gets called first time, from local memory due to stateChange, 
1. It execute second set of instructions, 
2. adds the triggerEntry to global Queue (Static) 
3. Note: original function is not executed 
• Wrapper function gets called second time, from global memory due to ENTER_FRAME event. 
1. It execute first set of instructions this time, 
2. Original function gets executed 
“Add to global queue when called from local Memory 
Executes original function when called from Global queue”
1. Event.ENTER_FRAME dispatched 
2. Event.FRAME_CONSTRUCTED dispatched 
3. Event.EXIT_FRAME dispatched 
4. Event.RENDER dispatched 
Loop 1 Loop 2 
ENTER_FRAME 
ENTER_FRAME 
Callback added through 
addImmediateCallback 
executed 
Wrapper function 
added through 
addGroupedCallback 
executed, which in 
turn executes 
Original Function 
Wrapper function 
added through 
addGroupedCallback 
Executed to add them 
to global Queue
registerLinkableChild / newLinkableChild 
• Along with the callback function mentioned by the 
Programmer, registered parent’s trigger Callback function 
is also added through addImmediateCallback. 
• So though you add one function, two functions are added 
automatically. 
• So any change in LinkableString value will execute two 
sets of functions 
• One Programmer Defined Functions 
• Second linkableString’s registered parent 
triggercallback method
How state change Works? 
“Change in linkbaleObject caused by user , 
should also automate change in 
the IlinkbaleObject’s registered parent.” 
• When user changes the value of IlinkableObject, 
• Programmer defined callback functions executes first 
• Then registered parent trigger callback is called 
• Which in turn calls parents callback Functions 
• If parent has callback function added through grouped callback, they are 
called in next cycle
Global Memory 
(through Static Declaration in CallbackCollection) 
Global 
Queue
Callback execution Frames 
• Functions added through immediateCallback, are executed in same frame where 
state change occurred. 
• Functions added through grouppedCallback are executed in nextFrame in user 
Code Section of Player Events , as groupedcallbacks are execute in ENTER_FRAME 
Listener. 
• If groupedCallback function , makes a state change to IlinkableObject , and if that 
object has callback added though groupedcallback, they too will execute in same 
frame not next frame, in user Code Section of Player Events
panelWidth.addImmediateCallback(this, updatePanelTitle); 
panelWidth.addgroupedCallBackCallback(this, updatePanel); 
panelX.addgroupedCallBackCallback(this, updatePanelPosition); 
Frame 1 Frame 2 Frame 3 
Title = “Hi” 
panelX.value = 79; 
panelWidth.value = 100 
updatePanelTitle 
triggerEntry.callBack updatePanel 
updatePanelPosition
Class1 implements ILinkableObject 
• property1: LinkableBoolean = newLinkableChild (this, LinkableBoolean) 
• property2: LinkableNumber = newLinkableChild (this, LinkableNumber) 
• property3: LinkableString = newLinkableChild (this, LinkableString ) 
Object1 = newLinkableChild (this, Class1) 
• Object1.addImmediateCallBack( this, function-1); 
• Object1.addGroupedCallback( this, function-2) 
• Object1.property1.value = true; ----- function-1 Executed 
• Object1.property2.value = 100; ----- function-1 Executed 
• Object1.property3.value = “hi”; ----- function-1 Executed 
----- function-2 Executed 
Frame 1 
Frame 2 
“Object-1 stage changed three times, function1 added 
through immediate callback was called three times, 
function 2 added through grouped callback was called 
only once”
Quiz 
• If we create a scatterplot tool in updatePanel method , which is called due to 
enterframe Listener, and then we access the child say checkbox in 
updatePanelPos, which is also added through groupedcallback, will the 
checkbox is available to access ? 
• Answer - No. As both code execute in same frame , and scatterplot tool in not 
ready for access yet . scatterplot tool haven’t completed its lifeCycle yet. 
SactterplotTool components are ready for access only in next frame
Frame 2 Frame 2 
triggerEntry.callback() = function():void{ 
If (_runningGroupedCallbacksNow){ 
//execute – user Func 
} 
else{ 
// call in next frame 
} 
}; 
runningGroupedCallbacksNow = true 
Frame 1 
runningGroupedCallbacksNow = false

More Related Content

What's hot

React hooks
React hooksReact hooks
React hooks
Assaf Gannon
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
Visual Engineering
 
Akka and futures
Akka and futuresAkka and futures
Akka and futures
Knoldus Inc.
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
Wiem Zine Elabidine
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
David Barreto
 
Back to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationBack to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migration
Manuel Bernhardt
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
Codemotion
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab Academy
DreamLab
 
The Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesThe Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFutures
Haim Yadid
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
Evan Schultz
 
Akka Futures and Akka Remoting
Akka Futures  and Akka RemotingAkka Futures  and Akka Remoting
Akka Futures and Akka Remoting
Knoldus Inc.
 
Workshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & ReduxWorkshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & Redux
Visual Engineering
 
Completable future
Completable futureCompletable future
Completable future
Srinivasan Raghvan
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
Christoffer Noring
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz
 
Reactive.architecture.with.Angular
Reactive.architecture.with.AngularReactive.architecture.with.Angular
Reactive.architecture.with.Angular
Evan Schultz
 
Erlang/OTP in Riak
Erlang/OTP in RiakErlang/OTP in Riak
Erlang/OTP in Riak
Sargun Dhillon
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
Roy Russo
 
Deep Dive into React Hooks
Deep Dive into React HooksDeep Dive into React Hooks
Deep Dive into React Hooks
Felix Kühl
 
React + Redux. Best practices
React + Redux.  Best practicesReact + Redux.  Best practices
React + Redux. Best practices
Clickky
 

What's hot (20)

React hooks
React hooksReact hooks
React hooks
 
Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS Introduction
 
Akka and futures
Akka and futuresAkka and futures
Akka and futures
 
Flying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnightFlying Futures at the same sky can make the sun rise at midnight
Flying Futures at the same sky can make the sun rise at midnight
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance Meetup
 
Back to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migrationBack to the futures, actors and pipes: using Akka for large-scale data migration
Back to the futures, actors and pipes: using Akka for large-scale data migration
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScript
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab Academy
 
The Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFuturesThe Future of Futures - A Talk About Java 8 CompletableFutures
The Future of Futures - A Talk About Java 8 CompletableFutures
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016
 
Akka Futures and Akka Remoting
Akka Futures  and Akka RemotingAkka Futures  and Akka Remoting
Akka Futures and Akka Remoting
 
Workshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & ReduxWorkshop 20: ReactJS Part II Flux Pattern & Redux
Workshop 20: ReactJS Part II Flux Pattern & Redux
 
Completable future
Completable futureCompletable future
Completable future
 
Typescript barcelona
Typescript barcelonaTypescript barcelona
Typescript barcelona
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-redux
 
Reactive.architecture.with.Angular
Reactive.architecture.with.AngularReactive.architecture.with.Angular
Reactive.architecture.with.Angular
 
Erlang/OTP in Riak
Erlang/OTP in RiakErlang/OTP in Riak
Erlang/OTP in Riak
 
Introduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users GroupIntroduction to Akka - Atlanta Java Users Group
Introduction to Akka - Atlanta Java Users Group
 
Deep Dive into React Hooks
Deep Dive into React HooksDeep Dive into React Hooks
Deep Dive into React Hooks
 
React + Redux. Best practices
React + Redux.  Best practicesReact + Redux.  Best practices
React + Redux. Best practices
 

Similar to Weave - Grouped and Immediate Callback [Architecture]

State management in android applications
State management in android applicationsState management in android applications
State management in android applications
Gabor Varadi
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
StephieJohn
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgets
scottw
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
Jimit Shah
 
React Native Firebase
React Native FirebaseReact Native Firebase
React Native Firebase
Kobkrit Viriyayudhakorn
 
Group111
Group111Group111
Easy mock
Easy mockEasy mock
Easy mock
Srikrishna k
 
Moo at System::Image::Update
Moo at System::Image::UpdateMoo at System::Image::Update
Moo at System::Image::Update
Jens Rehsack
 
Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015
Tomáš Kypta
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
Eswara Kumar Palakollu
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
Yan Yankowski
 
Easy mockppt
Easy mockpptEasy mockppt
Easy mockppt
subha chandra
 
Java 102
Java 102Java 102
Java 102
Manuela Grindei
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
Good657694
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
Nir Kaufman
 
Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
longtuan
 
2.0 Stacks.pptx
2.0 Stacks.pptx2.0 Stacks.pptx
2.0 Stacks.pptx
MuhammadShajid1
 
Easy mock
Easy mockEasy mock
Easy mock
Ramakrishna kapa
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
Bhushan Mulmule
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
Andrey Kolodnitsky
 

Similar to Weave - Grouped and Immediate Callback [Architecture] (20)

State management in android applications
State management in android applicationsState management in android applications
State management in android applications
 
Fundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdfFundamental Concepts of React JS for Beginners.pdf
Fundamental Concepts of React JS for Beginners.pdf
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgets
 
React.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
 
React Native Firebase
React Native FirebaseReact Native Firebase
React Native Firebase
 
Group111
Group111Group111
Group111
 
Easy mock
Easy mockEasy mock
Easy mock
 
Moo at System::Image::Update
Moo at System::Image::UpdateMoo at System::Image::Update
Moo at System::Image::Update
 
Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015Android Develpment vol. 2, MFF UK, 2015
Android Develpment vol. 2, MFF UK, 2015
 
React and Flux life cycle with JSX, React Router and Jest Unit Testing
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
 
AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.AngularJs $provide API internals & circular dependency problem.
AngularJs $provide API internals & circular dependency problem.
 
Easy mockppt
Easy mockpptEasy mockppt
Easy mockppt
 
Java 102
Java 102Java 102
Java 102
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptx
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introduction
 
Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01
 
2.0 Stacks.pptx
2.0 Stacks.pptx2.0 Stacks.pptx
2.0 Stacks.pptx
 
Easy mock
Easy mockEasy mock
Easy mock
 
Classes and objects
Classes and objectsClasses and objects
Classes and objects
 
Unit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and KarmaUnit testing in JavaScript with Jasmine and Karma
Unit testing in JavaScript with Jasmine and Karma
 

Recently uploaded

Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
nitinpv4ai
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
National Information Standards Organization (NISO)
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
Iris Thiele Isip-Tan
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
RidwanHassanYusuf
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
Steve Thomason
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
heathfieldcps1
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
JomonJoseph58
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
PsychoTech Services
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
Nguyen Thanh Tu Collection
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
ImMuslim
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
Nguyen Thanh Tu Collection
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
nitinpv4ai
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
zuzanka
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
IsmaelVazquez38
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
blueshagoo1
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
Prof. Dr. K. Adisesha
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Henry Hollis
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
zuzanka
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
سمير بسيوني
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
RamseyBerglund
 

Recently uploaded (20)

Skimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S EliotSkimbleshanks-The-Railway-Cat by T S Eliot
Skimbleshanks-The-Railway-Cat by T S Eliot
 
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
Jemison, MacLaughlin, and Majumder "Broadening Pathways for Editors and Authors"
 
Educational Technology in the Health Sciences
Educational Technology in the Health SciencesEducational Technology in the Health Sciences
Educational Technology in the Health Sciences
 
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptxBIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
BIOLOGY NATIONAL EXAMINATION COUNCIL (NECO) 2024 PRACTICAL MANUAL.pptx
 
A Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two HeartsA Visual Guide to 1 Samuel | A Tale of Two Hearts
A Visual Guide to 1 Samuel | A Tale of Two Hearts
 
The basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptxThe basics of sentences session 7pptx.pptx
The basics of sentences session 7pptx.pptx
 
Stack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 MicroprocessorStack Memory Organization of 8086 Microprocessor
Stack Memory Organization of 8086 Microprocessor
 
Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...Gender and Mental Health - Counselling and Family Therapy Applications and In...
Gender and Mental Health - Counselling and Family Therapy Applications and In...
 
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
BÀI TẬP BỔ TRỢ TIẾNG ANH LỚP 9 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2024-2025 - ...
 
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
Geography as a Discipline Chapter 1 __ Class 11 Geography NCERT _ Class Notes...
 
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
BÀI TẬP DẠY THÊM TIẾNG ANH LỚP 7 CẢ NĂM FRIENDS PLUS SÁCH CHÂN TRỜI SÁNG TẠO ...
 
Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)Oliver Asks for More by Charles Dickens (9)
Oliver Asks for More by Charles Dickens (9)
 
SWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptxSWOT analysis in the project Keeping the Memory @live.pptx
SWOT analysis in the project Keeping the Memory @live.pptx
 
Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.Bossa N’ Roll Records by Ismael Vazquez.
Bossa N’ Roll Records by Ismael Vazquez.
 
CIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdfCIS 4200-02 Group 1 Final Project Report (1).pdf
CIS 4200-02 Group 1 Final Project Report (1).pdf
 
Data Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsxData Structure using C by Dr. K Adisesha .ppsx
Data Structure using C by Dr. K Adisesha .ppsx
 
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.pptLevel 3 NCEA - NZ: A  Nation In the Making 1872 - 1900 SML.ppt
Level 3 NCEA - NZ: A Nation In the Making 1872 - 1900 SML.ppt
 
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptxRESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
RESULTS OF THE EVALUATION QUESTIONNAIRE.pptx
 
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdfمصحف القراءات العشر   أعد أحرف الخلاف سمير بسيوني.pdf
مصحف القراءات العشر أعد أحرف الخلاف سمير بسيوني.pdf
 
Electric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger HuntElectric Fetus - Record Store Scavenger Hunt
Electric Fetus - Record Store Scavenger Hunt
 

Weave - Grouped and Immediate Callback [Architecture]

  • 1. Weave Grouped & Immediate Callback Architecture
  • 2. AVM2 Virtual Machine ABC file (compiled programs – Constant data, instructions from AVM2 instruction set And metadata) VM is a mechanism that takes as its input description of a computation
  • 3. AVM2 - $cinit – Class Initializer • $cinit is the method that is called before any use of the class is required. • It initializes all static members and runs any code that is in the static initializer • Then the $cinit method would run before the class was ever used or even made reference to, • and it would initialize the memory for SOME_STATIC_VAR and set its value to 4. AVM2 - $init – class instance Initializer • $init is the classes instance initializer. It's basically the classes constructor. For example
  • 4. 1. Event.ENTER_FRAME dispatched 2. Event.FRAME_CONSTRUCTED dispatched 3. Event.EXIT_FRAME dispatched 4. Event.RENDER dispatched Loop 1 Loop 2 ENTER_FRAME ENTER_FRAME
  • 5. Static Keyword • With the help of $cinit method , • static variables and functions are initialized globally and • they are accessible for entire project by calling their Class (not instance) .
  • 6. addimediateCallback Creates new callBackEntry Object and set its callback property to programmer defined function, which is required to execute when there is a state change in the object (ILinkableObject) addGroupedCallback • Creates new callBackEntry object (triggerEntry) and to its callback property a new inline function, which wraps the programmer defined function is set. • callBackEntry object (triggerEntry) is then added to global memory (static) with key as programmer defined function • And then through addImmediateCallback callBackEntry object (triggerEntry) is added to local memory, instead of original function
  • 7. addimediateCallback Creates new callBackEntry Object and set its callback property to programmer defined function, which is required to execute when there is a state change in the object (ILinkableObject “Store locally”
  • 8. addGroupedCallback • It creates new callBackEntry object (triggerEntry) and to its callback sets a new inline function, which wraps the programmer defined function. • callBackEntry object (triggerEntry) is then added to global memory (static) with programmer defined function being key to access callBackEntry object (triggerEntry) . • And then through addImmediateCallback callBackEntry object (triggerEntry) is added to local memory), instead of original function “Wrap it and store the trigger Locally to a programmer defined function globally ”
  • 9. inlineFunction A function can be executed in two ways by adding flag • inline function – (triggerEntry.callback) gets called first time, from local memory due to stateChange, 1. It execute second set of instructions, 2. adds the triggerEntry to global Queue (Static) 3. Note: original function is not executed • Wrapper function gets called second time, from global memory due to ENTER_FRAME event. 1. It execute first set of instructions this time, 2. Original function gets executed “Add to global queue when called from local Memory Executes original function when called from Global queue”
  • 10. 1. Event.ENTER_FRAME dispatched 2. Event.FRAME_CONSTRUCTED dispatched 3. Event.EXIT_FRAME dispatched 4. Event.RENDER dispatched Loop 1 Loop 2 ENTER_FRAME ENTER_FRAME Callback added through addImmediateCallback executed Wrapper function added through addGroupedCallback executed, which in turn executes Original Function Wrapper function added through addGroupedCallback Executed to add them to global Queue
  • 11. registerLinkableChild / newLinkableChild • Along with the callback function mentioned by the Programmer, registered parent’s trigger Callback function is also added through addImmediateCallback. • So though you add one function, two functions are added automatically. • So any change in LinkableString value will execute two sets of functions • One Programmer Defined Functions • Second linkableString’s registered parent triggercallback method
  • 12. How state change Works? “Change in linkbaleObject caused by user , should also automate change in the IlinkbaleObject’s registered parent.” • When user changes the value of IlinkableObject, • Programmer defined callback functions executes first • Then registered parent trigger callback is called • Which in turn calls parents callback Functions • If parent has callback function added through grouped callback, they are called in next cycle
  • 13. Global Memory (through Static Declaration in CallbackCollection) Global Queue
  • 14. Callback execution Frames • Functions added through immediateCallback, are executed in same frame where state change occurred. • Functions added through grouppedCallback are executed in nextFrame in user Code Section of Player Events , as groupedcallbacks are execute in ENTER_FRAME Listener. • If groupedCallback function , makes a state change to IlinkableObject , and if that object has callback added though groupedcallback, they too will execute in same frame not next frame, in user Code Section of Player Events
  • 15. panelWidth.addImmediateCallback(this, updatePanelTitle); panelWidth.addgroupedCallBackCallback(this, updatePanel); panelX.addgroupedCallBackCallback(this, updatePanelPosition); Frame 1 Frame 2 Frame 3 Title = “Hi” panelX.value = 79; panelWidth.value = 100 updatePanelTitle triggerEntry.callBack updatePanel updatePanelPosition
  • 16. Class1 implements ILinkableObject • property1: LinkableBoolean = newLinkableChild (this, LinkableBoolean) • property2: LinkableNumber = newLinkableChild (this, LinkableNumber) • property3: LinkableString = newLinkableChild (this, LinkableString ) Object1 = newLinkableChild (this, Class1) • Object1.addImmediateCallBack( this, function-1); • Object1.addGroupedCallback( this, function-2) • Object1.property1.value = true; ----- function-1 Executed • Object1.property2.value = 100; ----- function-1 Executed • Object1.property3.value = “hi”; ----- function-1 Executed ----- function-2 Executed Frame 1 Frame 2 “Object-1 stage changed three times, function1 added through immediate callback was called three times, function 2 added through grouped callback was called only once”
  • 17. Quiz • If we create a scatterplot tool in updatePanel method , which is called due to enterframe Listener, and then we access the child say checkbox in updatePanelPos, which is also added through groupedcallback, will the checkbox is available to access ? • Answer - No. As both code execute in same frame , and scatterplot tool in not ready for access yet . scatterplot tool haven’t completed its lifeCycle yet. SactterplotTool components are ready for access only in next frame
  • 18. Frame 2 Frame 2 triggerEntry.callback() = function():void{ If (_runningGroupedCallbacksNow){ //execute – user Func } else{ // call in next frame } }; runningGroupedCallbacksNow = true Frame 1 runningGroupedCallbacksNow = false

Editor's Notes

  1. http://stackoverflow.com/questions/2240502/what-are-cinit-and-init-in-avm2
  2. http://blog.johannest.com/2009/06/15/the-movieclip-life-cycle-revisited-from-event-added-to-event-removed_from_stage/ http://www.senocular.com/flash/tutorials/orderofoperations/
  3. http://blog.johannest.com/2009/06/15/the-movieclip-life-cycle-revisited-from-event-added-to-event-removed_from_stage/ http://www.senocular.com/flash/tutorials/orderofoperations/