Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ad-hoc Runtime Object Structure Visualizations with MetaLinks

348 views

Published on

ESUG 2017 - IWST 2017

Published in: Software
  • Be the first to comment

Ad-hoc Runtime Object Structure Visualizations with MetaLinks

  1. 1. AD-HOC RUNTIME OBJECT STRUCTURE VISUALIZATIONS WITH METALINKS Peter Uhnak     Robert Pergl Department of So ware Engineering Faculty of Information Technology Czech Technical University in Prague Czech Republic {uhnakpet|perglr}@fit.cvut.cz
  2. 2. INSTANCE VISUALIZATIONS Peter Uhnak     Robert Pergl Department of So ware Engineering Faculty of Information Technology Czech Technical University in Prague Czech Republic {uhnakpet|perglr}@fit.cvut.cz
  3. 3. How do we look at the run-time structure of objects?
  4. 4. MAIN MOTIVATION understanding Spec interpreter (Spec UI construction)
  5. 5. INPUT ui := DynamicComposableModel new. ui instantiateModels: #(btn ButtonModel). ui btn label: 'Button'. layout := SpecLayout composed newRow: [ :row | row add: #btn ]; yourself. ui openWithSpecLayout: layout. ButtonModel class>>#defaultSpec <spec> ^ #(ButtonAdapter adapt: #(model))
  6. 6. OUTPUT What is it composed from at run-time? How was it build?
  7. 7. Spec / Adapter / Morphic composition Spec Adapter MorphicAdapter Morphic ComposableModel AbstractAdapter AbstractMorphicAdapter Morph model widget widgetmodel
  8. 8. Spec / Adapter / Morphic composition ComposableModel spec SpecWrapper selector instance AbstractAdapter AbstractMorphicAdapter MorphicContainerAdapterMorph spec /subwidgets instance model model widget model
  9. 9. Digging through the Instances
  10. 10. We need to: 1. Represent the instances 2. Remember history / changes
  11. 11. UML INSTANCE METAMODEL
  12. 12. CUSTOM INSTANCE METAMODEL
  13. 13. InstanceSpecification Domain Object representation Classifier Class of a Domain Object Slot Run-time attribute value ImmutableObject Frozen value not affected by further changes in the Domain object
  14. 14. FROM INSTANCES TO INSTANCE SPECIFICATIONS
  15. 15. CAPTURING INSTANCE INFORMATION
  16. 16. CAPTURING INSTANCE INFORMATION What is the target object? Class(ifier) specification What information should be captured? Declarative Slot description How the information should be captured? Behavior (MetaLink) insertions
  17. 17. BACK TO SPEC
  18. 18. ComposableModel focusOrder owner window extentHolder needRebuild additionalKeyBindings announcer keyStrokesForNextFocusHolder keyStrokesForPreviousFocusHolder windowIcon aboutText askOkToClose titleHolder specSelectors whenBuiltDo: ensureMorphicAdapter removeMenuKeyCombination: eventKeyStrokesForNextFocus initialize windowIcon: updateTitle newCheckBox centerWidget: newText openDialogWithSpecLayout: askOkToClose: owner: newButton focusOrder: newList addAll:withSpec: spec aboutText: heightToDisplayInTree: heightToDisplayInList: initialExtent openDialogWithSpec defaultSpecSelector centered openExternalWindowWithSpecLayout: initializeDialogWindow: resolveSymbol: openExternalWindowWithSpec: takeKeyboardFocus spec: privateAdapterFromModel:withSpec: gtInspectorModelNestingIn: okToChange buildWithSpec: windowIcon initializePresenter extent openWithSpec: defaultWindowModelClass show ensureExtentFor: handlesKeyboard: isDisplayed focusOrder setExtentAndBindingTo: newTabManager defaultSpec bindKeyCombination:toAction: announce: bindMenuKeyCombination:toAction: registerKeyStrokesForNextFor: ensureMorphicAdapterDo: keyStrokesForPreviousFocus: announcer private_buildWithSpec: widthToDisplayInList: newDropList initializeWidgets icon: on:do: needRebuild cancelled newTextInput delete private_buildWithSpec centeredRelativeTo: openWithSpecLayout: newTree window openExternalWindowWithSpec owner aboutText buildWithSpec newSlider hasWindow on:send:to: removeKeyCombination: widthToDisplayInTree: instantiate: ensureKeyBindingsFor: listRenderOn:atRow:bounds:color:backgroundColor:from: askOkToClose newCode keyStrokeForPreviousFocus: addMenuItemsToWindowMenu: newRadioButton openWorldWithSpec newLabel buildWithSpecLayout: openWithSpec title: newImage treeRenderOn:bounds:color:font:from: newTab extent: keyStrokesForNextFocus: openWorldWithSpec: eventKeyStrokesForPreviousFocus gtInspectorPreviewIn: beginsWith:fromList: addAll:withSpecLayout: instantiateModels: giveFocusToNextFrom: applyMenuModel: takeLastKeyboardFocus needRebuild: keyStrokeForNextFocus: detectMorphicAdapterDo:ifNone: retrieveSpec: additionalKeyBindings whenShortcutsChanged: openWorldWithSpecLayout: detectMorphicAdapterDo: whenWindowChanged: openDialogWithSpec: newDiff neglectMenuModel: apiSelectors registerKeyStrokesForPreviousFor: update: giveFocusToPreviousFrom: adapterFrom:model: hide widget newIconList setModal: newMultiColumnList title createInstanceFor: defaultSpec owner: buttonWidth buttonHeight toolbarHeight title inputTextHeight specSelectors SpecWrapper instance: isRedrawable removeSubWidgets selector instance selector: instance:selector: AbstractMorphicAdapter acceptDroppingMorph:event:inMorph: enable removeMenuKeyCombination: delete help color borderColor: dragEnabled color: hSpaceFill transferBlock disable removeKeyCombination: widthToDisplayInTree: dragPassengersFor:inMorph: layout: heightToDisplayInTree: heightToDisplayInList: wantDropBlock listRenderOn:atRow:bounds:color:backgroundColor:from: borderColor dropEnabled vShrinkWrap treeRenderOn:bounds:color:font:from: hRigid isMorphicAdapter beginsWith:fromList: gtInspectorPreviewIn: vRigid hShrinkWrap dragEnabled: dropEnabled: enabled extent wantsDroppedMorph:event:inMorph: dragPassengerFor:inMorph: acceptDropBlock when:do: setBalloonText: bindKeyCombination:toAction: dragTransformationBlock enabled: bindMenuKeyCombination:toAction: useProportionalLayout removeSubWidgets transferFor:from: vSpaceFill borderWidth setModal: changed borderWidth: widthToDisplayInList: defaultSpec MorphicContainerAdapter centerWidget: checkSplitters isRedrawable newHSplitterAt: buildWidget newVSplitterAt:
  19. 19. ComposableModel SpecWrapper AbstractMorphicAdapter MorphicContainerAdapter
  20. 20. ComposableModel spec SpecWrapper instance selector AbstractMorphicAdapter
  21. 21. CAPTURING INSTANCE INFORMATION What is the target object? Class(ifier) specification What information should be captured? Declarative Slot description How the information should be captured? Behavior (MetaLink) insertions
  22. 22. CLASSIFIER & SLOTS wrapperSpec := LIVInstanceSpecificationBuilder new wrapperSpec classifier: SpecWrapper; name: #identityHash; addSlot: #selector -> nil; addSlot: #instance -> nil. adapterSpec := LIVInstanceSpecificationBuilder new. adapterSpec classifier: MorphicContainerAdapter; name: #identityHash; addSlot: #added -> [ OrderedCollection new ].
  23. 23. METALINKS (SIDETRACK)
  24. 24. METALINKS (SIDETRACK) Ad-hoc behavior insertions to code Person>>name: aString name := aString link := MetaLink new metaObject: [ :object :newValue | Transcript logCr: newValue ]; control: #after. (Person>>name) ast assignmentNodes first link: link Person>>name: aString name := aString "link metaObject value: self value: aString"
  25. 25. Objectifying behavior insertions into MetaLinks allows us to treat it differently
  26. 26. METALINK INSERTIONS (link := MTMetaLinkUser new) target: SpecWrapper>>#instance:; action: [ :object | history inNewState: [ :model | model setLinkFrom: object to: object instance at: #instance ] ]. (link := MTMetaLinkUser new) target: (AbstractMorphicAdapter>>#add:) ast assignmentNodes first action: [ :object :newValue | history inNewState: [ :model | model addLinkFrom: object to: newValue at: #added ] ].
  27. 27. User is guiding the instance model construction Wordy descriptions :( Automatable :) (MetaLinks Toolkit) Flexible – we can derive extra information
  28. 28. DEMO
  29. 29. FUTURE MODELING Adherence to a UML reference model Automatic construction of a reference model PRACTICAL Automation (MetaLinks Toolkit) Streamlining usage Deeper integration with Debugger
  30. 30. AD-HOC RUNTIME OBJECT STRUCTURE VISUALIZATIONS WITH METALINKS INSTANCE VISUALIZATIONS Peter Uhnak     Robert Pergl Department of So ware Engineering Faculty of Information Technology Czech Technical University in Prague Czech Republic {uhnakpet|perglr}@fit.cvut.cz

×