Link to home
Start Free TrialLog in
Avatar of edwbear1976a
edwbear1976a

asked on

PASSING OBJECTS PARAMS AS BY VAL INSTEAD OF BY REF MIGHT MAKE YOUR APPLICATION LIKE A MESS??

HI GUYS

I'm checking out a web application developped by an outsorcing company.. well that proyect doesn't work fine for many reasons . It's writting in vb.net and suddenly I realized that they pass ALL Objects by val (let's say that an object is a List of 10000 objects , where every object is a query record) . I remember the times when I read from the first (Visual Basic 5) about passing parameters that you've got to pass objects as ref and primitive variables as by value.. but now I see this .... and all methods pass objects as byval.. there might be about 200 methods in that proyect

Can anyone tell me that I'm not that crazy
ASKER CERTIFIED SOLUTION
Avatar of Jorge Paulino
Jorge Paulino
Flag of Portugal image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of edwbear1976a
edwbear1976a

ASKER

Hi you guys and thanx for the comments
well I'm worried for things that I always knew and andrewneely says : -- That's why byref is slower than byval--. well I'm trying to improove that web application performance . I also now that There are 2 types of object no matter if you pass it it by val or by reference (Arrays,Classes : byRef) simple variables (Int32, Int64).. well what I have always understood is that when you pass by Ref and Object "byRef type" you store  in the stack a reference or "pointer" to the heap, but when you pass an object byVal  the value of that object is copied in the stack (Int32:640,char: "A" and so) so I've got to understand that no matter I pass an object (type by ref) as by val or by ref its behavior will be the same.
The Fact is that the proyect I'm checking out has got a lot of methods and they only pass objects byVal...I have to face that now things are different with .NET FRAMEWORK  and maybe for the best.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial