Buried in the depths of Eclipse Team (Sync), it can support UML Models after all.

The short lesson: When looking at eclipse features dig deep and work off the website and examples. Books are outdated quickly and are often written to just the major usage of a package or feature. Never be to proud to use the eclipse project specific mailing list.

The story: Whenever I take time off work, I invariably take on creating some new thing or read a technical book, basically just go down a rabbit hole of some kind as much of my day to day work requires abstraction from the details and hands on coding.

The Christmas 2009 break is no different. This time I dug a little deeper than I normally do with eclipse and plug-ins. I have been creating an eclipse plug-in to import UML objects from an outside server which houses use cases, requirements, and test cases. I figure why copy and paste or manually sync them which you can have a wizard done. Great so after a COM Bridge, EMF Transactions, UML Profile, and a shovel I have an import working. I did not do this in a vacuum, but instead have been going off, eclipse books, the eclipse.org dev websites etc. I had checked into Eclipse Team about 8 months back and found it was decidedly IResource (File/Folder/Project/WorkspaceRoot) limited as all of the methods seem to require IResource to operate. This lead me to just drop the "Syncronization" and Team approach to integrating UML models with outside data sources. Heck I figure even IBMs Rational suite has to do all the sub-file (UML object) comparisons with a comparitor, that must be it.

As I completed a workable Alpha of the importing plug-in and began to lust after the export, update, and delta features one expects when collaborating, I decided to double check that the Eclipse Team (CVS,SVN, etc) really would not work. Into the rabbit hole I went. This time as I went to the website and played with examples. They all showed promise as features had been added in recent releases. The org.eclipse.team.examples code is helpful for understanding this seriously complex package/feature. But more importantly there had been additions since 3.2 and how there seemed to be support for Logical Models. Great models are what I am doing.

So I really dig in. The trouble was that I cannot find a good example to how this would be done in a non trivial way. The example Logical Model code was trivial as each "Model Element" was still a IResource, so it did not show that this could be done. Even though they had in the API/Eclipse documentation mentioned Ecore models it all seemed to be still focused on IResources. Finally, however, I am convinced that the Logical Model Team feature set will meet the need of Syncing non-IResource model components, ie sub-file detail level representation. The wiki page about the team logical model objective said it most clearly.

The following paragraph, taken from the Eclipse 3.2 plan, describes the motivation for the logical model integration support that was added in Eclipse 3.2.

The Eclipse Platform supports a strong physical view of projects, files, and folders in the workspace. However, there are many situations where a physical view is not the most salient or useful for many purposes. In some cases, multiple distinct objects happen to be stored in a single file, like an archive. Conversely, in other cases, something that is logically a single object is stored across multiple files. This discrepancy between logical and physical creates problems for common operations such as searching, comparing, and versioning, which need to work in the physical realm. Eclipse should support some way of mapping between a logical view and the physical organization of files on disk.
At the beginning of the 3.2 development cycle, we captured the requirements from several clients in a requirements document.


And while I was writing this post I found THE emf example that has not been merged in with the other org.eclipse.team.examples, seriously, I can't even find an email dev list to post about this issue. Also, the link on that page is dead, I found the code in the CVS archive however.

So, hours of playing with the examples, running them in the debugger trying to figure out the slight of hand and object types being used, and reading pages of seemingly contradictory documentation, nearly giving up assuming that it must not work, only to search or dig just a little bit more and find out it is supported. I know way more about the Team feature set now then I actually need to know for writing the plug-in. Hopefully next time I will navigate the eclipse web a little more efficiently, or I am find a mailing list and enlist the help of others rather than just digging deeper into my rabbit hole alone, and even Google Search failed me.

Comments

Popular posts from this blog

Configuring Javascript SyntaxHighligher 3+ in a Blogger site

Common Misunderstanding of UML

Reference Cards, Cheat Sheets, Posters, whatever they are called.