Properties: Are they costly?
In project we are using IIS with MTS(Its a web based project which we are developing in ASP and COM(Developed using VB) with SQL Server/Oracle.
We are using the components only to access database.
In the class we first defined property procedures and methods. The component users(from any application) should set the property values and call the methods each time(there are more than 10 properties whose values are set before calling a method).
As an alternate we defined some methods which takes data as parameter without using properties. Meaning component users does't set the property values instead they sent the values as a paramters of the methods.
Kindly suggest which is better with reason.
Thanks in advance.
VMK
[email protected]
[email protected]
Re: Properties: Are they costly?
Properties on objects are great on a single user machine - but as you've discovered, they can cause a lot of network traffic. I've found it better to use disconnected (ADO) recordsets in method calls across a network (or XML strings), this way you can pass all the data in one go and have each object pack/unpack it as required.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Re: Properties: Are they costly?
Two other options to the disconnected recordset are to use arrays, or UDT's in conjunction with LSet.
From what I've read, passing large numbers of arguments to a procedure is not the way to go. Why? Sorry, don't know.