Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

maintaining state

Status
Not open for further replies.

ds100

Programmer
Feb 8, 2001
2
0
0
US
how can we avoid maintaining state between method calls?
 

In regular business objects, data is maintained in variables and accessed thru Properties and Methods. For example, we may have a method LOAD(CustomerID as Long). This method would move all the returned data into local (module level) variables. As long as the object is alive, the user may access the customer name via objCustomer.Name (for example).

When dealing with server components running in MTS (or ActiveX EXEs), we want to minimize the life span of any object. Thus, we wouldn't want to call a method that keeps local variables then do something in the front-end and then come back to the object and access that stored data.

The best thing to do is to create the MTS object, call a method with the needed parameters then delete the object. This means that when designing your MTS objects, you should make sure that all needed data is returned by the called method and not through susequent method calls.

Does this help? Tarek
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top