Ron Kidd
asked on
Public, Private or Friend Methods
Hello
I am starting in VB.Net from VBA.
I am building a 3 Tier Application. (Application, Business Logic DLL and Data Access DLL)
I have got things working with the Class Properties in the Business DLL as set to Public.
I have been reading more and it seems that I should be setting the Properties to Private?
Is this the Correct way to go? - If so How do I Access the Data from the Application?
Do I have a Get Method for every Property in the Class?
And a Corresponding Set Method?
If I do have Get and Set Methods for each Property (50+) does that slow the Application down?
I am starting in VB.Net from VBA.
I am building a 3 Tier Application. (Application, Business Logic DLL and Data Access DLL)
I have got things working with the Class Properties in the Business DLL as set to Public.
I have been reading more and it seems that I should be setting the Properties to Private?
Is this the Correct way to go? - If so How do I Access the Data from the Application?
Do I have a Get Method for every Property in the Class?
And a Corresponding Set Method?
If I do have Get and Set Methods for each Property (50+) does that slow the Application down?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK
I've done some more reading, am I correct in saying.
When you declare a property without a get and set method one is created behind the scenes with it's own field?
So if I need to add some validation latter then all I have to do is create the get and set methods (This should work without any other code changes?)
I've done some more reading, am I correct in saying.
When you declare a property without a get and set method one is created behind the scenes with it's own field?
So if I need to add some validation latter then all I have to do is create the get and set methods (This should work without any other code changes?)
When you declare a property without a get and set method one is created behind the scenes with it's own field?Yes.
So if I need to add some validation latter then all I have to do is create the get and set methods (This should work without any other code changes?)Yes.
ASKER
Thanks very much
ASKER