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
The template engine does not explicitly try to control which objects or methods can be accessed by template code.
This has the advantage that there is less work to do when you want to expose a new class and its methods. However it also has a downside that you may not want to allow such access. As well, the exposed classes can get pretty full of methods and thus difficult to manage.
We should look into adding some kind of interface that these classes need to implement in order to be accessible by the template engine. The interface doesn't have to have any methods, the code that searches for a method would simply check if the object's class implements that interface.
Another idea would be to require a class to be extended and have the extended class implement that interface. The template engine would then have to cast objects to the extending class before looking for the method (not sure this would even work). This could get complicated fast.
If a viable way to solve this issue could be found it could help manage access to the internal objects.
The text was updated successfully, but these errors were encountered:
The template engine does not explicitly try to control which objects or methods can be accessed by template code.
This has the advantage that there is less work to do when you want to expose a new class and its methods. However it also has a downside that you may not want to allow such access. As well, the exposed classes can get pretty full of methods and thus difficult to manage.
We should look into adding some kind of
interface
that these classes need to implement in order to be accessible by the template engine. The interface doesn't have to have any methods, the code that searches for a method would simply check if the object's class implements that interface.Another idea would be to require a class to be extended and have the extended class implement that interface. The template engine would then have to cast objects to the extending class before looking for the method (not sure this would even work). This could get complicated fast.
If a viable way to solve this issue could be found it could help manage access to the internal objects.
The text was updated successfully, but these errors were encountered: