Skip to content

Commit 0e32098

Browse files
committed
Renamed relevant references of relationships to associations
As we've worked to disambiguate the term "relationships" from "collections" (1daf799) and "relationships" (191262a) by establishing the more general term "associations", we should update the XML Docs to maintain this nomenclature. Most of these are not references to e.g. the `AssociationTypes` enum, but rather discuss the concept in more abstract terms. By consistently using "associations" here instead of "relationships", we help reinforce the preferred vocabulary, and reduce ambiguities. This update required care to differentiate between references to "relationship" that referred to the broader concept, and references to "relationship" that referred, specifically, to e.g. `Topic.Relationships`, as the latter should be retained.
1 parent acb64e9 commit 0e32098

18 files changed

Lines changed: 79 additions & 82 deletions

OnTopic.Data.Sql/SqlDataReaderExtensions.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ internal static class SqlDataReaderExtensions {
3939
\-------------------------------------------------------------------------------------------------------------------------*/
4040
/// <summary>
4141
/// Given a <see cref="IDataReader"/> from a call to the <c>GetTopics</c> stored procedure, will extract a list of
42-
/// topics and populate their attributes, relationships, and children.
42+
/// topics and populate their attributes, associations, and children.
4343
/// </summary>
4444
/// <param name="reader">The <see cref="IDataReader"/> with output from the <c>GetTopics</c> stored procedure.</param>
4545
/// <param name="referenceTopic">
46-
/// When loading a single topic or branch, offers a reference topic graph that can be used to ensure that topic references
47-
/// and relationships, including <see cref="Topic.Parent"/>, are integrated with existing entities.
46+
/// When loading a single topic or branch, offers a reference topic graph that can be used to ensure that topic
47+
/// associations—such as references, relationships, and <see cref="Topic.Parent"/>are integrated with existing entities.
4848
/// </param>
4949
/// <param name="markDirty">
5050
/// Specified whether the target collection value should be marked as dirty, assuming the value changes. By default, it
@@ -394,7 +394,7 @@ private static void SetRelationships(this IDataReader reader, TopicIndex topics,
394394
/// Adds topic references to their associated topics.
395395
/// </summary>
396396
/// <remarks>
397-
/// Topics can be cross-referenced with each other topics via a one-to-one relationships. Once the topics are populated in
397+
/// Topics can be cross-referenced with each other topics via a one-to-one associations. Once the topics are populated in
398398
/// memory, loop through the data to create these associations.
399399
/// </remarks>
400400
/// <param name="reader">The <see cref="IDataReader"/> with output from the <c>GetTopics</c> stored procedure.</param>
@@ -411,7 +411,7 @@ private static void SetReferences(this IDataReader reader, TopicIndex topics, bo
411411
| Identify attributes
412412
\-----------------------------------------------------------------------------------------------------------------------*/
413413
var sourceTopicId = reader.GetTopicId("Source_TopicID");
414-
var relationshipKey = reader.GetString("ReferenceKey");
414+
var referenceKey = reader.GetString("ReferenceKey");
415415
var targetTopicId = reader.GetNullableTopicId("Target_TopicID");
416416

417417
/*------------------------------------------------------------------------------------------------------------------------
@@ -432,9 +432,9 @@ private static void SetReferences(this IDataReader reader, TopicIndex topics, bo
432432
}
433433

434434
/*------------------------------------------------------------------------------------------------------------------------
435-
| Set relationship on object
435+
| Set reference on object
436436
\-----------------------------------------------------------------------------------------------------------------------*/
437-
current.References.SetValue(relationshipKey, referenced, markDirty);
437+
current.References.SetValue(referenceKey, referenced, markDirty);
438438

439439
}
440440

OnTopic.Data.Sql/SqlTopicRepository.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ public override Topic Load(int topicId, DateTime version, Topic? referenceTopic
207207
);
208208

209209
/*------------------------------------------------------------------------------------------------------------------------
210-
| Clear relationships, topic references
210+
| Clear associations
211211
>-------------------------------------------------------------------------------------------------------------------------
212212
| Because we don't (currently) track version as part of the .NET data model for relationships or topic references, there's
213-
| no easy way to determine if a relationship should be deleted when doing a rollback. As such, existing relationships
213+
| no easy way to determine if an association should be deleted when doing a rollback. As such, existing associations
214214
| should be deleted, assuming a `referenceTopic` is passed, and it contains the `topicId`.
215215
\-----------------------------------------------------------------------------------------------------------------------*/
216216
var topic = (Topic?)null;
@@ -375,7 +375,7 @@ bool persistRelationships
375375
/*------------------------------------------------------------------------------------------------------------------------
376376
| Detect whether anything has changed
377377
>-------------------------------------------------------------------------------------------------------------------------
378-
| If no relationships have changed, and no attributes values have changed, and there aren't any mismatched attributes in
378+
| If no associations have changed, and no attributes values have changed, and there aren't any mismatched attributes in
379379
| their respective lists, then there isn't anything new to persist to the database, and thus no benefit to executing the
380380
| current command. A more aggressive version of this would wrap much of the below logic in this, but this is just meant
381381
| as a quick fix to reduce the overhead of recursive saves.

OnTopic.Tests/BindingModels/InvalidRelationshipBaseTypeTopicBindingModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace OnTopic.Tests.BindingModels {
1414
| BINDING MODEL: RELATIONSHIP BASE TYPE TOPIC (INVALID)
1515
\---------------------------------------------------------------------------------------------------------------------------*/
1616
/// <summary>
17-
/// Provides a custom binding model with an invalid base type for a relationship—i.e., one that doesn't implement the <see
17+
/// Provides a custom binding model with an invalid base type for an association—i.e., one that doesn't implement the <see
1818
/// cref="IRelatedTopicBindingModel"/>. An <see cref="InvalidOperationException"/> should be thrown when it is mapped.
1919
/// </summary>
2020
/// <remarks>

OnTopic.Tests/TopicTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ public void BaseTopic_UpdateValue_ReturnsExpectedValue() {
298298
| TEST: BASE TOPIC: RESAVED VALUE: RETURNS EXPECTED VALUE
299299
\-------------------------------------------------------------------------------------------------------------------------*/
300300
/// <summary>
301-
/// Sets a base topic to an unsaved topic entity, then saves the entity and reestablishes the relationship. Ensures
302-
/// that the base topic is correctly set as a <see cref="Topic.References"/> entry.
301+
/// Sets a base topic to an unsaved topic entity, then saves the entity and reestablishes the reference. Ensures that the
302+
/// base topic is correctly set as a <see cref="Topic.References"/> entry.
303303
/// </summary>
304304
[TestMethod]
305305
public void BaseTopic_ResavedValue_ReturnsExpectedValue() {

OnTopic/Collections/Specialized/ReadOnlyTopicMultiMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public ReadOnlyTopicCollection GetAllTopics() =>
135135
new(Source.SelectMany(list => list.Values).Distinct().ToList());
136136

137137
/// <summary>
138-
/// Retrieves a list of all related <see cref="Topic"/> objects, independent of relationship key, filtered by content
138+
/// Retrieves a list of all related <see cref="Topic"/> objects, independent of key, filtered by content
139139
/// type.
140140
/// </summary>
141141
/// <returns>

OnTopic/Collections/Specialized/TopicMultiMap.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public bool Remove(string key, Topic topic) {
119119
}
120120

121121
/*------------------------------------------------------------------------------------------------------------------------
122-
| Remove relationship
122+
| Remove topic
123123
\-----------------------------------------------------------------------------------------------------------------------*/
124124
topics.Remove(topic);
125125

OnTopic/Mapping/Annotations/AssociationTypes.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public enum AssociationTypes {
101101
| ALL
102102
\-------------------------------------------------------------------------------------------------------------------------*/
103103
/// <summary>
104-
/// Map all relationship types.
104+
/// Map all association types.
105105
/// </summary>
106106
All = Parents | Children | Relationships | IncomingRelationships | MappedCollections | References
107107

OnTopic/Mapping/Annotations/CollectionAttribute.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,15 @@ namespace OnTopic.Mapping.Annotations {
1010
| ATTRIBUTE: COLLECTION
1111
\---------------------------------------------------------------------------------------------------------------------------*/
1212
/// <summary>
13-
/// Provides the <see cref="ITopicMappingService"/> with instructions as to which key to follow for the relationship.
13+
/// Provides the <see cref="ITopicMappingService"/> with instructions as to which collection to map to.
1414
/// </summary>
1515
/// <remarks>
1616
/// <para>
1717
/// By default, <see cref="ITopicMappingService"/> implementations will attempt to map a collection property to the first
18-
/// relationship it finds with a key that matches the property name. For example, if a property is named "Categories" it
19-
/// will first look in <see cref="Topic.Relationships"/> for a relationship named "Categories", then it will search <see
20-
/// cref="Topic.Children"/> for a set of nested topics, and finally <see cref="Topic.IncomingRelationships"/>.
18+
/// collection it finds with a key that matches the property name. For example, if a property is named <c>Categories</c>
19+
/// it will first look in <see cref="Topic.Relationships"/> for a relationship named <c>Categories</c>, then it will
20+
/// search <see cref="Topic.References"/>, then <see cref="Topic.Children"/> for a set of nested topics, and finally <see
21+
/// cref="Topic.IncomingRelationships"/>.
2122
/// </para>
2223
/// <para>
2324
/// This attribute instructs the <see cref="ITopicMappingService"/> to instead look for a specified key. This allows the
@@ -36,7 +37,7 @@ public sealed class CollectionAttribute : System.Attribute {
3637
/// <summary>
3738
/// Annotates a property with the <see cref="CollectionAttribute"/> by providing an <paramref name="key"/>.
3839
/// </summary>
39-
/// <param name="key">The key value of the relationships associated with the current property.</param>
40+
/// <param name="key">The key value of the collection associated with the current property.</param>
4041
public CollectionAttribute(string key) {
4142
TopicFactory.ValidateKey(key, false);
4243
Key = key;
@@ -45,7 +46,7 @@ public CollectionAttribute(string key) {
4546
/// <summary>
4647
/// Annotates a property with the <see cref="CollectionAttribute"/> by providing the <see cref="CollectionType"/>.
4748
/// </summary>
48-
/// <param name="type">Optional. The type of collection the relationship is associated with.</param>
49+
/// <param name="type">Optional. The type of collection the collection is associated with.</param>
4950
public CollectionAttribute(CollectionType type = CollectionType.Any) {
5051
Type = type;
5152
}

OnTopic/Mapping/Annotations/FilterByAttributeAttribute.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ namespace OnTopic.Mapping.Annotations {
1313
/// Flags that a collection property should be filtered by a specified <c>attributeKey</c> and <c>attributeValue</c>.
1414
/// </summary>
1515
/// <remarks>
16-
/// By default, <see cref="ITopicMappingService"/> will add any corresponding relationships to a collection, assuming they
17-
/// are assignable to the collection's base type. With the <c>[FilterByAttribute(attributeKey, attributeValue)]</c>
18-
/// attribute, the collection will instead be filtered to only those topics that have the specified attribute value
19-
/// assigned.
16+
/// By default, <see cref="ITopicMappingService"/> will add any corresponding topics to a collection, assuming they are
17+
/// assignable to the collection's base type. With the <c>[FilterByAttribute(attributeKey, attributeValue)]</c> attribute,
18+
/// the collection will instead be filtered to only those topics that have the specified attribute value assigned.
2019
/// </remarks>
2120
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=true, Inherited=true)]
2221
public sealed class FilterByAttributeAttribute : System.Attribute {

OnTopic/Mapping/Annotations/FilterByContentType.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ namespace OnTopic.Mapping.Annotations {
1313
/// Flags that a collection property should be filtered by a specified <c>ContentType</c>.
1414
/// </summary>
1515
/// <remarks>
16-
/// By default, <see cref="ITopicMappingService"/> will add any corresponding relationships to a collection, assuming they
17-
/// are assignable to the collection's base type. With the <c>[FilterByContentType(contentType)]</c> attribute, the
18-
/// collection will instead be filtered to only those topics that have the specified content type.
16+
/// By default, <see cref="ITopicMappingService"/> will add any corresponding topic to a collection, assuming they are
17+
/// assignable to the collection's base type. With the <c>[FilterByContentType(contentType)]</c> attribute, the collection
18+
/// will instead be filtered to only those topics that have the specified content type.
1919
/// </remarks>
2020
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=true, Inherited=true)]
2121
public sealed class FilterByContentTypeAttribute : System.Attribute {

0 commit comments

Comments
 (0)