Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

Archive for February, 2009

on Feb 19th, 2009p2 in a non-eclipse system

Somebody asked me a great question the other day, can p2 be used in non-eclipse systems?  This is a great question because I think it highlights the fact that we don’t always make newcomers aware of the great power contained in the Eclipse components. Most of the Eclipse bundles are not designed simply for the IDE.  In fact, for almost all the bundles in the IDE, thought is given for how they can be generalized. The IDE is just an example of how the bundles can be used.  When developing software using the Eclipse IDE keep this mind, and you will start to see reuse opportunities everywhere! Of course — getting back to the original question regarding p2  – the answer is a resounding YES!!!

In this particular case, the user wants to use p2 in their own OSGi based application. Not only is this possible, it is remarkably easy (and you can even use the Eclipse tooling to make it easier).   For example, when you export a product,  select the  ”Generate metadata repository”.  This will generate a p2 repository for your product, including Installable Units for all of your bundles and features.

generate p2 in a non eclipse system

Generate Metadata

 Following from Kim’s Post, say you have a repository (or even a composite repository) that holds your bundles (we call these Installable Units), you can simply use the Director Application to provision these bundles into your system.

For example:

d:\builder\eclipse.exe

   -application org.eclipse.equinox.p2.director.app.application
   -metadataRepository http://yourrepo.com
   -artifactRepository http://yourrepo.com
   -installIU yourIU
   -destination d:/yourapplication
   -profile SDKProfile
   -vmArgs
   -Declipse.p2.data.area=d:/yourapplication/p2

In this case, you are using the director application to install yourIU (likely a bundle or feature you created) in to your application.  The profile option allows you to create a number of different profiles, each containing a different set of bundles.  Finally, the p2 data area is the place on disk that holds all the p2 information (such as profile information).

In addition to the director application, you can even reuse the p2 bundles within your OSGi based application to provide automatic updates, customizable profiles and a wide range of other provisioning operations. 

What’s even more powerful, is you can use p2 for non-osgi based systems. That’s right, you can install your favorite RPMs, Debs or even MSI (Windows Installer) based applications using p2. 

With today’s historic visit in Ottawa (members of the Mozilla team traveling to Ottawa to meet with Boris and Simon), here is an interesting exercise:  see if we can use p2 to manage  firefox extensions.

on Feb 19th, 2009Runtime (r)evolution demo taking shape

600x96 Runtime (r)evolution demo taking shape

We have this count down timer around here that says 31 days to EclipseCon (have you registered yet?). Frankly that scares me silly. There are a huge number of things to do in the projects, in EclipseSource and not the least of which, for my Runtime (r)evolution talk. Over the past day some real progress was made on the latter.

The idea for this talk came from discussions at the Eclipse Summit Europe RT Symposium held last November. There we had a great group of people talking about all things runtime. One of the recuring issues discussed was the lack of examples and demos that pull the story together. Also at ESE we had an Equinox Hackathon. The idea was a bit of an experiment. Give people a base of code to add to rather than having everyone start with Equinox and OSGi from scratch–you get instant gratification by putting your favorite technology in the context of an existing application and scenario.

The Runtime (r)evolution talk combines the problem with the experiment. In a sense, the talk actually a long demo that paints a vision of what you can do with Equinox and the runtime technologies from Eclipse. Folks from Equinox, ECF, RAP, BIRT, EclipseLink and EPP are pitching in to showcase their technology. Yesterday the ball really started rolling with several group discussions and brainstorming sessions. Code is starting to come together.

Everything in the demo is based on Toast, the telematics example application we are using in the upcoming Equinox and OSGi book. The core of this is a car infotainment unit and a back end server that interact. From that humble beginning the demo shows how to add in all manner of things from VOIP, AJAX, reporting, scalable databases, Equinox server side, p2 provisioning and of course, RFC 119 distributed services.

In addition to whether or not we can pull this off is how to present it. There are so many systems and machines involved, doing it live is, well terrifying. I’m thinking that it will be better to record and playback with the talk. That would make the talk go more smoothly but we gotta avoid making it look “canned”. In any event, I’m going to post bits of the demo leading up to the conference to get feedback and incorporate new ideas.

