Giter Site home page Giter Site logo

Comments (4)

paulpv avatar paulpv commented on April 28, 2024

FYI, this is another example of how singletons can be evil [most of the time?].
A singleton backed by a separately instantiable class is not necessarily evil and may make for a great design choice and is implicitly ready to handle the use case of multiple instances should the need arise.
A singleton backed by a non-separately instantiable class has limited use and could be very difficult to refactor if needed to support conflicting configurations/state.

from fast-android-networking.

amitshekhariitbhu avatar amitshekhariitbhu commented on April 28, 2024

@paulpv : Thanks for sharing your knowledge and pointing out the bug. It is indeed insightful. I got your point and logic that you explained above. So I have planned it to refactor it as soon as possible.

Thank You
Amit Shekhar

from fast-android-networking.

amitshekhariitbhu avatar amitshekhariitbhu commented on April 28, 2024

We will correct and push it in upcoming release.

from fast-android-networking.

paulpv avatar paulpv commented on April 28, 2024

FWIW, a better OO model in my libraries on my side allows me to define the OkHttpClient and any other configuration in my main app and pass it in to AndroidNetworking.initialize(...), but I would still be at the mercy of any other libraries that may use AN playing nicely and accepting the same parameter and either not malfunctioning w/ my configuration or them not overwriting my configuration.
Such tangled webs all of these dependencies can weave!
Thanks for looking in to this!

from fast-android-networking.

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.