SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Sample File Output

The Prolog fact below reports detection of an Observer occurrence in JHotDraw 5.1. It tells us that:

  • The Subject role is played by the type StandardDrawing.
  • The observers role1) is played by the field fListeners.
  • The Notifier Method role2) is played by two methods: figureInvalidated and figureRequestUpdate.
  • The updateCall role 3) is played by the method calls l.drawingInvalidated(…) and l.drawingRequestUpdate(…)
  • The Observer role is played by the type DrawingChangeListener.
  • The Update Method role is played by two methods of DrawingChangeListener: drawingInvalidated(DrawingChangeEvent) and drawingRequestUpdate(DrawingChangeEvent)
candidate(observer, 100, [
  role(subject, ['CH.ifa.draw.standard.StandardDrawing']), 
  role(observers, ['CH.ifa.draw.standard.StandardDrawing.fListeners']), 
  role(notifier,[ 
   'CH.ifa.draw.standard.StandardDrawing.figureInvalidated(FigureChangeEvent)', 
   'CH.ifa.draw.standard.StandardDrawing.figureRequestUpdate(FigureChangeEvent)']
  ), 
  role(updateCall, [
   'l.drawingInvalidated(new CH.ifa.draw.framework.DrawingChangeEvent(...))',
   'l.drawingRequestUpdate(new CH.ifa.draw.framework.DrawingChangeEvent(...))'
  ]), 
  role(observer, [
   'CH.ifa.draw.framework.DrawingChangeListener']), 
  role(updatemethod, [  
   'CH.ifa.draw.framework.DrawingChangeListener.drawingInvalidated(DrawingChangeEvent)', 
   'CH.ifa.draw.framework.DrawingChangeListener.drawingRequestUpdate(DrawingChangeEvent)']
  )]
).

The above output format does not make explicit which Notifier calls which UpdateCall to which Update Method. A more explicit output format (such as DPDX) will be implemented.

1)
A field in the Subject that stores Observers.
2)
A method in the Subject that invokes Update() on all objects stored in Observers.
3)
Calls of Update Methods performed in Notifier methods on each Observer instance
research/dpd/dpjf/candidates.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024