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 Apr 25, 2022
1 parent 0394367 commit 8f5fff1
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 @@ -38,6 +38,7 @@ This will allow us, when we will receive an operation to perform with a given re
- https://github.com/eclipse-sirius/sirius-components/issues/1165[#1165] [doc] Improve the pull request template
- https://github.com/eclipse-sirius/sirius-components/issues/1155[#1155] [workbench] The left and right panels now use a vertical bar of icons (instead of accordions) to select which view to display
- https://github.com/eclipse-sirius/sirius-components/issues/966[#966] [diagram] Add the support source and target edge position ratio on the frontend side. For further explanation see ADR-055.
- 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 8f5fff1

Please sign in to comment.