| Summary: | [selfhosting] refactor registry view model | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Jacek Pospychala <jacek.pospychala> | ||||||||||||||
| Component: | UI | Assignee: | Jacek Pospychala <jacek.pospychala> | ||||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||||
| Severity: | enhancement | ||||||||||||||||
| Priority: | P3 | CC: | caniszczyk | ||||||||||||||
| Version: | 4.0 | ||||||||||||||||
| Target Milestone: | 3.5 M3 | ||||||||||||||||
| Hardware: | PC | ||||||||||||||||
| OS: | Windows XP | ||||||||||||||||
| Whiteboard: | |||||||||||||||||
| Bug Depends on: | |||||||||||||||||
| Bug Blocks: | 243439, 249087 | ||||||||||||||||
| Attachments: |
|
||||||||||||||||
|
Description
Jacek Pospychala
Created attachment 109423 [details]
patch
Created attachment 109425 [details]
patch
wow you're fast attachment 1 [details] and attachment 2 [details] are the same thing. I had some problems with bugzilla when uploading them. Created attachment 109519 [details]
updated patch
refactoring continued. With this patch applied plug-in registry view still mostly works, there are however few things that got broken - I'll be fixing them in next days.
Done: almost all references to OSGi moved away from view class and content/label provider, view structuring and objects constructing is decoupled: first one in content provider, second one in model implementation. I like how simple now view classes look like.
To do: refactor event notification mechanism
Created attachment 109664 [details]
patch v3
Refactored notification mechanism into: local framework specific part (org.eclipse.pde.internal.runtime.registry.model.impl.local.RegistryBrowserListener) and view specific part (org.eclipse.pde.internal.runtime.registry.RegistryBrowserModelChangeListener).
It's very simple now and should work for changes related to Bundle, ServiceReference, IExtensionPoint, IExtension.
Created attachment 109665 [details]
tests
Today I have also worked on tests :)
There are some model and notifications tests.
Jacek, let me know when you think it's safe to review and commit to CVS. (In reply to comment #8) > Jacek, let me know when you think it's safe to review and commit to CVS. sure, I'm just attaching patch to monitor progress. any updates on this work Jacek? I'd like to have the model updates in for the M3 timeframe so we can spend time on looking at bug 243439 :) (In reply to comment #10) > any updates on this work Jacek? > > I'd like to have the model updates in for the M3 timeframe so we can spend time > on looking at bug 243439 :) > Thanks for reminder. The work here is mostly done, I'll try to get back to this in next couple of days. Thanks Jacek, I will get this in once you're ready. how are things going here? M3 is open for submissions now :) fyi, I'm writing tests for this code now. I'd like them to verify that runtime model correctly reflects the reality and change notification works. As soon as that's done, we can go forward with this patch. Hopefully that's one-two days. poke :) ok, so I have a refactored view impl, that I've used for a moment, and so far it looks good (read: works). The view works now as following: 1. RegistryView (class containing the Plug-in registry view itself) calls RegistryModelFactory to create a RegistryModel 2. RegistryModel stores Eclipse runtime model, so all bundles, extension points and services. It doesn't refer to any OSGi types, but just to POJO objects, so RegistryModel should be able to store information about any runtime, doesn't matter whether it's local or remote one. 3. RegistryModel uses RegistryBackend class to do any operations on real registry. For example RegistryBackend is queried for all plug-in data, it's also responsible for starting and stopping plug-ins on RegistryModel request. In other words, RegistryModel contains data and RegistryBackend performs operations. 4. There's only one RegistryBackend implementation now - LocalRegistryBackend. It basically uses OSGi API (Bundle, BundleContext, BundleListener) and Equinox Runtime (extension points registry). There's place to implement other RegistryBackends. Code needs a bit more comments and probably still a lot more polishing. Chris, could you review it and commit maybe somewhere around next week? Created attachment 115415 [details]
patch v4
Looks great! Jacek, can you also update the tests zip? I tried to apply it to pde.ui.tests but it was borked. I think a patch against org.eclipse.pde.ui.tests is fine. Just add pde.runtime as a dependency and go wild. I committed changes to HEAD. Can you please update the tests Jacek so I can add them too ;)? done.
> 20091020
(In reply to comment #19) > Can you please update the tests Jacek so I can add them too ;)? sorry the tests got bit outdated, I'll add them in separate bug until the end of week. (In reply to comment #21) > sorry the tests got bit outdated, I'll add them in separate bug until the end > of week. actually in bug 248924. |