[CSHARP-1809] Consider allowing to implement the GridFSUploadStream[<>] and GridFSDownloadStream[<>] Created: 25/Oct/16 Updated: 27/Jan/22 Resolved: 27/Jan/22 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | API, GridFS |
| Affects Version/s: | 2.3 |
| Fix Version/s: | 2.15.0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aristarkh Zagorodnikov | Assignee: | James Kovacs |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Description |
|
Currently, the IGridFSBucket[<>] interfaces expose methods that return instances of the GridFSUploadStream[<>] and GridFSDownloadStream[<>] abstract classes. Unfortunately, their constructors are internal, so decoration of IGridFSBucket[<>] that requires decoration of returned streams is impossible, because one cannot inherit from a class with an internal constructor. This is disappointing, especially given that other interfaces (collection, database, client, etc.) are very much decoratable and look carefully desigined. While I understand that there might be compelling reasons for this, that are unknown to me, I ask you to consider removing the internal constructor to allow inheritance and, hence, decoration of the GridFS-related interfaces, especially since this does not look like a breaking change. |
| Comments |
| Comment by James Kovacs [ 27/Jan/22 ] |
|
Please note that we do not recommend or encourage mocking third-party dependencies such as the driver. Much has been written on the subject by TDD/BDD practitioners over the years and why it is considered an anti-pattern. If you feel the need to mock a third-party dependency, it is often better to wrap it in an adapter allowing you to mock the adapter (which you do own) and integration test the adapter with the actual dependency. |
| Comment by Githook User [ 27/Jan/22 ] |
|
Author: {'name': 'Brian Pickens', 'email': '3659859+brian-pickens@users.noreply.github.com', 'username': 'brian-pickens'}Message: |
| Comment by Githook User [ 27/Jan/22 ] |
|
Author: {'name': 'Brian Pickens', 'email': '3659859+brian-pickens@users.noreply.github.com', 'username': 'brian-pickens'}Message: |