|
From: Dexter A. <ve...@ia...> - 2003-04-17 02:20:02
|
Hey guys-- Just found out that Gamma and Beck are writing a book on eclipse plug-ins. If you join the contributingtoeclipse yahoo group and go to files you can take a look at drafts: http://groups.yahoo.com/group/contributingtoeclipse/ enjoy. dex -------- Original Message -------- Subject: [svp] Feedback on Contributing To Eclipse Date: Wed, 16 Apr 2003 18:20:39 -0700 From: Russ Rufer <ru...@pe...> Reply-To: sil...@ya... Organization: Pentad Software Corporation To: Silicon Valley Patterns Group <sil...@ya...> These are my notes and suggestions on the bulk of Circle One (4/10/03 draft) of Contributing to Eclipse, as supplemented by participants of the April 15, 2003 meeting of the Silicon Valley Patterns Group. - Russ Rufer In Attendance ------------- Russ Rufer Tracy Bialik Jerry Lewis Jeff Miller Carol Thistlethwaite Azad Bolour Phil Goodwin Jan Looney Rich Smith Andy Farley Debbie Utley Jim Sawyer General -------- This version is much more approachable than the 2/21/03 version we worked with earlier. I've already mentioned the group's reaction to Azad Bolour's summary of plug-in concepts in another post, so I'll just leave that with the suggestion of doing something similar in the book. It's sad to see the quick jump into test driven plug-in development go away, but it's probably for the best. It is easier to follow the book this way, and I felt like I was covering more Eclipse ground in the same amount of time. I like the approach of building a full, realistic plug-in in the book. JUnit seems like a great choice to me, since most users will already be familiar with the ideas and won't need every detail explained to them. A book this size can't be all things to all people, but through the course of this plug-in, I expect to touch on the core issues that will be important to most plug-ins. I'm really coming to enjoy the way readers are taught to find and modify examples for their own use. Details ------- Page 29. Not all participants knew how to find the "filter" in the drop down menu. Page 34. The two warnings I see after saving plug-in.xml are not discussed: "Referenced class 'org.eclipse.jdt.core.IType' in attribute 'objectClass' cannot be found. " "Required attribute 'class' not defined." I fixed the first warning with <requires> ... <import plugin="org.eclipse.jdt.core"/> </requires> (I see this was added later on page 41) Page 34. My Runtime Workbench was clean (no projects) so I had to create a java project and add a class that I could select to display the the new popup menu item Page 34. Even though you were very explicit about selecting a class file, there was still confusion when someone tried to see the menu item with a .java compilation unit selected. Page 36. One more short sentence in the sidebar, defining what you mean by shadow would be useful.. Page 39. Minor point - the order of attributes in <action> has changed since the earlier version. Page 39. Adding the class attribute removes that warning. Page 39. My java class wizard defaulted to generate stubs for unimplemented abstract methods, so I the Quick Fix comment wasn't relevant. Page 39. Tracing was a very nice addition to Circle One. Page 40. Having trouble getting the action delegate hooked in. The trace displays: Could not create action delegate. Reason: Plug-in org.eclipse.contribution.junit was unable to load class org.eclipse.contribution.junit.RunTestAction. I checked spellings, tried various means of recomputing class paths, rebuilt all, rebooted eclipse all with no effect. I finally gave up and decided to continue coding the example even though I didn't expect anything to work. Somehow, after adding JUnitPlugin I no longer had the problem. Page 43. With the recommended setup earlier, the project wizard creates a plugin class attribute automatically with the name "org.eclipse.contribution.junit.JunitPlugin" This is a different capitalization than the one you go on to use: JUnitPlugin (with a capital 'U'). This should be changed to match the automatic entry or there should be a highlighted notice to make the change. Page 43. Consider adding a print statement to this early version of JUnitPlugin.run() so readers can easily see that the code is running. I used: public void run(IType type) { System.out.println("Testing: " + type.getElementName()); } or at least mention this next to the similar note about selectionChanged() in the Forward Reference. Page 43. "The Singleton implementation is straight out of the book." Actually this is a different implementation than in "the book". Most readers will never have seen this variant. Page 47. You started using getListeners() without showing it in the code snippet (or even mentioning it). Page 47. You still haven't implemented run. For the satisfaction of seeing the dialog we just spent time adding, and to exercise the listener code a bit, I added: public void run(IType type) { System.out.println("Testing: " + type.getElementName()); fireTestsFinished(); } private void fireTestsFinished() { Iterator iListener = getListeners().iterator(); while (iListener.hasNext()) { ITestRunListener listener = (ITestRunListener) iListener.next(); listener.testsFinished(); } } I started to put in a dummy failure condition so I could see the Failed dialog as well, but it started to look like too much temporary code for not much result. Page 50. Typo: class="org.eclipse.contribute.junit.RunTestAction$Listener"> should be "contribution" not "contribute". Page 53. Now you introduce a reason for getListeners(). Consider direct access to the list back on page 47 and refactoring here. Page 53. I thought these additions to the manifest were already supposed to be added back on page 50. Page 56. Here you imply the JUnitPlugin.run() method that was missing (above, page 47). Page 58. ITestRunListener.testsStarted() - as in each.testsStarted() takes at least a count as an argument, the way it was defined earlier. public void fireTestsStarted() { ... final ITestRunListener each= (ITestRunListener) all.next(); ... each.testsStarted(); Page 58. This is not legal because all isn't final and handleException in in the inner class. public void handleException(Throwable exception) { all.remove(); } Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ -- Brian "Dexter" Allen "Being nationalistic in the sense in which it is www.luminousbeings.com now demanded by public opinion would, it seems ve...@ia... to me, be for us who are more spiritual not mere ve...@ac... insipidity but dishonesty, a deliberate deadening of our better will and conscience." Friedrich Nietzche (1884) |