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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is my Object Stateless ??? Check out scenario ??

Status
Not open for further replies.

miq

Programmer
Apr 24, 2002
315
PK
hi,

lets say, I am using 2 method in my DB object layer.

one object named "OpenConnection". connection parameters are passed to it (ADO used here). The other method
Creates recordset named "CreateRecordset". Activeconnection is not passed to it instead, it uses connection object which was created earlier with the first mehtod (OpenConnection).

Is this technique is a violation of stateless. No property is created but the object in first method which is utilized by second method.


What do you think about it ????

Bye
miq
 
The fact that your object retains information from one method call to the next makes it so it is not stateless. Properties are just one indication that an object isn't stateless, not the only rule.

You want to know if your objects are stateless? Then ask yourself this

After creating an instance of an object that has no code in the Initialize() event can you call EVERY single one of your methods without the calling program calling any other method.

Also at the end of EVERY public method you should be calling SetComplete() or SetAbort(). If you don't then your object is NOT stateless. Withouth these calls MTS/Component Services will NOT recycle the object but it will be tied to the client app that created it until the client app releases it.

What do I think? I think the lack of light shows black, I think your object is not scaleable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top