Skip to content

Commit c0b5d7d

Browse files
committed
Reintroduced Save() overload as [Obsolete]
The `Save(topic, isRecursive, isDraft)` signature was updated to remove the `isDraft` parameter. By reintroducing the original overload, we provide instructions to callers of the original method signature. In practice, we don't expect this to be a common scenario, as the `isDraft` functionality was never fully implemented, and is an artifact of OnTopic 2.x. Unfortunately, an `[Obsolete[]` member of an interface still needs to be implemented on each implementation of that interface. As such, we won't want to persist these for long after the migration to OnTopic 5.0.0. That said, fortunately, we expect all implementations of `ITopicRepository` to implement `ObservableTopicRepository` as a base class and, therefore, can implement these in that one location in order to cover all derived types (e.g., `SqlTopicRepository`, `CachedTopicRepository`, &c.) As this introduces ambiguities in the XML Doc references, those also needed to be updated to refer explicitly to the signature of the non-obsolete overload. That's probably a best practice anyway, so will be fine even after we remove the obsolete overload.
1 parent 78c8728 commit c0b5d7d

5 files changed

Lines changed: 21 additions & 13 deletions

File tree

OnTopic/Attributes/AttributeRecord.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ public AttributeRecord(
9393
/// <para>
9494
/// How an attribute is stored in the underlying repository doesn't impact how the attribute is treated as part of the
9595
/// object model. By tracking this, however, OnTopic is able to evaluate configuration mismatches during <see
96-
/// cref="ITopicRepository.Save"/>. This allows the <see cref="ITopicRepository"/> to effective handle scenarios where
97-
/// the configuration for an <see cref="AttributeDescriptor"/> has changed prior to the last time a <see cref="Topic"/>
98-
/// was saved, and thus change the location where it is stored.
96+
/// cref="ITopicRepository.Save(Topic, Boolean)"/>. This allows the <see cref="ITopicRepository"/> to effective handle
97+
/// scenarios where the configuration for an <see cref="AttributeDescriptor"/> has changed prior to the last time a <see
98+
/// cref="Topic"/> was saved, and thus change the location where it is stored.
9999
/// </para>
100100
/// <para>
101101
/// This is important because, otherwise, <see cref="ITopicRepository"/> implementations rely primarily on <see

OnTopic/Obsolete/Attributes/AttributeValue.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,9 @@ internal AttributeValue(
194194
/// <para>
195195
/// How an attribute is stored in the underlying repository doesn't impact how the attribute is treated as part of the
196196
/// object model. By tracking this, however, OnTopic is able to evaluate configuration mismatches during <see
197-
/// cref="ITopicRepository.Save"/>. This allows the <see cref="ITopicRepository"/> to effective handle scenarios where
198-
/// the configuration for an <see cref="AttributeDescriptor"/> has changed prior to the last time a <see cref="Topic"/>
199-
/// was saved, and thus change the location where it is stored.
197+
/// cref="ITopicRepository.Save(Topic, Boolean)"/>. This allows the <see cref="ITopicRepository"/> to effective handle
198+
/// scenarios where the configuration for an <see cref="AttributeDescriptor"/> has changed prior to the last time a <see
199+
/// cref="Topic"/> was saved, and thus change the location where it is stored.
200200
/// </para>
201201
/// <para>
202202
/// This is important because, otherwise, <see cref="ITopicRepository"/> implementations rely primarily on <see

OnTopic/Repositories/ITopicRepository.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ public interface ITopicRepository {
176176
/// <exception cref="ArgumentNullException">topic</exception>
177177
void Save(Topic topic, bool isRecursive = false);
178178

179+
/// <inheritdoc cref="Save(Topic, Boolean)"/>
180+
[Obsolete("The 'isDraft' argument of the Save() method has been removed.")]
181+
int Save(Topic topic, bool isRecursive, bool isDraft);
182+
179183
/*==========================================================================================================================
180184
| METHOD: MOVE
181185
\-------------------------------------------------------------------------------------------------------------------------*/

OnTopic/Repositories/ObservableTopicRepository.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,10 @@ public event EventHandler<TopicRenameEventArgs>? TopicRenamed {
236236
/// <inheritdoc />
237237
public abstract void Save(Topic topic, bool isRecursive = false);
238238

239+
/// <inheritdoc cref="Save(Topic, Boolean)"/>
240+
[Obsolete("The 'isDraft' argument of the Save() method has been removed.")]
241+
public int Save(Topic topic, bool isRecursive, bool isDraft) => throw new NotImplementedException();
242+
239243
/*==========================================================================================================================
240244
| METHOD: MOVE
241245
\-------------------------------------------------------------------------------------------------------------------------*/

OnTopic/Topic.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,13 +684,13 @@ public void MarkClean(string key, bool includeCollections) {
684684
/// The underlying value of the <see cref="BaseTopic"/> is stored as a topic reference with the <see cref="KeyValuesPair
685685
/// {String, Topic}.Key"/> of <c>BaseTopic</c> in <see cref="Topic.References"/>. If the <see cref="Topic"/> hasn't been
686686
/// saved, then the reference will be established, but the <c>BaseTopic</c> won't be persisted to the underlying
687-
/// repository upon <see cref="Repositories.ITopicRepository.Save"/>. That said, when <see cref="Repositories.
688-
/// ITopicRepository.Save(Topic, Boolean)"/> is called, the <see cref="BaseTopic"/> will be reevaluated and, if it has
689-
/// subsequently been saved, and the <c>BaseTopic</c> will be updated accordingly. This allows in-memory topic graphs to
690-
/// be constructed, while preventing invalid <see cref="Topic.Id"/>s from being persisted to the underlying data
691-
/// storage. As a result, however, a <see cref="Topic"/> referencing an <see cref="BaseTopic"/> that is unsaved will
692-
/// need to be saved again once the <see cref="BaseTopic"/> has been saved, assuming it's otherwise outside the scope of
693-
/// the original <see cref="Repositories.ITopicRepository.Save(Topic, Boolean)"/> call.
687+
/// repository upon <see cref="Repositories.ITopicRepository.Save(Topic, Boolean)"/>. That said, when <see cref="
688+
/// Repositories.ITopicRepository.Save(Topic, Boolean)"/> is called, the <see cref="BaseTopic"/> will be reevaluated
689+
/// and, if it has subsequently been saved, and the <c>BaseTopic</c> will be updated accordingly. This allows in-memory
690+
/// topic graphs to be constructed, while preventing invalid <see cref="Topic.Id"/>s from being persisted to the
691+
/// underlying data storage. As a result, however, a <see cref="Topic"/> referencing an <see cref="BaseTopic"/> that is
692+
/// unsaved will need to be saved again once the <see cref="BaseTopic"/> has been saved, assuming it's otherwise outside
693+
/// the scope of the original <see cref="Repositories.ITopicRepository.Save(Topic, Boolean)"/> call.
694694
/// </para>
695695
/// </remarks>
696696
/// <value>The <see cref="Topic"/> that values should be inherited from, if not otherwise available.</value>

0 commit comments

Comments
 (0)