These scenarios are meant to illustrate how CodeBroker helps
programmers locate needed components when they are following their current
programming process. The functionality of CodeBroker is in
bold form as an aid to readers.
Programmer Jack is assigned the following task:
Simulating the card dealing process.This
program is to simulate the process of card dealing. Each card is
represented with a number from 0 to 51. The program should
produce a list of 52 cards, as if it is resulted from a human
card dealer.
He decides to implement it in two steps: first, to create a
method that generates a random number between two integers;
second, to create a method that does the shuffling.
|
Scenario 1: Components Delivery
|
Top |
Home |
As soon as Jack finishes the doc comment of
the method, CodeBroker extracts the doc comment from
the editor, and use it as a constraint query to search the component
repository autonomously. Components with similar description are then
delivered in the RCI-display (lower part of the editor).
The 3rd component delivered has
similar functionality, but has different signature (shown in the mini-buffer).
Jack then proceeds to define the
signature of the method. When he types in the { as shown
in figure, CodeBroker extracts and formulates a
constraint query from the editor and returns components that
have both similar
functionality description and compatible signatures. The 1st component
delivered can be directly reused by Jack.
|
Scenario 2: Direct Manipulation
|
Top |
Home |
Jack now proceeds to write the shuffling
method. Again, CodeBroker
delivers components based on the doc
comments. However, the components
delivered seem totally irrelevant to what he wants to do--this is caused by the word cards. Jack finds all top four
components are from the class java.awt.CardLayout, which
apparently is not related to
the current task. Right-clicking the first component name
brings the Skip Components Menu, which
is the interface to directly manipulate delivered components to
remove irrelevant components quickly. Jack chooses to remove
all components belonging to the class CardLayout in
this session only.
This figure shows the result when components from the class CardLayout are removed.
The component 4, randomShuffle, which has been buried in
the low ranks before can be
reused.
|
Scenario 3: Query Refinement
|
Top |
Home |
CodeBroker also provides a query refinement interface,
for programmers to refine queries. As shown in the figure,
Jack can modify the conceputal query, the constraint query, as
well as the filtering that subdues irrelevant components. In this figure,
Jack changed the extracted conceputal query.
This figure shows the result after the modified query is processed.