You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now there are some VERY strange things done in the OslcQueryResult. Some of them are the same strange things found in Lyo (strange on their own and more so in C#), some are even stranger:
RDF parsing method is marked with a synchronized thread safety flag while enumerators are almost never thread safe.
The .Current prop returns the OsclQueryResult for the NEXT page of results.
The OsclQueryResult directly implements the IEnumerator, which requires it to expose the methods that users should never call. This saves maybe one allocation but is really wrong (given that other more expensive things are not optimized).
The OsclQueryResult depends on the OslcClient. This is wrong for the result object to depend on a client and should not happen. Instead, we should consider OslcQuery to return some kind of OsclQueryResults object that has two props: .ResponseInfos (enumerable, not enumerator) and .QueryResponseInfo (ResponseInfo matching the query URI). Each ResponseInfo would have the .Pages enumerable property (of type OsclQueryResultPage) an async one that lazily yields the next page. .AllQueryResponseInfoPages could be added to help users avoid nested loops and extra if statements. Any enumerators should be hidden from the user.
The text was updated successfully, but these errors were encountered:
Right now there are some VERY strange things done in the OslcQueryResult. Some of them are the same strange things found in Lyo (strange on their own and more so in C#), some are even stranger:
.Current
prop returns theOsclQueryResult
for the NEXT page of results.OsclQueryResult
directly implements theIEnumerator
, which requires it to expose the methods that users should never call. This saves maybe one allocation but is really wrong (given that other more expensive things are not optimized).OsclQueryResult
depends on theOslcClient
. This is wrong for the result object to depend on a client and should not happen. Instead, we should considerOslcQuery
to return some kind ofOsclQueryResults
object that has two props:.ResponseInfos
(enumerable, not enumerator) and.QueryResponseInfo
(ResponseInfo matching the query URI). Each ResponseInfo would have the.Pages
enumerable property (of typeOsclQueryResultPage
) an async one that lazilyyield
s the next page..AllQueryResponseInfoPages
could be added to help users avoid nested loops and extra if statements. Any enumerators should be hidden from the user.The text was updated successfully, but these errors were encountered: