Better Software - April 2008 - (Page 33) “source code engines differ froM generic text seArch engines in hoW they orgAnize the results. since code is orgAnized into functions, clAsses, pAckAges, etc., source code engines displAy results in A WAy thAt reflects thAt orgAnizAtion.” however, spend most of their time in their favorite IDE and conduct more focused searches. IDE plug-ins, therefore, can help simplify the task of finding relevant, reusable source code during development. Eclipse has a plug-in framework that makes creation of extensions relatively straightforward. Koders has taken advantage of this by giving away a free Eclipse plug-in that adds context-sensitive searching. Installation is simple and involves unzipping a package at the top-level directory of Eclipse and then restarting the IDE. Later, as shown in figure 2, right-clicking a verb in the code pops up the usual context menu, plus a link to Koders. On selection, the online Koders site sends back search results to the IDE in the main pane, as shown in figure 3. Google Code Search also offers an API for integrating its services into an application. For source code search plug-ins to become a commodity, however, a standard API is needed. Perhaps an XML-based solution will emerge. The Aston plug-in for Eclipse shown in figure 4 allows for the creation of Java classes based on templates for various well-used patterns, such as Singleton and Factory Method. Installation is just a matter of dumping a jar file into the plug-in directory. After restarting Eclipse, a number of new templates will be available. Better still, if you want to build portlets or JSP/JavaScript templates, then the plug-in allows for the creation of self-defined templates to fulfill these regular creation chores. Figure 3: Search results as seen from within Eclipse My oWn eclipse seArch engine I prefer tailoring existing search engine syntax to the way I think. To this end, I have installed a browse-by-query plug-in in my local Eclipse for experimentation purposes (browsebyquery .sourceforge.net/). To install it, use the typical software update method under the Help/Software Updates/Find and Install menu option. The plug-in is activated for a given project by right-clicking the project and enabling browse and query. Once activated, an agent indexes the code within the project. If you wish to test drive the querying language before installing it in Eclipse, use the demo link on the homepage shown in figure 5. For example, to query for classes in a specific package—in this case the package “org.eclipse.core .runtime”—type: (count of ( arguments of ) > 3) methods in classes in package “org.eclipse.core.runtime” Once satisfied that the query language is expressive enough, you can activate the querying view in Eclipse and select the menu option Window/Show View/Other. A dialog similar to figure 6 will pop up, and you will need to select Browse-ByQuery View from the BBQ Category. Figure 4: A list of Aston templates available from within Eclipse www.StickyMinds.com APRIL 2008 BETTER SOFTWARE 33 http://browsebyquery.sourceforge.net/ http://browsebyquery.sourceforge.net/ http://www.StickyMinds.com
Table of Contents Feed for the Digital Edition of Better Software - April 2008 Better Software - April 2008 Contents Mark Your Calendar Contributions eLightenment Technology Speaking - A Change Would Do You Good Code Craft - A "D" In Programming, Part 1 Test Connection - Learning the Hardware Lessons Management Chronicles - The Art of Persuading Management Cover Story - Incremental and Iterative Development Developers...Start Your Engines Where Do I Go From Here Product Announcements 10 Things You Might Not Know About... The Last Word - Software Quality and the Prisoner's Dilemma Ad Index Better Software - April 2008 Better Software - April 2008 - (Page Intro) Better Software - April 2008 - Better Software - April 2008 (Page Cover1) Better Software - April 2008 - Better Software - April 2008 (Page Cover2) Better Software - April 2008 - Better Software - April 2008 (Page 1) Better Software - April 2008 - Better Software - April 2008 (Page 2) Better Software - April 2008 - Contents (Page 3) Better Software - April 2008 - Mark Your Calendar (Page 4) Better Software - April 2008 - Mark Your Calendar (Page 5) Better Software - April 2008 - Contributions (Page 6) Better Software - April 2008 - Contributions (Page 7) Better Software - April 2008 - eLightenment (Page 8) Better Software - April 2008 - eLightenment (Page 9) Better Software - April 2008 - eLightenment (Page 10) Better Software - April 2008 - eLightenment (Page 11) Better Software - April 2008 - eLightenment (Page 12) Better Software - April 2008 - Technology Speaking - A Change Would Do You Good (Page 13) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 14) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 15) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 16) Better Software - April 2008 - Code Craft - A "D" In Programming, Part 1 (Page 17) Better Software - April 2008 - Test Connection - Learning the Hardware Lessons (Page 18) Better Software - April 2008 - Test Connection - Learning the Hardware Lessons (Page 19) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 20) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 21) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 22) Better Software - April 2008 - Management Chronicles - The Art of Persuading Management (Page 23) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 24) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 25) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 26) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 27) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 28) Better Software - April 2008 - Cover Story - Incremental and Iterative Development (Page 29) Better Software - April 2008 - Developers...Start Your Engines (Page 30) Better Software - April 2008 - Developers...Start Your Engines (Page 31) Better Software - April 2008 - Developers...Start Your Engines (Page 32) Better Software - April 2008 - Developers...Start Your Engines (Page 33) Better Software - April 2008 - Developers...Start Your Engines (Page 34) Better Software - April 2008 - Developers...Start Your Engines (Page 35) Better Software - April 2008 - Where Do I Go From Here (Page 36) Better Software - April 2008 - Where Do I Go From Here (Page 37) Better Software - April 2008 - Where Do I Go From Here (Page 38) Better Software - April 2008 - Where Do I Go From Here (Page 39) Better Software - April 2008 - Where Do I Go From Here (Page 40) Better Software - April 2008 - Where Do I Go From Here (Page 41) Better Software - April 2008 - Where Do I Go From Here (Page 42) Better Software - April 2008 - Product Announcements (Page 43) Better Software - April 2008 - Product Announcements (Page 44) Better Software - April 2008 - Product Announcements (Page 45) Better Software - April 2008 - 10 Things You Might Not Know About... (Page 46) Better Software - April 2008 - The Last Word - Software Quality and the Prisoner's Dilemma (Page 47) Better Software - April 2008 - Ad Index (Page 48) Better Software - April 2008 - Ad Index (Page Cover3) Better Software - April 2008 - Ad Index (Page Cover4)
For optimal viewing of this digital publication, please enable JavaScript and then refresh the page. If you would like to try to load the digital publication without using Flash Player detection, please click here.