Draft
Conversation
…e added This allows: one cocnrete assoc in the ORIGINAL concrete to still match multiple associations while at the same time if "redundant" assocs for subtypes are defined in the reference CD these will be added to the concrete CD.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements implicit name adaptation for CD concretization/conformance: when a concrete type
name is derived from a reference type name (e.g.
AttackerfromObserver), element namescontaining the reference type name are automatically rewritten to use the concrete type name
(
observers→attackers,register(Observer o)→register(Attacker o)).Added
ADAPTED_NAME_MAPPINGCDConfParameter— opt-in flag enabling implicit name adaptation inconformance checking
AdaptedNameAttributeIncStrategy,AdaptedNameMethodIncStrategy,AdaptedRoleNameAssocIncStrategy— three new incarnation strategies that accept adaptednames as valid incarnations of reference elements
NameUtil.adaptTemplatedName— utility that applies three substitution patterns (exactsubstring, uncapitalized prefix, capitalized infix) to derive an adapted name from a reference
name and a type mapping
cddiff/doc/cdconcretization/:README.md— completion overview and configuration parameters referencefeature-implicit-name-adaptation.md— user-guide style handbook with CD examplesChanged
DefaultCDConformanceContext: registersAdaptedNameAttributeIncStrategy,AdaptedNameMethodIncStrategy, andAdaptedRoleNameAssocIncStrategywhenADAPTED_NAME_MAPPINGis set; attribute and method strategies intentionally use
compTypeIncStrategy(exactincarnation) rather than subtype matching to prevent supertypes from being accepted as adapted
incarnations of reference parameter types
BaseAttributeInTypeCompleter,BaseMethodInTypeCompleter: apply implicit nameadaptation when copying reference elements; add
<<ref>>stereotype only whenADAPTED_NAME_MAPPINGis not set (the strategy handles recognition instead)MissingAssociationsCDCompleter:complete()viaoriginalAssociations—only snapshot associations may suppress adding a new incarnation via inheritance; associations
added during the same pass cannot
INHERITANCEparameter_TypeNamesuffix on role names when implicit adaptation already produced a uniquename for the incarnation
MatchCDAssocsBySrcTypeAndTgtRole.checkReverse: fixed swapped argument order incheckRolecalls — the
srcside is now always passed first, consistent withcheck()and all subclassoverrides
Fixed
StereotypeUtil.addStereotype: prevented duplicate stereotypes being added during repeatedcompletion passes
DefaultAssocSideCompleter: role names copied from a reference association now get a freshlybuilt
CDRolenode instead of sharing the reference AST node, preventing one mapping pass frommutating the role seen by a subsequent pass
AdaptedRoleNameAssocIncStrategy(andImplicitRoleNameAssocIncStrategy): both nowcorrectly resolve concrete and reference types from the right CD in reverse-direction association
matching, following the
checkReversebase-class fix aboveTests
testAssocRoleImplicitNameAdaptation— role name adapted from reference type nametestAssocNameImplicitNameAdaptation— association name adapted from reference type nametestAssocBothSidesMI— multiple incarnations: suffix added only when adaptation did notalready produce a unique name
testAssocSubtypeAndSupertypeTarget— bothContainer→ItemandContainer→SpecialItemincarnations are always added even when
SpecialItem extends Item(regression test for theoriginalAssociationssnapshot fix)EvaluationConcretizationTest.Observer.mutualObservers— bidirectional two-mapping scenario:Attacker↔Defenderreceives role(attackers)fromref1and(defenders)fromref2