Git Product home page Git Product logo

Comments (4)

estebanlm avatar estebanlm commented on September 15, 2024

Can you elaborate a bit more?

from newtools.

StevenCostiou avatar StevenCostiou commented on September 15, 2024

Each time we add a debugging tool, there is a class with a singleton that holds objects.
For example, the halt cache uses a registry of halts, the debugger selector keeps instances of DebugSession, the object-centric debugger keeps instances of object-centric breakpoints, etc.

Basically all the (debugging) tools need to keep instances of things somewhere and control them from there.

We are constantly adding singletons, with different namings (defaultInstance, default, singleton, etc.), then testing them (globally the same way).

Why not having a "Singleton service" that proposes an interface for "Singleton clients" that would be able to register their objects there?

from newtools.

MarcusDenker avatar MarcusDenker commented on September 15, 2024

Yes, one tiny step: There was the proposal to add a Stateful trait for Singletons.

  • Konrad implemented it and changed all singletons, but it was rejected as a (undefined) part of that is not supposed to use Tratis
  • I re-submitted the trait only so people can start to use it, but that was rejected as it had no users.

see pharo-project/pharo#3204

from newtools.

guillep avatar guillep commented on September 15, 2024

I understood @StevenCostiou 's point as to avoid singletons, not making them just easier to use. Singletons are in general not a good solution as they prevent testing, isolating changes...

from newtools.

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.