Software engineering notes

Simpleton Pattern

leave a comment »

Simpleton pattern


We don’t want multiple objects of the same class, but we also don’t want to clutter our code with the kind of checks required to implement the Singleton pattern


Kill program execution if a second attempt to instantiate an object occurs


class Foo {
    function constructor(){




variable foo = new Foo //all good


variable bar = new Foo  //poof!

Written by Erik

November 25, 2009 at 8:02 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: