Skip to content

Commit

Permalink
[699] Introduce an interface to persist RepresentationMetadata
Browse files Browse the repository at this point in the history
Bug: #699
Signed-off-by: Stéphane Bégaudeau <[email protected]>
  • Loading branch information
sbegaudeau committed May 11, 2022
1 parent 4df13d6 commit da7072e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ See ADR-54 for the details.
- https://github.com/eclipse-sirius/sirius-components/issues/1138[#1138] [workbench] The left and right panels can be closed by clicking on the current view's icon or by resizing them to the minimum widht (showing only the icons).
When closed, clicking on any of the views' icon will re-open the panel to make the selected view visible.
- https://github.com/eclipse-sirius/sirius-components/issues/689[#689] [diagram] Add a variable containing objects ids to render for unsynchronized nodes rendering
- https://github.com/eclipse-sirius/sirius-components/issues/699[#699] [core] Introduce an interface to let integrators persist `RepresentationMetadata`. Thanks to this first step, it should be soon possible to create representations which do not persist anything more than their metadata. Sirius Components will not provide an implementation of this interface since its behavior is specific to the persistence layer of the application integrating Sirius Components but it may start to use it soon. When this interface will be used, its implementation will be required by those who are integrating Sirius Components in their application. The `Form` representation may be a very good candidate for this interface. Widespread usage of this new interface should be the final nail necessary to remove the metadata fields from the representation objects (`Diagram`, `Form`, `Selection`, `Validation`, etc)

=== New features

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*******************************************************************************
* Copyright (c) 2022 Obeo.
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v2.0
* which accompanies this distribution, and is available at
* https://www.eclipse.org/legal/epl-2.0/
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
package org.eclipse.sirius.components.core.api;

import org.eclipse.sirius.components.core.RepresentationMetadata;

/**
* Used to persist representation metadata.
*
* @author sbegaudeau
*/
public interface IRepresentationMetadataPersistenceService {

void save(IEditingContext editingContext, RepresentationMetadata representationMetadata);

/**
* Implementation which does nothing, used for mocks in unit tests.
*
* @author sbegaudeau
*/
class NoOp implements IRepresentationMetadataPersistenceService {

@Override
public void save(IEditingContext editingContext, RepresentationMetadata representationMetadata) {
// Do nothing
}

}

}

0 comments on commit da7072e

Please sign in to comment.