Giter Site home page Giter Site logo

Comments (3)

DiscoPYF avatar DiscoPYF commented on June 17, 2024

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.

apawsey avatar apawsey commented on June 17, 2024

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.

tjoubert avatar tjoubert commented on June 17, 2024

Closing this issue

from arangodb-net-standard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.