Skip to content

Commit

Permalink
add custom equality check
Browse files Browse the repository at this point in the history
  • Loading branch information
badetitou committed Jul 25, 2024
1 parent cfe005c commit 1936da3
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions moose-wiki/Developers/create-new-metamodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ These are described in [another page](predefinedEntities) ![Unfinished](https://
- [Generating default attribute value](#generating-default-attribute-value)
- [Generating test method](#generating-test-method)
- [Generating Famix Group](#generating-famix-group)
- [Generating Custom equality check](#generating-custom-equality-check)
- [Introducing submetamodels](#introducing-submetamodels)
- [Set up submetamodels](#set-up-submetamodels)
- [Define remote entities and traits](#define-remote-entities-and-traits)
Expand Down Expand Up @@ -409,6 +410,19 @@ MooseSpecializedGroup subclass: #FamixJavaClassGroup
package: 'Famix-Java-Entities-Entities'
```

### Generating Custom equality check

You might want (for instance, for optimization purpose) to change the equality check of two model entities.
To do so, you can use the `withEqualityCheckOn:` method and a collection of **properties** to check on.

```st
person property: #firstName type: #String.
person property: #lastName type: #String.
person property: #age type: #Number.
person withEqualityCheckOn: { #firstName. #lastName. #age }.
```

> If you need more deeper comparison, look at the FamixDiff project
## Introducing submetamodels

Expand Down

0 comments on commit 1936da3

Please sign in to comment.