Software Reuse in Eclipse Kellie-Ann Smith Norgye Yuanyuan Song Xiang Yin Jia Xu
Outline • Motivation • Software Reuse • Eclipse Plug-in Architecture • A Case Study • Demo • Conclusion • Discussion
Motivation • Reuse is important in current software development • Eclipse provides an open architecture for IDE development [Gamma & Beck 2003] • Is the reuse model of Eclipse different from previous models?
Reuse Snapshot • Software reuse is using existing software artifacts to create a new software system [Freeman 1983] • Source code fragments • Module-level implementation • Design structures • Specification • Test suite • Documentation • etc. • Reuse failed to become a standard software engineering practice [Kruger 1992] • Reuse can reduce complexity of software [Brooks]
Basic Issues in Reuse Model • Abstraction • how to describe the essential characteristic of a reusable software artifacts • Selection • how to locate, compare and select reusable software artifacts • Specialization • how to specialize a generalized software artifact • Integration • how to combine a collection of selected and specialized artifacts into a complete software system [Kruger 1992]
How to Evaluate a Reuse Model • Ease of Use • Cost-Effectiveness [Frakes & Terry 1992] • Scalability • Reliability • Evolvability
Eclipse Plug-in Introduction – Plug-in Model • Plug-in: a component that provides service within the context of the Eclipse workbench. • Manifest file • Jar files and other resources • Plug-in runtime class • Plug-ins are activated only as needed • Eclipse runtime: plug-in management kernel. • All functionality of the platform is provided by plug-ins
Eclipse Plug-in Introduction -- Extension • Relationship among plug-ins • Dependency • Extension • Host plug-in provides the extension point • Extender plug-in defines the extension • Host often “calls” extender when specified events are recognized
A Case Study: A Compare/Merge Tool--- Requirements • Functions • Comparison and merge of files/folders from the whole file system • 2-way and 3-way • Filters • Select-Merge & Auto merge • … • GUI • Multiple compare/merge windows, Tree structure view, Difference highlighting, Navigation, Dialog interface • …
What can we reuse in Eclipse – Compare Plug-In • Supports: • structural and textual compare operations • displaying results of comparison • Extension Points: • Structure Creators • Structure Merge Viewers • Content Merge Viewers • Content Viewers
How the Compare Plug-In works • General Idea of How It Works: • Choose Files/folders in the workspace and start the compare operation • Differencing engine finds the differences between the selected resources • Differences returned and presented in the Viewer(s) • Specific structures, differencers and viewers can be registered as extensions
What’s missing per our requirements • Open files in the file system to compare • Compare/Merge dialog • A side-by-side structure merge view • Filters, Line numbers, …
Improvement #1 • New Structure Merge Viewer • Goal: Enhance GUI to support side-by-side structure merge view • Proposed Approach: write a new viewer for the extension point “ Structure Merger Viewer” . • Experience: It is very hard to just “plug” a new GUI while keep all other things untouched. • Implementation: see demo.
Improvement #2 • Open external files & compare/merge dialog • Goal: • provide a new entry point, support external file Compare/Merge. • Approach: • utilize ActionSet extension point to develop menu item and toolbar item. • Using a new dialog as entry interface • Import external files into eclipse workspace in the form of link files. • Implementation see demo.
Conclusion --- Issues in Eclipse Plug-in Reuse Model • Abstraction • the name of a plug-in • Selection • No systematic way like WDSL for web service • Specialization • extendable plug-ins • Integration • eclipse run-time
Discussion • Ease of Use • Extension is good for new features under Eclipse framework • Lack of selection mechanism • Cost-Effectiveness • Not well-organized documentation, much time on learning • Scalability • Lack of plug-in resources and selection mechanism • Reliability • The HelloWorld example doesn’t even work at every time • Evolvability • Other issues • Ease of debugging? Separation of view and model is good/bad?
Reference • Brooks, F. “No silver bullet”, “No silver bullet refired” • Frakes, W., Terry, C., Software reuse: metrics and models, ACM Computing Surveys, Volume 28 Issue 2 June 1996 • Freeman, P. “Reusable software engineering: Concepts and Research directions”, 1983 • Gamma., Erich, Beck., Kent, Contributing to Eclipse, 2003 • Krueger , Charles W. “Software reuse”, ACM Computing Surveys, Volume 24 , Issue 2 (June 1992)