<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Plug-in Best Practices for RCP</title>
	<atom:link href="http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/</link>
	<description>Eclipse RCP and OSGi training - online or onsite</description>
	<lastBuildDate>Tue, 07 Sep 2010 11:09:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-7025</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Thu, 18 Mar 2010 16:38:28 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-7025</guid>
		<description>While I don&#039;t have any more detailed info on this blog, I&#039;d be happy to answer any questions you have. 

When I say &quot;Do not mix public and private classes&quot;, I mean that each package in a bundle should contain only public or only private classes. When you export a package using OSGi, this package should only contain classes you want to make visible to other bundles. If it contains classes you want to stay hidden, then you&#039;re &quot;leaking&quot; implementation details.

Hope this helps,

--- Patrick</description>
		<content:encoded><![CDATA[<p>While I don&#8217;t have any more detailed info on this blog, I&#8217;d be happy to answer any questions you have. </p>
<p>When I say &#8220;Do not mix public and private classes&#8221;, I mean that each package in a bundle should contain only public or only private classes. When you export a package using OSGi, this package should only contain classes you want to make visible to other bundles. If it contains classes you want to stay hidden, then you&#8217;re &#8220;leaking&#8221; implementation details.</p>
<p>Hope this helps,</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: S</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-7023</link>
		<dc:creator>S</dc:creator>
		<pubDate>Thu, 18 Mar 2010 16:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-7023</guid>
		<description>Patrick, This is a wonderful guidelines for plug-in design. Where can I find more details about each recommendation? For example, I don&#039;t know why you say &quot;Do not mix public and privtae class&quot;? . Can you please post more details. That will really help the developers like me. Thanks.</description>
		<content:encoded><![CDATA[<p>Patrick, This is a wonderful guidelines for plug-in design. Where can I find more details about each recommendation? For example, I don&#8217;t know why you say &#8220;Do not mix public and privtae class&#8221;? . Can you please post more details. That will really help the developers like me. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-6702</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 09 Mar 2010 15:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-6702</guid>
		<description>Hi Geejay, 

A common approach is to use a splash handler to manage login. Splash handlers execute after the workbench has been started.

Login logic can also be tied to JAAS, if you&#039;re interested in that. Check out this link for more details:

http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/login_extensions.html

Hope this helps,

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Geejay, </p>
<p>A common approach is to use a splash handler to manage login. Splash handlers execute after the workbench has been started.</p>
<p>Login logic can also be tied to JAAS, if you&#8217;re interested in that. Check out this link for more details:</p>
<p><a href="http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/login_extensions.html" rel="nofollow">http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/login_extensions.html</a></p>
<p>Hope this helps,</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geejay</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-6695</link>
		<dc:creator>Geejay</dc:creator>
		<pubDate>Tue, 09 Mar 2010 10:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-6695</guid>
		<description>Hi

Thanks for the best practices! I hope I can use them down the track...

I am only starting with RCP/OSGi/Java actually. I come from a .NET Windows Forms /ASP.NET world.

The first hurdle I have encountered is authentication with a Login screen. I noticed I can&#039;t access services until the workbench has been started, so I&#039;m not sure what the normal &quot;practice&quot; is here. How do you do authentication with RCP?</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>Thanks for the best practices! I hope I can use them down the track&#8230;</p>
<p>I am only starting with RCP/OSGi/Java actually. I come from a .NET Windows Forms /ASP.NET world.</p>
<p>The first hurdle I have encountered is authentication with a Login screen. I noticed I can&#8217;t access services until the workbench has been started, so I&#8217;m not sure what the normal &#8220;practice&#8221; is here. How do you do authentication with RCP?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-438</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Tue, 16 Dec 2008 21:54:30 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-438</guid>
		<description>Hi Lex,

Yeah, singletons are now something of an anti-pattern and I agree that their use should be limited. But as you say, eliminating singletons can cause problems when you&#039;d like to access a &quot;global&quot; instance deep down in the framework.

There are a few solutions to this.

* Make the instance available via a factory class or something like a singleton registry (which itself would need to be a singleton). This solves many of the problems associated with singletons, but isn&#039;t the cleanest approach.

* A better solution may be to simply create OSGi services for these classes. This provides you a lot of flexibility in how and where your instances are created. It&#039;s true that the view has to reach out and pick up the service, but in a modular framework like the RCP this is hard to get away from.

* There is also a way to add proprietary (non-OSGi) services. Check out the documentation for the org.eclipse.ui.services extension point for more info. Services added through this extension point would be available globally via the PlatformUI.getWorkbench().getService() method.

There have been rumblings about adding dependency injection to the RCP framework as part of the e4 project, but I&#039;m not sure what the exact plan is. Check out this page for more info:

http://wiki.eclipse.org/E4/Architectural_Foundations

Hope this helps,

--- Patrick</description>
		<content:encoded><![CDATA[<p>Hi Lex,</p>
<p>Yeah, singletons are now something of an anti-pattern and I agree that their use should be limited. But as you say, eliminating singletons can cause problems when you&#8217;d like to access a &#8220;global&#8221; instance deep down in the framework.</p>
<p>There are a few solutions to this.</p>
<p>* Make the instance available via a factory class or something like a singleton registry (which itself would need to be a singleton). This solves many of the problems associated with singletons, but isn&#8217;t the cleanest approach.</p>
<p>* A better solution may be to simply create OSGi services for these classes. This provides you a lot of flexibility in how and where your instances are created. It&#8217;s true that the view has to reach out and pick up the service, but in a modular framework like the RCP this is hard to get away from.</p>
<p>* There is also a way to add proprietary (non-OSGi) services. Check out the documentation for the org.eclipse.ui.services extension point for more info. Services added through this extension point would be available globally via the PlatformUI.getWorkbench().getService() method.</p>
<p>There have been rumblings about adding dependency injection to the RCP framework as part of the e4 project, but I&#8217;m not sure what the exact plan is. Check out this page for more info:</p>
<p><a href="http://wiki.eclipse.org/E4/Architectural_Foundations" rel="nofollow">http://wiki.eclipse.org/E4/Architectural_Foundations</a></p>
<p>Hope this helps,</p>
<p>&#8212; Patrick</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lex Robin</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-437</link>
		<dc:creator>Lex Robin</dc:creator>
		<pubDate>Tue, 16 Dec 2008 13:27:40 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-437</guid>
		<description>IMHO singletons are a no-go. Our projects used them a long time because it was so easy to add functionality anywhere. After I had to refactor our (non-RCP) code and introduce a constructor parameter for singletons, the only problems were singletons. Some could be removed easily, others really hard. My conclusion: avoid singletons where possible. Always try to find another way, e.g. by creating an instance at application startup. First, you see what code requires the instance - second, you avoid such major problems we had with the refactoring our singletons.

Now to RCP (I&#039;m a RCP beginner):
Unfortunately, I did not found a way how to pass a instance reference from my IApplication to my views. The latter are simply created using &quot;magic&quot;, there is no way to pass needed references in the constructor.</description>
		<content:encoded><![CDATA[<p>IMHO singletons are a no-go. Our projects used them a long time because it was so easy to add functionality anywhere. After I had to refactor our (non-RCP) code and introduce a constructor parameter for singletons, the only problems were singletons. Some could be removed easily, others really hard. My conclusion: avoid singletons where possible. Always try to find another way, e.g. by creating an instance at application startup. First, you see what code requires the instance &#8211; second, you avoid such major problems we had with the refactoring our singletons.</p>
<p>Now to RCP (I&#8217;m a RCP beginner):<br />
Unfortunately, I did not found a way how to pass a instance reference from my IApplication to my views. The latter are simply created using &#8220;magic&#8221;, there is no way to pass needed references in the constructor.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-435</link>
		<dc:creator>Patrick</dc:creator>
		<pubDate>Thu, 17 Jan 2008 15:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-435</guid>
		<description>I do have singletons in my RCP applications, and find them useful. There may be situations where singletons cause problems, particularly if you&#039;d like to reuse your plug-ins in a Rich Ajax Platform application or in a server-side OSGi application.

If there are any specific concerns or problems you&#039;ve had with singletons in RCP application, I&#039;d be interested in hearing them.</description>
		<content:encoded><![CDATA[<p>I do have singletons in my RCP applications, and find them useful. There may be situations where singletons cause problems, particularly if you&#8217;d like to reuse your plug-ins in a Rich Ajax Platform application or in a server-side OSGi application.</p>
<p>If there are any specific concerns or problems you&#8217;ve had with singletons in RCP application, I&#8217;d be interested in hearing them.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vainqueur</title>
		<link>http://www.modumind.com/2007/11/07/plug-in-best-practices-for-rcp/comment-page-1/#comment-436</link>
		<dc:creator>vainqueur</dc:creator>
		<pubDate>Thu, 17 Jan 2008 04:10:27 +0000</pubDate>
		<guid isPermaLink="false">http://rcpquickstart.wordpress.com/2007/11/07/plug-in-best-practices-for-rcp/#comment-436</guid>
		<description>In my Activators, I usually start service trackers &amp; also register OSGi services (&amp; place these services into singletons). What is your position on the use of singletons in an eclipse RCP ?</description>
		<content:encoded><![CDATA[<p>In my Activators, I usually start service trackers &amp; also register OSGi services (&amp; place these services into singletons). What is your position on the use of singletons in an eclipse RCP ?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
