j query aosddemo_2004
Post on 08-Jul-2015
53 Views
Preview:
TRANSCRIPT
1Software Practices Lab. -- The University of British Columbia
JQuery:Finding your way through
scattered code
Andrew Eisenberg, Doug Janzen, Kris De Volder, Ryan Wannop
Software Practices Lab. -- The University of British Columbia
2Software Practices Lab. -- The University of British Columbia
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…
3Software Practices Lab. -- The University of British Columbia
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
4Software Practices Lab. -- The University of British Columbia
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
5Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Abstract Class
Browser
Both views in same window
Package Browser
Bundled with many more browsers
6Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Incrementally perform the exploration by extending each view with a sub-view
1. Select extension point
7Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Incrementally perform the exploration by extending views with a new extensions
1. Select extension point
2. Choose sub-query
8Software Practices Lab. -- The University of British Columbia
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
9Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Filtering by regular expression
Search for “Figure”:• Open query dialog
• double-click
10Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Filtering by regular expression
Search for “Figure”:• Open query dialog• Edit query
11Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Filtering by regular expression
Search for “Figure”:• Open query dialog• Edit query• Close dialogue
(query automatically re-executes)
12Software Practices Lab. -- The University of British Columbia
JQuery: How it works
Filtering by regular expression
Browser is now filtered by “Figure”
Can customize queries in many other ways too.
13Software Practices Lab. -- The University of British Columbia
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:
14Software Practices Lab. -- The University of British Columbia
JQuery: The Plan
Rectangle Text
??????
Frame No Frame
Menu Change Pen Color
15Software Practices Lab. -- The University of British Columbia
JQuery: Executing the Plan
Menu Change Pen Color
Rectangle Text
Frame No Frame
Change Attribute Command
Found by regex search for *Attribute*
??????
??????
Step 1: Find menu
creation
Step 2: Find relationship
to frames
16Software Practices Lab. -- The University of British Columbia
JQuery: Executing the Plan
Change Attribute Command
Rectangle
??????
Text
Frame No Frame
Determined that Pen Color sets MenuFrameColor Attribute
execute
createsDraw Application
createColorMenu
callscreateAttrMenu
17Software Practices Lab. -- The University of British Columbia
AttributeFigure
setAttr
implemented by
JQuery: Executing the Plan
Change Attribute Command
Draw Application
Rectangle Text
Frame No Frame
sidetrack to explore FigureAttributes
getAttr
execute
Figure setAttr
callscreateAttrMenu
drawFr
dataflow
createColorMenucreates
calls
Determined that Pen Color setsFrameColor Attribute
18Software Practices Lab. -- The University of British Columbia
JQuery: Executing the Plan
Change Attribute Command
Rectangle Figure
Text Figure
change this method
Figure
AttributeFigure getAttr
drawFr
setAttr
setAttr
drawFr
implemented by
drawFr
executeDraw Application
createAttrMenu
createColorMenu
calls
creates
implemented by
calls
dataflowsidetrack to explore
FigureAttributes
Determined that Pen Color setsFrameColor Attribute
19Software Practices Lab. -- The University of British Columbia
JQuery: Versatile Code Navigator
1. Browsing structural views2. Searching for a specific pattern3. Following relationships
Current IDE’s:“explosion” of
disconnected views
loss of contextdisorientation
JQuery:within a single navigation view
retain contextreduce
disorientation
Browse Scattered Code
20Software Practices Lab. -- The University of British Columbia
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!
21Software Practices Lab. -- The University of British Columbia
JQuery: De-tangling searching
Why use 4 browsers when you can use 1?
22Software Practices Lab. -- The University of British Columbia
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
top related