Commit 66ccd9d
committed
Merge branch 'feature/Relationships-abstraction' into develop
Previously, the `Topic.Relationships` implementation exposed a lot of members that weren't needed by most callers—and, in doing so, introduced the opportunity for backdoors that would inadvertently bypass state tracking and reciprocal relationship handling.
This is resolved by the introduction of the new `TopicRelationshipMultiMap` class (57ff3f9, 7129289) to replace the legacy `RelatedTopicCollection`. This offers a cleaner interface, and eliminates the risk of introducing bugs by writing to the internal collections directly, as the underlying data store is now hidden behind a façade. In addition, the underlying collections now allow relationships to different topics with the same `Topic.Key`—an unlikely scenario, but one which would previously cause problems.
Breaking Changes
- The `RelatedTopicCollection` and `NamedTopicCollection` previously used by `Topic.Relationships` have been replaced by `TopicRelationshipMultiMap` (57ff3f9, 7129289), `ReadOnlyTopicMultiMap` (eb5c1c3), and `TopicMultiMap` (d049ea9).
- Care was provided to maintain the overall interface, but calls to the underlying collections will have changed. Most notably, all write operations _must_ now go through `SetTopic()`, `RemoveTopic()`, or `ClearTopics()`.
- In addition, for callers iterating over the relationships, the relationship key is now `Key` not `Name`, the topics are now stored under a `Values` property, and the friendly interfaces require a fully-qualified `Topic`, instead of a `Topic.Key` (0d9dcd5).File tree
17 files changed
+1014
-913
lines changed- OnTopic.AspNetCore.Mvc/Controllers
- OnTopic.Data.Sql
- OnTopic.Tests
- OnTopic
- Collections
- Metadata
- References
- Repositories
17 files changed
+1014
-913
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | | - | |
| 239 | + | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
421 | | - | |
| 421 | + | |
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
| |||
654 | 654 | | |
655 | 655 | | |
656 | 656 | | |
657 | | - | |
| 657 | + | |
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| |||
This file was deleted.
0 commit comments