User Tools

Site Tools


runtime-adaptation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
runtime-adaptation [2018/08/18 13:25]
barryfp
runtime-adaptation [2019/07/24 13:19] (current)
barryfp
Line 14: Line 14:
 The ''​adaptRequiredInterface''​ function is used to adapt required interfaces. It re-wires a component'​s required interface from its current connection to a given component to instead point to the provided interface of a different component. All object instances sourced via that required interface are immediately adapted to the new implementation from the new provided interface. This is the most common kind of adaptation. The ''​adaptRequiredInterface''​ function is used to adapt required interfaces. It re-wires a component'​s required interface from its current connection to a given component to instead point to the provided interface of a different component. All object instances sourced via that required interface are immediately adapted to the new implementation from the new provided interface. This is the most common kind of adaptation.
  
-The ''​adaptObject''​ function is used to adapt one specific object to a different implementation. This function should only be used with dynamically created objects (i.e. using ''​new MyObject() from c :< MyObject''​)+The ''​adaptObject''​ function is used to adapt one specific object to a different implementation. This function should only be used with dynamically created objects (i.e. using ''​new MyObject() from c''​)
  
 ====== Adaptation example ====== ====== Adaptation example ======
Line 86: Line 86:
  
  //bind our required interface to its initial configuration  //bind our required interface to its initial configuration
- dana.rewire(myComponent :> "​Counter",​ variantA ​:< "​Counter"​)+ myComponent.wire("​Counter",​ variantA"​Counter"​)
  
  Core myObject = new Core() from myComponent  Core myObject = new Core() from myComponent
runtime-adaptation.txt ยท Last modified: 2019/07/24 13:19 by barryfp