Re: Managing multiple instances



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

.



Relevant Pages

  • Re: Managing multiple instances
    ... The data structure had a static ... until now everyone would look and see which identifier ... Then keep the instance data as a set of ordered mixins ... The proxy would store and access the mixins, ...
    (comp.object)
  • Re: Inserting Text into worksheet???
    ... > may be the only characters in the cell. ... I missed mentioning a couple of assumptions, ... Data structure is in groups of 3 lines below each identifier ...
    (microsoft.public.excel.worksheet.functions)
  • Re: Text terminal rendering design
    ... sort of identifier to indicate which one the client wants. ... Since the client is external, the interface for your software provides encapsulation and implementation decoupling. ... That is purely a problem of the way that your UI software needs to deal with particular terminals. ...
    (comp.object)
  • Re: Uniquely Identifying Multiple/Concurrent Async Tasks
    ... If you are not going to use the identifier as a way of correlating the operation with some other data, why do you need it at all? ... I would agree with the position that states we would _usually_ have data to associate with an async operation, and therefore could/should use that to ID the operation as you are suggesting. ... You have mentioned above things which may be specific to the class implementing the task, and I agree that's not data that the client should have to instantiate. ... If you feel that there's a use for an ID for a purpose other than retrieving data, then I'd say you still haven't been clear about how that would work, or what purpose that would be. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Import number data with leading zeros as text without losing l
    ... different client, you have a spreadsheet, not a relational database. ... Before you even get into how to import and the problem with leading zeros, ... Notice that the SSN and the internal 401K identifier are NOT in this ...
    (microsoft.public.access.externaldata)