[CXX-1055] Add new read_preference setters that support method chaining, deprecate existing setters and constructors Created: 30/Sep/16 Updated: 07/Feb/17 Resolved: 07/Feb/17 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | API |
| Affects Version/s: | None |
| Fix Version/s: | 3.2.0-rc0 |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | J Rassi | Assignee: | Samuel Rossi (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
The design of the read_preference class could be improved to make it easier to add future additional options. We should consider the following concrete improvements:
Once these improvements are made, adding a new option to read_preference will only require adding a new getter and setter, and not touching any constructors. In addition, using method chaining, users will create simple read preferences with e.g. read_preference().mode(read_preference::read_mode::k_secondary), which is slightly more readable than read_preference(read_preference::read_mode::k_secondary). |
| Comments |
| Comment by Githook User [ 07/Feb/17 ] |
|
Author: {u'username': u'saghm', u'name': u'Saghm Rossi', u'email': u'saghmrossi@gmail.com'}Message: |