Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Practices Lab. -- The University of British Columbia 1 JQuery: Finding your way through scattered code Andrew Eisenberg, Doug Janzen, Kris De.

Similar presentations


Presentation on theme: "Software Practices Lab. -- The University of British Columbia 1 JQuery: Finding your way through scattered code Andrew Eisenberg, Doug Janzen, Kris De."— Presentation transcript:

1 Software Practices Lab. -- The University of British Columbia 1 JQuery: Finding your way through scattered code Andrew Eisenberg, Doug Janzen, Kris De Volder, Ryan Wannop Software Practices Lab. -- The University of British Columbia

2 2 Typical ways to explore scattered concerns: Browse structural views -package structures, inheritance hierarchy Search for a specific pattern -regular expressions Follow relationships -calls, instantiates, references JQuery: Motivation Most modern IDEs can help with all of this, but…

3 Software Practices Lab. -- The University of British Columbia 3 JQuery: Motivation Explosion of browsers Package Explorer Search Call Hierarchy Inheritance Hierarchy Browsers are too specific Poor use of screen Real- Estate Exploration itself is scattered and tangled

4 Software Practices Lab. -- The University of British Columbia 4 JQuery: How it works Avoiding loss of context: Problem: Too many browsers leads to loss of context. Solution: Support many views within a single tool. Choose New Browser Start with Package Browser

5 Software Practices Lab. -- The University of British Columbia 5 JQuery: How it works Abstract Class Browser Both views in same window Package Browser Bundled with many more browsers

6 Software Practices Lab. -- The University of British Columbia 6 JQuery: How it works Incrementally perform the exploration by extending each view with a sub-view 1.Select extension point

7 Software Practices Lab. -- The University of British Columbia 7 JQuery: How it works Incrementally perform the exploration by extending views with a new extensions 1.Select extension point 2.Choose sub- query

8 Software Practices Lab. -- The University of British Columbia 8 JQuery: How it works Incrementally perform the exploration by extending views with a new extensions 1.Select extension point 2.Choose sub- query 3.Continue exploration Bundled with many more sub-browsers

9 Software Practices Lab. -- The University of British Columbia 9 JQuery: How it works Filtering by regular expression Search for “Figure”: Open query dialog double-click

10 Software Practices Lab. -- The University of British Columbia 10 JQuery: How it works Filtering by regular expression Search for “Figure”: Open query dialog Edit query

11 Software Practices Lab. -- The University of British Columbia 11 JQuery: How it works Filtering by regular expression Search for “Figure”: Open query dialog Edit query Close dialogue (query automatically re- executes)

12 Software Practices Lab. -- The University of British Columbia 12 JQuery: How it works Filtering by regular expression Browser is now filtered by “Figure” Can customize queries in many other ways too.

13 Software Practices Lab. -- The University of British Columbia 13 JQuery: An Example Make a enhancement to the JHotDraw codebase. Non- trivial, but some details abstracted away. Based on an actual task we performed with little prior knowledge of the codebase. Task:

14 Software Practices Lab. -- The University of British Columbia 14 JQuery: The Plan RectangleText ??? Frame No Frame Menu Change Pen Color

15 Software Practices Lab. -- The University of British Columbia 15 JQuery: Executing the Plan Menu Change Pen Color Rectangle Text FrameNo Frame Change Attribute Command Found by regex search for *Attribute* ??? Step 1: Find menu creation Step 2: Find relationship to frames

16 Software Practices Lab. -- The University of British Columbia 16 JQuery: Executing the Plan Change Attribute Command Rectangle ??? Text FrameNo Frame Determined that Pen Color sets Menu FrameColor Attribute execute creates Draw Application createColorMenu calls createAttrMenu

17 Software Practices Lab. -- The University of British Columbia 17 Attribute Figure setAttr implemented by JQuery: Executing the Plan Change Attribute Command Draw Application Rectangle Text FrameNo Frame sidetrack to explore FigureAttributes getAttr execute Figure setAttr calls createAttrMenu drawFr dataflow createColorMenu creates calls Determined that Pen Color sets FrameColor Attribute

18 Software Practices Lab. -- The University of British Columbia 18 JQuery: Executing the Plan Change Attribute Command Rectangle Figure Text Figure change this method Figure Attribute Figure getAttr drawFr setAttr drawFr implemented by drawFr execute Draw Application createAttrMenu createColorMenu calls creates implemented by calls dataflow sidetrack to explore FigureAttributes Determined that Pen Color sets FrameColor Attribute

19 Software Practices Lab. -- The University of British Columbia 19 JQuery: Versatile Code Navigator 1. Browsing structural views 2. Searching for a specific pattern 3. Following relationships Current IDE’s: “explosion” of disconnected views loss of context disorientation JQuery: within a single navigation view retain context reduce disorientation Browse Scattered Code

20 Software Practices Lab. -- The University of British Columbia 20 JQuery: Customization JQuery can do more: can create more powerful queries can include data from other tools has extendable menu items virtual source files (in next release) See our website!

21 Software Practices Lab. -- The University of British Columbia 21 JQuery: De-tangling searching Why use 4 browsers when you can use 1?

22 Software Practices Lab. -- The University of British Columbia 22 Questions? Google: Download JQuery (new release out soon): Prevents tangled and scattered searches Reduces disorientation of complex exploration Maintains context Andrew Eisenberg: ade@cs.ubc.ca

23 Software Practices Lab. -- The University of British Columbia 23 JQuery: Executing the Plan Change Attribute Command Found by regex search for *Attribute* Draw Application Created by createAttributesMenu() calls createColorMenu() Determined that Pen Color represented by frameColor Attribute Figure execute() calls setAttr() calls to getAttr(), getFrameColor(), and draw() Rectangle Figure Text Figure overrides drawFrame() Attribute Figure implements setAttr() sidetrack to explore FigureAttributes altered drawFrame()

24 Software Practices Lab. -- The University of British Columbia 24 JQuery: Executing the Plan Change Attribute Command Draw Application Created by createAttributesMenu() calls createColorMenu() Rectangle Text FrameNo Frame Figure execute() calls setAttr(“frameColor”) getAttr() called by getFrameColor() called by draw() Attribute Figure implements setAttr() sidetrack to explore FigureAttributes

25 Software Practices Lab. -- The University of British Columbia 25 JQuery: How it works source code facts.java analyze queries Package Browser Interface Browser Method Browser results Avoiding loss of context: Problem: Too many browsers leads to loss of context. Solution: Support many views within a single tool.

26 Software Practices Lab. -- The University of British Columbia 26 JQuery: How it works source code facts query results Avoiding loss of context: results query The answer to a query prompts another query

27 Software Practices Lab. -- The University of British Columbia 27 JQuery: Finished! Change Attribute Command Draw Application Created by Figure Rectangle Figure Text Figure Attribute Figure Step 1: Step 2:


Download ppt "Software Practices Lab. -- The University of British Columbia 1 JQuery: Finding your way through scattered code Andrew Eisenberg, Doug Janzen, Kris De."

Similar presentations


Ads by Google