» Home » Singleton » Page 1
Does calling GetInstance on a Singleton lifetime mapping return the singleton or create a new instance?
by clifton anderson in Programming Languages

I have the following mapping in ObjectFactory.Initialize method:

.Ctor<string>("url").Is(<fetch from config>)
.Ctor<string>("username").Is(<fetch from config>)

This ensures that my

Prevent a subclass of a singleton class from calling the singleton's constructor
by Edo in Programming Languages

Ok, I have a singleton class GraphMaster which contains a number of system-wide values. I have a subclass GraphObject : GraphMaster which has graph specific data. By subclassing, I can access members of either the global class or subclass. And by using a singleton class, I can change the global variables anywhere and have them be reflected in all the subclasses.

Plain old singleton or spring singleton bean?
by Ian McKellar in Development Tools & Services

I have a service in my application which is a singleton.
My application is being bloated with the use of spring framework.

I am confused over to use the singleton service as

1: Plain Old Singleton [Access them statically when required]

OR as a

2: Spring singleton bean. [Use DI to inject when required]

Which approach is correct ?

Patterns: Local Singleton vs. Global Singleton?
by Hungary in Programming Languages

There is a pattern that I use from time to time, but I'm not quite sure what it is called. I was hoping that the SO community could help me out.

The pattern is pretty simple, and consists of two parts:

A factory method that creates objects based on the arguments passed in.

Objects created by the factory.

So far this is just a standard "factory" p

Attempt to use my singleton that references another singleton
by iyogee in Programming Languages

I'm calling my custom factory that I created (PhotoServiceFactory), which is a singleton that allows me to get at a specific custom service type back (in this case FacebookService). FacebookService is also a singleton. In FacebookService I've exposed an instance of FacebookAlbumPhoto through a property. I did this because then I don't have to have a ton of the same code over and over again c

please help me Assignment has more non-singleton rhs dimensions than non-singleton
by Alexander Schuc in Programming Languages

I have the following error in my code

Assignment has more non-singleton rhs
dimensions than non-singleton

This is the code:

string =['d:facefaceffw' int2str(r) '_' int2str(Sel(nSelRow,t)) '.bmp'];
A = imread(string);
B = im2double(A);

Update 1:

When I updated the code we got new err

Referencing singleton body to singleton body without namespacing, but how?
by Mike in Web Design

My goal ist to reference a function into an singleton/object body!


This result is my goal:

var singletonObj_1 = (function () {
return {
custom_fn1 : function(){...},
custom_fn2 : function(){...} <<-- *But Imported

So after importing, i am able to call

How to call a WCF singleton service within a WCF singleton service without hanging?
by Remyx in Programming Languages

I have two services, one that calls another. Both are marked as singletons as follows:

[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Multiple)]
public class Service : IService

And I set these up with a ServiceHost as follows:

ServiceHost serviceHost = new ServiceHost(singleto

How do I call another Singleton bean from a Singleton bean?
by hovergirl in Programming Languages

I've tried putting the remote interface of another Singleton bean into another. However, the remote object will always be null. Is there any other way I could get around it?

public class SingletonBean1 implements SingletonBean1Remote {
SingletonBean2Remote singletonBean2Remote;
public SingletonBean1() {

Best way to use my singleton
by ponchopilate in Mobile Programming

I started to develop my singleton class but I have a problem.
What I want to do is have a search objects containing the values of the search form that I could use in several views.
I want to have the ability to get the singleton in any view in order to perform the search or build the search form.
So I have a set of values with a boolean for each to know if the variable has been i

TAGS : Best singleton

Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .