The Artima Developer Community
Sponsored Link

Design Forum
Singleton in Design Pattern

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jian Ma

Posts: 1
Nickname: jianma
Registered: Mar, 2011

Singleton in Design Pattern Posted: Mar 17, 2011 12:37 PM
Reply to this message Reply
Advertisement
Hi,

I read the Singleton in the book << Design Patterns - Elements of Reusable Object-Oriented Software>>.

The Singleton class is define as :
class Singleton {
public:
static Singleton* Instance();
protect:
Singleton();
private:
static Singleton* _instance;
};

My question is why it uses protected constructor instead of private. Does it care about inheritance?

Any suggestion is welcomed.

Topic: Drop functionality is not working with flexmonkey Previous Topic   Next Topic Topic: Document for SRS

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use