Comments (3)
Following our discussion: while this solution indeed have some benefits, I personally don't think that they outweight the cost of using reflection for that purpose.
We only convert a couple of properties to query string. And some of them require specific logic, e.g. some boolean endup being "1" or "0" while others should be "true". I think using a generic approach doesn't provide much benefits for that case.
In term of cost, you could argue that JSON.Net is probably using reflection, but users of the clients can change the serialization if they don't want that, which is not the case with that approach.
Maybe the cost of using reflection is actually trivial and we shouldn't care about it?
from arangodb-net-standard.
Following on from the point raised in #201
- Standardising the base "Query/Options" object.
This mostly came from the work on moving all the actual request code down to the ApiClientBase obejct. I needed the behaviour to be standardised so it could be handled in one place. I also aimed to get to a point where things like WaitForSync could be set at the Client level, so all operations that supported it would use the same behaviour.
Regarding the reflection cost, obviously we could go down the route of trying to measure it, but to be honest it's far more important to have a consistent approach that new developers/contributers can follow without having to rely on them writing a specific piece of "manual" code. What if one writes his parameters but forgets an ampersand, or doesn't encode the value. There's too many manual points there that people need to implement exactly the same, to ensure the consistency of the behaviour of the code.
And as you pointed out, Json.net is doing ton's of reflection... reflecting on 4 properties and getting the values is barely going to register compared to the work it's doing. And it can probably still be optimised. I did also leave it so the reflection can be avoided if someone really felt it was an issue on a particular query/options obejct.
from arangodb-net-standard.
Closing this issue
from arangodb-net-standard.
Related Issues (20)
- Deserialization exception on IndexApiClient.PostInvertedIndexAsync HOT 2
- Add a short example of working with multiple documents in readme
- Create a unit test to cover PostCreateViewAsync links properties serialization
- Mention in the readme that custom HttpClient instances can be provided to HttpApiTransport
- Reorganize Analyzer Properties
- Provide access to HttpApiTransport._client
- Auto-generate ArangoDBErrors.cs
- Add support for all cache properties of View API introduced in minor versions HOT 1
- Provide ArangoDB response headers to all API methods HOT 1
- Prerelease nuget packages
- PostInvertedIndexBody Serialization HOT 13
- [Question] Nuget version 2.0.1 HOT 3
- Update roadmap file to remove confusion with latest 2.0.0 release
- Implement endpoint to read in- or outbound edges HOT 1
- Built-in support for Active Failover HOT 3
- How to map arangodb attributes to C# properties HOT 3
- Run tests against ArangoDB 3.11
- Use latest stable LTS .NET SDK to run tests (.NET 8)
- Allow controlling the disposal of provided transport and HTTP client instances HOT 4
- Support FrozenSet<T> in PostDocumentsAsync<T>(...), PutDocumentsAsync<T>(...) and PatchDocumentsAsync<T>(...) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arangodb-net-standard.