Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: "Ajay Kalra" <ajaykalra@xxxxxxxxx>
- Date: 30 Aug 2006 10:16:23 -0700
Tom Serface wrote:
I'd say what ever works for you and gives you stable code and easy
maintenance in your work environment. I do like the g_ syntax for globals,
but I'd assume those would be statically global, not members of a class. I
will go on the record as not liking to use those unless there is no other
way around it.
I exclusively use Singletons and advocate strong use of it, especially
in large projects. More importantly, I create the object (what you call
global object) only when called on the method to access it. This is a
key difference: all other options will create the object when app comes
live. The method I use does not do that. This was discussed in one of
C++ books at length (either SMeyers or Anderescu(?)).
---
Ajay
.
- Follow-Ups:
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: David Ching
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Mark Randall
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Tom Serface
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- References:
- Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Artist
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Joseph M . Newcomer
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: AliR
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Mark Randall
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Ajay Kalra
- Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- From: Tom Serface
- Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- Prev by Date: Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- Next by Date: Re: Up to date MFC Book
- Previous by thread: Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- Next by thread: Re: Should Globally Needed Objects be Members in Main Frame, Application, or be Global?
- Index(es):
Relevant Pages
|