Problem/Motivation

Workspace publisher and merger can't be overridden/injected without also creating a custom WorkspaceOperationFactory

Steps to reproduce

Proposed resolution

Workspace publisher and merger should be services.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Comments

djdevin created an issue. See original summary.

djdevin’s picture

Issue summary: View changes
taraskorpach’s picture

I suppose we cannot implement a factory completely based on the container.

We could add a method called setSource() to the WorkspacePublisher, in which we might set the needed Workspace to the publisher property.

In the WorkspaceOperationFactory, we should call the new service for WorkspacePublisher like "workspaces.publisher" and then call the method setSource() from itself.

Finally, the new method getPublisher() of WorkspaceOperationFactory should look like:

public function getPublisher(WorkspaceInterface $source) {
    return $this->publisher->setSource($source);
}

Please explain if we could use the DI factory pattern here or review my approach.