|
Bologna? Dont you mean 'baloney'?
|
|
|
|
|
Maybe there is a way to fix stpid...let em launch.
Someone's therapist knows all about you!
|
|
|
|
|
I've been to Amboy. My son and I hiked from the parking lot to the Amboy Crater - Wikipedia
It was quite interesting. Besides walking around in the caldera itself, it's really amazing the amount of life that exists in a desert if you look closely enough.
|
|
|
|
|
Just walked through the living room and Herself is watching some Reality Police show on the TV.
As I walk through I hear a cop asking "This vehicle has hit 39 ANPR cameras since it failed it's MOT* - were you on your way to a pre-booked MOT test on all of those occasions?"
Made me laugh, anyway. Ah, technology - it's a git if you don't understand it!
* The MOT is a UK annual test of all vehicles roadworthiness - if you don't have one, the vehicle is only allowed on the road while driving directly to or from a prebooked test.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Is the Czech Republic so sensible because everyone is so Praguematic?
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Haveln't you run out of countries yet?
... such stuff as dreams are made on
|
|
|
|
|
I have a Czech mate, he's quite a formidable opponent.
Installing Signature...
Do not switch off your computer.
|
|
|
|
|
I have a stale mate, he is quite boring.
... such stuff as dreams are made on
|
|
|
|
|
No, it's because they drive slow in their Kia
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
My worst ever drink related incident involves [0] Prague and [1] Absinthe.
No more shall be said on the matter.
Ever.
veni bibi saltavi
|
|
|
|
|
In the Absinthe of an explanation all that remains is speculation on your Czechered past
Installing Signature...
Do not switch off your computer.
|
|
|
|
|
I use this when the instances are going to be resource heavy - maybe have a couple of images in them - and / or I want one example of each instance through the whole system.
So I have a private constructor, a static Dictionary containing all created instances, and a static method which fetches the instance:
private static Dictionary<string, MyClass> all = new Dictionary<string, MyClass>();
private MyClass(string name, List<string> data )
{
...
all.Add(name, this);
}
public static MyClass Get(string name, List<string> data)
{
if (all.ContainsKey(name)) return all[name];
return new MyClass(name, data);
} And it works really well. But ... is that a pattern? I hope not, I might have to stop using it ...
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
It's a derivative of the singleton pattern, but you allow one instance per ID.
Wout
|
|
|
|
|
Reminds me of a singleton meets the concept of a self-referential thread pool, but then again naming patterns isn't exactly my strong suit. As far as to whether or not to stop using it, personally I'd have at least two classes that worked in tandem... a MyClassContainer (or pool or whatever) and a MyClass. Only for the sake of clarity and no other reason. But then again patterns aren't exactly my strong suit, so if it's an industry standard pattern then I'd be ok with it as is. Kinda curious what some of the peeps will say in reply to this.
Jeremy Falcon
|
|
|
|
|
It's called the OriginalPattern
|
|
|
|
|
You had me going for a split second there.
Jeremy Falcon
|
|
|
|
|
I admit I googled ... mostly Beer companies, which may be appropriate.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Jeremy Falcon
|
|
|
|
|
Success.
|
|
|
|
|
That's actually a pretty good name for it, considering!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Joke aside, I believe there is a pattern called the flyweight pattern that is fitting the description.
|
|
|
|
|
PIEBALD rolls a three and reaches for his GOF book...
The closest I see is Proxy, but that's more about deferred instantiation.
As mentioned by others, it's also close to Singleton, yet possibly Singleton done right. (The standard Singleton Pattern is filth.)
Maybe this could be called the Library Pattern.
Anyway, I do that a lot too. Most recently as a store for RegEx instances which I use frequently.
|
|
|
|
|
Flyweight?
Starting to think people post kid pics in their profiles because that was the last time they were cute - Jeremy Falcon.
|
|
|
|
|
OriginalGriff wrote: But ... is that a pattern? Yes, it is. I would refer to it as the static OGDictionarySingleton.
OriginalGriff wrote: I hope not, I might have to stop using it Why?
The definition of a pattern is a piece of reusable code that solves a given problem. Does your manager not allow for tested and documented solutions?
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Because most patterns are a waste of time, but worshipped as the One True Holy Grail of Computing by those that learn it. And then force all applications they write to fit that pattern regardless of the appropriateness.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|