Re: Managing multiple instances
- From: "Benjamin M. Stocks" <stocksb@xxxxxxxx>
- Date: 30 Apr 2006 08:05:32 -0700
I'm not sure I understood this... What I got is:
...someone creates an instance of C...
...this C creates one instance of B...
...this B creates an instance of A and assigns it the number 1...
...this C creates one instance of B...
...this B creates an instance of A and assigns it the number 1...
Pretty much, one instance of C creates two instances of B, each
instance of B creates one instance of A. As each instance of class A is
added to the data structure it is currently assigned an increasing
integer identifier. I wanted to start improving this design by suppling
the identifier rather than leaving it up to the data structure to
assign the identifier.
And the problem is that the B's don't remember, from one creation of A
to the next, what number the previous A was assigned. Right ?
How about if it was the responsibility of C to remember that number and
increment it ?
Possible but then how does the identifier get shared with the client
code so it can look up the object in the data structure?
Thanks,
Ben
.
- Follow-Ups:
- Re: Managing multiple instances
- From: Laurent Bossavit
- Re: Managing multiple instances
- References:
- Managing multiple instances
- From: Benjamin M. Stocks
- Re: Managing multiple instances
- From: Laurent Bossavit
- Managing multiple instances
- Prev by Date: Re: Managing multiple instances
- Next by Date: Re: Managing multiple instances
- Previous by thread: Re: Managing multiple instances
- Next by thread: Re: Managing multiple instances
- Index(es):
Relevant Pages
|