The meta of Meta-object Architectures

1,098 views

Published on

Behavioral reflection is crucial to support for example functional upgrades, on-the-fly debugging, or monitoring critical applications. However the use of reflective features can lead to severe problems due to infinite metacall recursion even in simple cases. This is especially a problem when reflecting on core language features since there is a high chance that such features are used to implement the reflective behavior itself. In this paper we analyze the problem of infinite meta-object call recursion and solve it by providing a first class representation of meta-level execution: at any point in the execution of a system it can be determined if we are operating on a meta-level or base level so that we can prevent infinite recursion. We present how meta-level execution can be represented by a meta-context and how reflection becomes context-aware. Our solution makes it possible to freely apply behavioral reflection even on system classes: the meta-context brings stability to behavioral reflection. We validate the concept with a robust implementation and we present benchmarks.

Slides from presentation at TOOLS 2008 Zuerich, 30.06.2008

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,098
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
15
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

The meta of Meta-object Architectures

  1. 1. The Meta in Meta-Object Architectures Marcus Denker, University of Bern Mathieu Suen, INRIA Stéphane Ducasse, INRIA © Marcus Denker
  2. 2. Partial Behavioral Reflection meta-object links activation condition source code (AST) Tanter, OOPSLA 2003 © Marcus Denker 2
  3. 3. Partial Behavioral Reflection meta-object links activation condition source code (AST) David Röthlisberger, Marcus Denker and Éric Tanter: Dynamic Unanticipated Partial Behavioral Reflection: (Smalltalk) Adapting Applications at Runtime Journal of Computer Languages, Systems and Structures, vol. 34, no. 2-3, July 2008, pp. 46-65. © Marcus Denker 3
  4. 4. Partial Behavioral Reflection meta-object links activation condition source code (AST) AST Marcus Denker, Stéphane Ducasse, Adrian Lienhard Philippe Marschall: Sub-Method Reflection Journal of Object Technology, vol. 6, no. 9, © Marcus Denker 4
  5. 5. Behavioral Reflection: Flexible meta-object links activation condition source code (AST) > Very Flexible © Marcus Denker 5
  6. 6. Behavioral Reflection: CLOS meta-object links activation condition source code (AST) > Meta-class MOP (CLOS) © Marcus Denker 6
  7. 7. Behavioral Reflection: AOP meta-object links activation condition source code (AST) > Aspects © Marcus Denker 7
  8. 8. Behavioral Reflection: Tracer tracer metaobject link source code (AST) > Tracer © Marcus Denker 8
  9. 9. Problem: Recursion > Behavioral reflection cannot be applied to the whole system — System classes — Meta-objects © Marcus Denker 9
  10. 10. Example: Beeper > Call the Beeper from OrderedCollection>>#add beepLink := Link new metaObject: Beeper. beepLink selector: #beep. (OrderedCollection>>#add:) methodNode link: beepLink. © Marcus Denker 10
  11. 11. Meta-object Call Recursion Base Level Meta Object Meta Object #add: send #beep send #add: send #beep send #add: send Infinite recursion © Marcus Denker 11
  12. 12. Ad-hoc Solutions > Code duplication > Adding special tests © Marcus Denker 12
  13. 13. Tower of Interpreters > Smith, 1982 © Marcus Denker 13
  14. 14. The Real Problem Representing Meta-Level Execution © Marcus Denker 14
  15. 15. The Meta-Context Base Level Meta Level MetaContext activation > Link enables MetaContext MetaContext deactivation © Marcus Denker 15
  16. 16. Context-aware Links Base Level Meta Level Stop meta-level call > Disable call when already on the meta-level © Marcus Denker 16
  17. 17. MetaContext > Recursion problem solved meta-object meta links level 0 operation base © Marcus Denker 17
  18. 18. MetaContext metameta- object meta-2 link level 1 meta-object > Meta-level analysis: meta — Trace the tracer links level 0 operation base © Marcus Denker 18
  19. 19. Future Work > Generalize context model: — Beyond the meta-context > Virtual machine support > Context-aware language kernel © Marcus Denker 19
  20. 20. Conclusion > Recursion problem > Missing representation of meta-level execution > Meta-context — Solves the recursion problem — Enables meta-level analysis © Marcus Denker 20
  21. 21. Conclusion > Recursion problem > Missing representation of meta-level execution > Meta-context — Solves the recursion problem — Enables meta-level analysis Questions? © Marcus Denker 21

×