By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,898 Members | 2,022 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,898 IT Pros & Developers. It's quick & easy.

static member variable for group of objects

P: n/a
Has anybody come across any pattern to create a static class member
that can be shared across group of objects ?

I understand this can be achieved (thru factory method), by
referencing the (simulated) shared member thru member pointer or
reference.

Is there any better approach ?

regards,
Pramod
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"pramod" <sp********@yahoo.com> wrote in message
news:c6**************************@posting.google.c om...
Has anybody come across any pattern to create a static class member
that can be shared across group of objects ?

I understand this can be achieved (thru factory method), by
referencing the (simulated) shared member thru member pointer or
reference.

Is there any better approach ?

regards,
Pramod


try singleton. generally used to make a single instance of an object
available to an entire application or module. in the case of single class
requiring access, the singleton methods could be made private static to the
class.

hth
tom
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.