[
https://issues.apache.org/jira/browse/GEODE-3977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16255799#comment-16255799
]
ASF GitHub Bot commented on GEODE-3977:
---------------------------------------
pivotal-jbarrett commented on a change in pull request #154: GEODE-3977:
Modifying the QueryService template
URL: https://github.com/apache/geode-native/pull/154#discussion_r151507780
##########
File path: clicache/src/QueryService.hpp
##########
@@ -51,7 +60,7 @@ namespace Apache
/// <summary>
/// Provides a query service.
/// </summary>
- generic<class TKey, class TResult>
+ generic<class TResult>
Review comment:
The more I think about it does it even make sense for the class itself to be
templated. Does the class itself depend in any way on the `TResult`. I think
the answer is no if you look at each method. The bulk of the methods are
factories for `Query<TResult>` and `CqQuery<TKey, TResult>`. So should have to
ask for a new `QueryService` every time I want to make new `Query` with a
different `TResult`? That seems wrong to me.
```
var qsString = cache.getQueryService<string>();
var qString = qsString.createQuery("....");
var qsInt = cache.getQueryService<int>)();
var qInt = qsInt.createQuery("...");
```
vs.
```
var qs = cache.getQueryService();
var qString = qs.createQuery<string>("....");
var qInt = qs.createQuery<int>("...");
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> .NET QueryService templating should match usage
> -----------------------------------------------
>
> Key: GEODE-3977
> URL: https://issues.apache.org/jira/browse/GEODE-3977
> Project: Geode
> Issue Type: Bug
> Components: native client
> Reporter: Ernest Burghardt
>
> QueryService uses generics
> generic<class TKey, class TResult>
> //generic<class TResult>
> Query<TResult>^ QueryService<TKey, TResult>::NewQuery(String^ query)
> but only TResult is used and this can be confusing to the user/developer...
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)