SlideShare a Scribd company logo
1 of 18
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

Workshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionWorkshop 19: ReactJS Introduction
Workshop 19: ReactJS IntroductionVisual Engineering
 
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 midnightWiem Zine Elabidine
 
Angular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupAngular Optimization Web Performance Meetup
Angular Optimization Web Performance MeetupDavid 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 migrationManuel Bernhardt
 
Reactive Programming with JavaScript
Reactive Programming with JavaScriptReactive Programming with JavaScript
Reactive Programming with JavaScriptCodemotion
 
Intro to React | DreamLab Academy
Intro to React | DreamLab AcademyIntro to React | DreamLab Academy
Intro to React | DreamLab AcademyDreamLab
 
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 CompletableFuturesHaim Yadid
 
Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz - Angular Summit - 2016
Evan Schultz - Angular Summit - 2016Evan Schultz
 
Akka Futures and Akka Remoting
Akka Futures  and Akka RemotingAkka Futures  and Akka Remoting
Akka Futures and Akka RemotingKnoldus 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 & ReduxVisual Engineering
 
Evan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz - Angular Camp - ng2-redux
Evan Schultz - Angular Camp - ng2-reduxEvan Schultz
 
Reactive.architecture.with.Angular
Reactive.architecture.with.AngularReactive.architecture.with.Angular
Reactive.architecture.with.AngularEvan Schultz
 
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 GroupRoy Russo
 
Deep Dive into React Hooks
Deep Dive into React HooksDeep Dive into React Hooks
Deep Dive into React HooksFelix Kühl
 
React + Redux. Best practices
React + Redux.  Best practicesReact + Redux.  Best practices
React + Redux. Best practicesClickky
 

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 applicationsGabor 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.pdfStephieJohn
 
Build Widgets
Build WidgetsBuild Widgets
Build Widgetsscottw
 
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 DOMJimit Shah
 
Moo at System::Image::Update
Moo at System::Image::UpdateMoo at System::Image::Update
Moo at System::Image::UpdateJens 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, 2015Tomáš 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 TestingEswara 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
 
event-handling.pptx
event-handling.pptxevent-handling.pptx
event-handling.pptxGood657694
 
Angularjs - Unit testing introduction
Angularjs - Unit testing introductionAngularjs - Unit testing introduction
Angularjs - Unit testing introductionNir Kaufman
 
Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01Gearmanpresentation 110308165409-phpapp01
Gearmanpresentation 110308165409-phpapp01longtuan
 
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 KarmaAndrey 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

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 

Recently uploaded (20)

call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 

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/