It’s going to be a great conference. Register now and we’ll see you there.

on Feb 18th, 2009Mike Wilson: New Eclipse PMC lead

Those of you following the recent discussion in the Eclipse PMC mailing list will know that Philippe Mulet, our fearless leader is changing his focus some. Philippe has done a great job over the past couple years keeping the project and the PMC running smoothly.  PMC leadership is a hard, often administrative role and Philippe has done a great job.

Looking forward, the Eclipse PMC unanimously nominated and elected Mike Wilson to take over from Philippe. As per the Eclipse by-laws, the Board of Directors today confirmed Mike as the Eclipse PMC lead.

Mike is another of the Eclipse originals and has had a hand in many different parts of the project. Most recently he has been focusing on e4. His efforts at community building and making tangible progress are really showing fruit now with the first milestone of e4 and a great (and large) list of contributors.

I know that Mike will do a great job and am pleased that he has agreed to take over. It is an exciting time for the Eclipse project in many different ways. Thanks Philippe and congratulations Mike.

on Feb 17th, 2009PDE API Tools and Usage Scans

The PDE team has been busy at work for the Eclipse 3.5M6 milestone, from revamping the target platform story to product definition enhancements. One of my favorite upcoming enhancements comes from the API Tools part of PDE, we are enhancing API Tools to do usage scanning. What does this mean? Well, let’s turn this into a story.

Let’s pretend I’m Darin Swanson, the lead of the Eclipse Platform Ant project in Eclipse. I want to answer the question of who is using any of my API, or even better, internal code. To answer this question, I would head over to one of the usage reports from API Tools (this particular one is done against the 3.4.1 release of the Eclipse SDK).

apitools1 300x196 PDE API Tools and Usage Scans

As Darin, I would cruise over to the projects I’m responsible for… in this case I see the org.eclipse.ant.core and org.eclipse.ant.ui bundles. If I peek at org.eclipse.ant.core first, I see three bundles referencing me:

apitools2 300x97 PDE API Tools and Usage Scans

Those references look fine to me, no one is using internal APIs except org.eclipse.ant.ui but that’s fine since the internal references are permissible (via x-friends). Let’s check out how org.eclipse.ant.ui is doing:

apitools3 300x82 PDE API Tools and Usage Scans

Uh oh, looks like there’s some trouble here. The org.eclipse.pde.ui bundle (doh!) is referencing some internal APIs from the org.eclipse.ant.ui bundle. If we drill down further, we see the guilty references:

apitools4 300x41 PDE API Tools and Usage Scans

Kind of cool huh? The usage scan tooling is still in the early stages, but we hope to make more progress at the Eclipse 3.5 release comes to a close. I guess the only bad thing about this particular example was that I found myself guilty for referencing internal APIs, but it goes to show you that it’s pretty easy to do this. Now that Darin knows that I’m referencing internal APIs from Platform Ant, maybe we could spark a conversation of how to make new API or give me an alternative route that’s public API friendly.

In the end, as a developer, the usage scan tooling enables me to find out who is referencing my code across a set of bundles. On a side note, it would be really interesting to see a usage scan across the whole Galileo release. We could have a contest for the bundle who has the most abused internal references!

on Feb 17th, 2009Unit testing revelations

The other day I experienced an unexpected light bulb moment concerning unit testing. Maybe this one is obvious to most of you, but I wish someone would have told me earlier. So here goes.

My biggest gripes with unit testing has been that I couldn’t get any satisfactory answers to these two questions:

  1. Why should I practice Test-First?
  2. How do you test the tests?

Concerning the first issue, well we discussed some papers that where trying to answer that question when I attended a software quality course at university. The gist of the results were: There is no statistically significant difference in code quality between Test-First and and Test-Later. (Sorry can’t find links to the papers atm. Holler if you want me to find them and I’ll do some more digging.)

The second issue is discussed often as well: If tests are code and code should be tested, doesn’t that lead to more and more tests? This is sometimes referred to as the stack overflow of unit testing.

