You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refinable Functions focuses on function-level refinement, however implicit augmentation of method in classes is essential for implementing aspect-orientation. This idea requires 2 new mechanism of refinement.
1.Refinable Functions as a Advice
Advices is class of function that modifies other function when run. It is a certain function, method or procedure that is to be applied at a given join point of program,(wikipedia). The join point is represented in keyword like before, after and around in typical aspect-orientation, where as point cut represent point of join point composition. I propose following syntax for export Refinable Function as ann Advice
In this sense, function refinement and class refinement is performed in two phase.
2.Class-level Refinement with Aspect-oriented Programming
Aspect-oriented Programming towards localization of cross-cutting concerns using aspect object that augment a behavior of method. The aspect object itself can be inheritable, for example the following codes is aspect for ObserverProtocol.
varObserverProtocolAspect={perSubjectObservers: newWeakMap(),getObservers: function(subject){observers=this.perSubjectObservers.get(subject);if(observers==null){perSubjectObservers.put(subject,[]);}returnobservers;},addObserver: function(subject,observer){getObservers(subject).add(observer);},removeObserver: function(subject,observer){getObservers(subject).remove(observer);},//subjectChange: null,//below method implicies subject change is required field for its subaspectsubjectChange: newSelf().add(inputCheck).add(function(subject,observer){returnthis.updateObserver(subject,observer)}).export.before()};varObserverProtocol=newSelf.utils.aspect(ObserverProtocolAspect);
and by extending ObserverProtocol aspect, we can make more concrete subaspect called ColorObserver using .extends method.
//interception instead of compositionvarColorObserver={subjectChange: functionsubjectChange(subjectChange){return{setColor: subjectChange,setLine: subjectChange}},updateObserver: function(subject,observer){//type is needed//fault of dynamic type checking => static typechecking and aspect weaving make weaving reliable//type system make aspect weaving safe and deterministic//this.display("color updated")}}varColorObserver=newSelf.utils.aspect(ColorObserver);ColorObserver.extends(ObserverProtocol);//member variable manipulation, function manipulationColorObserver.compose(className);
The text was updated successfully, but these errors were encountered:
Motivation
Refinable Functions focuses on function-level refinement, however implicit augmentation of method in classes is essential for implementing aspect-orientation. This idea requires 2 new mechanism of refinement.
1.Refinable Functions as a Advice
Advices is class of function that modifies other function when run. It is a certain function, method or procedure that is to be applied at a given join point of program,(wikipedia). The join point is represented in keyword like
before
,after
andaround
in typical aspect-orientation, where as point cut represent point of join point composition. I propose following syntax for export Refinable Function as ann AdviceIn this sense, function refinement and class refinement is performed in two phase.
2.Class-level Refinement with Aspect-oriented Programming
Aspect-oriented Programming towards localization of cross-cutting concerns using aspect object that augment a behavior of method. The aspect object itself can be inheritable, for example the following codes is aspect for
ObserverProtocol
.and by extending
ObserverProtocol
aspect, we can make more concrete subaspect calledColorObserver
using.extends
method.The text was updated successfully, but these errors were encountered: