in reply to Same object, different packages

Since you used the word objects, I am going to operate as if your modules are classes.

You could set up the new() method of the GMS class such that it returns a reference to a pooled (pool of one in this case perhaps) instance of the class. If no instance exists, then one is created and placed in the pool. Then later when the GMS::MemberFile is instantiated you can call the GMS->new() and get a reference back. Doing this will allow you to use one instance in a couple of different places.

Another thing you might want to consider is whether your class design would be better off using inheritance. Without actual code I don't know whether this is the situation or not, but it might be worth entertaining.

Replies are listed 'Best First'.
Pool?
by Flame (Deacon) on Sep 19, 2001 at 20:46 UTC
    Sorry, new term to me... what do you mean by 'pool'?


    "Wierd things happen, get used to it"

    Flame ~ Lead Programmer: GMS
    http://gms.uoe.org
      Sorry. By "pool" I mean a collection of something -- in this a collection of existing instances.