[CSHARP-1123] Remove the ConnectionWrapper, ConnectionHandle and ReferenceCountedConnection classes Created: 20/Nov/14  Updated: 02/Apr/15  Resolved: 17/Dec/14

Status: Closed
Project: C# Driver
Component/s: Connectivity
Affects Version/s: None
Fix Version/s: 2.0

Type: Improvement Priority: Major - P3
Reporter: Robert Stam Assignee: Craig Wilson
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The ConnectionWrapper (and ConnectionHandle) classes are base classes that handle forwarding all properties and methods to the wrapped class. Derived classes only need to override the methods they are interested in and let the base class forward the rest.

But this is just implementation inheritance at heart. Also, if the derived classes end up overriding all the members then nothing was gained anyway (the derived class could just as easily have forward the intercepted members to a wrapped object as to the base class).

The ReferenceCountedConnection is also not really needed. We could use the ReferenceCounted<T> class instead.

Removing these classes would also bring this part of the code base more in line with how the rest of the code base is handling wrapping and reference counting.



 Comments   
Comment by Githook User [ 17/Dec/14 ]

Author:

{u'username': u'craiggwilson', u'name': u'Craig Wilson', u'email': u'craiggwilson@gmail.com'}

Message: CSHARP-1123: removed unnecessary classes after refactoring connection handle to use same pattern as elsewhere in code.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/291938ff93ab8b2b74c0717c04890945652a09c9

Generated at Wed Feb 07 21:38:43 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.