Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Circular reference
Message
From
05/02/2002 09:31:46
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00615370
Message ID:
00615433
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

Well, this is quite a complex question. Many programmers solve it by different ways. For example, create garbage collection programs. Or create special classes to track cross-references. Personally, I like the approach on the OOP and design level. Just create a method "Release" for your business object. SOe releasing of it will now require 2 commands:

goBusiness.Release()
release goBusiness

First command will call that method, second will release the variable from memory. In the Release() method put a code to clean up all references that are holded by that object. In your case:
* Business object
procedure Release

this.oData.Release()
this.oData=.null.

endproc

* Data object
procedure Release

this.oBusiness=.null.

endproc
Let objects know well how to cleanup self (in Release method).

HTH.

>Hi again
>
>I understand that you say, but how manage this without a clear all?
>
>This is a business object, and i need to close without clearing others objects
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform