Page MenuHomePhabricator

Use micro services instead of singletons in Core library
Closed, WontfixPublic

Description

See change request wiki page for details.

Event Timeline

I started working on this change and want to get your opinion on how to proceed. This is what I solved so far:

  • mitk::CoreActivator now instantiates TestingRenderingManager as org.mitk.core.RenderingManager.
  • RenderingManager::GetInstance uses module context to resolve its instance.
  • QmitkActivator is new and registers a QmitkRenderingManager as org.mitk.core.RenderingManager, with higher priority than the core one.
  • The necessary changes seemed straight forward and the code is becomes more consistent

A problem that I encountered was a series of static members around the event handling classes.. These were (partly?) not yet initialized before they were first accessed.

As I had no other fast solution, I just replaced these members with static Get-Methods which hold a local static variable. This makes sure that initialization HAS happened when the variable is first accessed.

I guess the only clean solution would be to find out what our core singletons interact with during construction and just change these related classes, because there is too much static in total. Do you see a different solution??

Also, the branch bug-10271-micro-services currently crashes (when clicking a render window) and is a little hard to figure out

I left this ticket as it is for too long. MicroServices are now used in some places in MITK, are popular and well established. This ticket is obsolete

You probably mixed up some bug numbers :-)

Reopening this one since I cannot find your changes in the MITK master and as far as I remember there were still some issues which needed more discussion.

kislinsk claimed this task.
kislinsk added a subscriber: kislinsk.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.