Bug 487231 - Optional services
Summary: Optional services
Status: NEW
Alias: None
Product: Papyrus
Classification: Modeling
Component: Core (show other bugs)
Version: 1.2.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-04 08:20 EST by Christian Damus CLA
Modified: 2016-02-04 08:20 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Damus CLA 2016-02-04 08:20:43 EST
The current ServicesRegistry API does not provide for a notion of optional services, being services that are not required to be present for the correct and complete function of the Papyrus Editor.  This is most evident in the checked ServiceException that is always thrown on attempt to retrieve a service that is absent.

There are, in fact, services that are optional, and we have code that has to catch and ignore the exception as a signal that the service is missing and we therefore just won't do some operation on it.

The registry and utility APIs should be amended to provide for nullable (or perhaps better Optional<S>) result of getService(...).

Also, service registration on the extension point should allow for optional dependencies, which ensure reliable service ordering:  if A optionally depends on B, then when A starts it knows that B will be ready for it if B is present at all.