The revelation I had was this: These two questions answer each other! What’s the easiest way to test a test? A broken implementation. Where do you get a broken implementation? Just use an incomplete implementation. If you practice  Test-First all your implementations start off incomplete by definition. This means that each assertion in your test is guaranteed to fail at least once, giving you the confidence that the assertions actually perform significant work.

I am often surprised that assertions that I expect to fail actually go through just fine. This usually means one of two things: Either the functionality is already there by some fluke (cf. accidental correctness), or my test is incorrect. In either case I can then fine-tune and adapt the assertions to make sure that they fail and thus test some missing functionality.

Two conundrums solved.

on Feb 16th, 2009Extending p2 for fun and profit

On Monday March 23rd at EclipseCon, I’m helping to deliver a tutorial on one of the most significant platform-level changes made in the Eclipse Ganymede release. The tutorial is on p2, the new provisioning platform.  The tutorial is being prepared and presented by many of the core p2 developers, including Pascal Rapicault (p2 team lead), Jeff McAffer (Equinox co-lead and Eclipse PMC member) and Andrew Niefer (King of PDE Build).  As the new-kid-on-the-block, I hope to bring a different spin to the tutorial.  Over the past 3 months I have been learning the ins-and-outs of p2, understanding the difference between and UIs and IUs, and even hacking code in the IU UI icon smile Extending p2 for fun and profit .  I understand how daunting new technology can be, especially technology littered with acronyms and unfamiliar metaphors.

Over the next few weeks, I will be putting together content for this tutorial, but first I would like to hear from you. What would you like to see in a p2 tutorial? What are the most important concepts that we should cover?

on Feb 12th, 2009OSGi Tooling Summit

I recently blogged how excited I was about the OSGi Tooling BOF at EclipseCon, but it seems that the OSGi Alliance has outdone itself. The alliance is hosting an OSGi Tooling Summit right after EclipseCon 2009.

toolsummit 300x77 OSGi Tooling Summit

Jeff McAffer and I will be attending from EclipseSource. Personally, I’m excited to hear everyone’s position statements and how we can move forward, working together. Jeff and I will try to offer an interesting perspective coming from Eclipse land since we’ve been tooling plug-ins (bundles) before they were in vogue icon smile OSGi Tooling Summit

What do people from the Eclipse or OSGi communities think is missing from the OSGi Tooling story so far?

on Feb 10th, 2009The first e4 milestone

Wow, I just saw the new and noteworthy posted for the first e4 milestone. There’s a lot of stuff there! I’m amazed that the e4 team was able to get this milestone out given that a lot of them were also working on the Eclipse 3.5M5 release.

Anyways, here are some of my favorite noteworthy items:

CSS Support for SWT

css swt editor 300x285 The first e4 milestone

RCP Mail CSS Example

css rcp example 300x282 The first e4 milestone

SWT Browser Edition

controlexample 273x300 The first e4 milestone

Heck, there’s even a basic ActionScript development environment… cross-compilation debugger magic!

If you like what you see, why not get involved with the e4 project to help shape the future of Eclipse!

on Feb 10th, 20097 Years of Eclipse

I saw this today InfoQ.   In this video, Erich talks about the Eclipse Way process and how the Eclipse development process evolved over the years. As well, he talks about the importance of API, components and shipping on time. There is bit of information on Jazz (the last 15 minutes), but the first 45 minutes is a great retrospective on Eclipse over the past 7 years.

on Feb 8th, 2009Tip: The Configure Menu

In the Eclipse 3.5 release (Galileo), there’s a new way for you to contribute project related actions (e.g., adding natures). Traditionally, people have contributed project related actions at the root of the menu. However, this can easily flood your menu when you right click a project in a large Eclipse install. A solution for this problem is the new Configure menu entry. Within PDE, we have already adopted this for our plug-in project conversion actions:

configuremenu 300x242 Tip: The Configure Menu

While this may not be a large change, it’s helpful to some adopters of Eclipse. In the end, it’s simple to adopt this for your existing contributions, so feel free to do so when you are targeting Galileo. I hope in the future, something like the Faceted Project framework comes to live in the Eclipse platform to alleviate the pain of managing project-related functionality.

© EclipseSource 2008 - 2011