AD-HOC RUNTIME OBJECTSTRUCTURE VISUALIZATIONS
WITH METALINKSPeter Uhnak Robert Pergl
Department of So�ware Engineering Faculty of Information Technology
Czech Technical University in Prague Czech Republic
{uhnakpet|perglr}@fit.cvut.cz
INSTANCE VISUALIZATIONSPeter Uhnak Robert Pergl
Department of So�ware Engineering Faculty of Information Technology
Czech Technical University in Prague Czech Republic
{uhnakpet|perglr}@fit.cvut.cz
INPUTui := 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))
Spec / Adapter / Morphic compositionSpec Adapter
MorphicAdapter Morphic
ComposableModel AbstractAdapter
AbstractMorphicAdapter Morph
model widget
widgetmodel
Spec / Adapter / Morphic composition
ComposableModel
spec
SpecWrapper
selectorinstance
AbstractAdapter
AbstractMorphicAdapter
MorphicContainerAdapterMorph
spec
/subwidgets
instance
model
model
widget
model
InstanceSpecificationDomain Object representation
ClassifierClass of a Domain Object
SlotRun-time attribute value
ImmutableObjectFrozen value not affected by further changes inthe Domain object
CAPTURING INSTANCE INFORMATIONWhat is the target object?
Class(ifier) specificationWhat information should be captured?
Declarative Slot descriptionHow the information should be captured?
Behavior (MetaLink) insertions
ComposableModel
focusOrderownerwindow
extentHolderneedRebuildadditionalKeyBindingsannouncerkeyStrokesForNextFocusHolderkeyStrokesForPreviousFocusHolderwindowIconaboutTextaskOkToClosetitleHolder
specSelectorswhenBuiltDo:ensureMorphicAdapterremoveMenuKeyCombination:eventKeyStrokesForNextFocusinitializewindowIcon:updateTitlenewCheckBoxcenterWidget:newTextopenDialogWithSpecLayout:askOkToClose:owner:newButtonfocusOrder:newListaddAll:withSpec:specaboutText:heightToDisplayInTree:heightToDisplayInList:initialExtentopenDialogWithSpecdefaultSpecSelectorcenteredopenExternalWindowWithSpecLayout:initializeDialogWindow:resolveSymbol:openExternalWindowWithSpec:takeKeyboardFocusspec:privateAdapterFromModel:withSpec:gtInspectorModelNestingIn:okToChangebuildWithSpec:windowIconinitializePresenterextentopenWithSpec:defaultWindowModelClassshowensureExtentFor:handlesKeyboard:isDisplayedfocusOrdersetExtentAndBindingTo:newTabManagerdefaultSpecbindKeyCombination:toAction:announce:bindMenuKeyCombination:toAction:registerKeyStrokesForNextFor:ensureMorphicAdapterDo:keyStrokesForPreviousFocus:announcerprivate_buildWithSpec:widthToDisplayInList:newDropListinitializeWidgetsicon:on:do:needRebuildcancellednewTextInputdeleteprivate_buildWithSpeccenteredRelativeTo:openWithSpecLayout:newTreewindowopenExternalWindowWithSpecowneraboutTextbuildWithSpecnewSliderhasWindowon:send:to:removeKeyCombination:widthToDisplayInTree:instantiate:ensureKeyBindingsFor:listRenderOn:atRow:bounds:color:backgroundColor:from:askOkToClosenewCodekeyStrokeForPreviousFocus:addMenuItemsToWindowMenu:newRadioButtonopenWorldWithSpecnewLabelbuildWithSpecLayout:openWithSpectitle:newImagetreeRenderOn:bounds:color:font:from:newTabextent:keyStrokesForNextFocus:openWorldWithSpec:eventKeyStrokesForPreviousFocusgtInspectorPreviewIn:beginsWith:fromList:addAll:withSpecLayout:instantiateModels:giveFocusToNextFrom:applyMenuModel:takeLastKeyboardFocusneedRebuild:keyStrokeForNextFocus:detectMorphicAdapterDo:ifNone:retrieveSpec:additionalKeyBindingswhenShortcutsChanged:openWorldWithSpecLayout:detectMorphicAdapterDo:whenWindowChanged:openDialogWithSpec:newDiffneglectMenuModel:apiSelectorsregisterKeyStrokesForPreviousFor:update:giveFocusToPreviousFrom:adapterFrom:model:hidewidgetnewIconListsetModal:newMultiColumnListtitlecreateInstanceFor:
defaultSpecowner:buttonWidthbuttonHeighttoolbarHeighttitleinputTextHeightspecSelectors
SpecWrapper
instance:isRedrawableremoveSubWidgetsselectorinstanceselector:
instance:selector:
AbstractMorphicAdapter
acceptDroppingMorph:event:inMorph:enableremoveMenuKeyCombination:deletehelpcolorborderColor:dragEnabledcolor:hSpaceFilltransferBlockdisableremoveKeyCombination:widthToDisplayInTree:dragPassengersFor:inMorph:layout:heightToDisplayInTree:heightToDisplayInList:wantDropBlocklistRenderOn:atRow:bounds:color:backgroundColor:from:borderColordropEnabledvShrinkWraptreeRenderOn:bounds:color:font:from:hRigidisMorphicAdapterbeginsWith:fromList:gtInspectorPreviewIn:vRigidhShrinkWrapdragEnabled:dropEnabled:enabledextentwantsDroppedMorph:event:inMorph:dragPassengerFor:inMorph:acceptDropBlockwhen:do:setBalloonText:bindKeyCombination:toAction:dragTransformationBlock
enabled:bindMenuKeyCombination:toAction:useProportionalLayoutremoveSubWidgetstransferFor:from:vSpaceFillborderWidthsetModal:changedborderWidth:widthToDisplayInList:
defaultSpec
MorphicContainerAdapter
centerWidget:checkSplittersisRedrawablenewHSplitterAt:buildWidgetnewVSplitterAt:
CAPTURING INSTANCE INFORMATIONWhat is the target object?
Class(ifier) specificationWhat information should be captured?
Declarative Slot descriptionHow the information should be captured?
Behavior (MetaLink) insertions
CLASSIFIER & SLOTSwrapperSpec := 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 ].
METALINKS (SIDETRACK)
Ad-hoc behavior insertions to codePerson>>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"
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 ] ].
User is guiding the instance model construction
Wordy descriptions :(
Automatable :) (MetaLinks Toolkit)
Flexible – we can derive extra information
FUTUREMODELING
Adherence to a UML reference model
Automatic construction of a reference model
PRACTICAL
Automation (MetaLinks Toolkit)
Streamlining usage
Deeper integration with Debugger