The most used code pattern to create a singleton class is something like this
El patrón de código habitual para generar una clase singleton sería algo parecido a esto
This way, when calling from another class to the method getInstance of the class ClaseSingleton, you get the same instance every time, this way variables and methods that have a singleton class can be reused from other classes.
De esta manera, al llamar desde otra clase al método getInstance de la clase ClaseSingleton, se obtiene la misma instancia cada vez, de esta manera las variables y métodos que pueda tener una clase singleton podemos reutilizarlas desde otras clases.
The GameService class, in Listing 10, is a singleton class that represents the game server and the current state of the given game.
La clase GameService, en el Listado 10, es una clase singleton que representa el servidor del juego y el estado actual del juego dado.
In the following example, we create a Singleton class to define the set up parameters of an application.
En este ejemplo se creará una clase Singleton para definir las configuraciones de una aplicación.
Conținut posibil inadecvat
Exemplele au rolul de a te ajuta să traduci cuvinte sau expresii corect si adaptat la context. Nu sunt selectate sau validate manual, așadar pot conține termeni inadecvați. Te rugăm să raportezi exemplele pe care le consideri inadecvate. Traducerile vulgare sau colocviale sunt în general marcate cu roșu sau cu portocaliu.
Nici un rezultat pentru acest sens.
Sinonime și analogii pentru "a singleton class" în limba Română