|
-
Jun 8th, 2005, 09:33 AM
#1
Thread Starter
Lively Member
Property or Public Variable
hi,
in my 3 tier project i want to set some values in another layer( ex :Business layer). which is best method to assign values. GET SET property or creating public variable(s) in Business layer for holding the values?
-
Jun 8th, 2005, 09:37 AM
#2
Re: Property or Public Variable
Property's are more natural in use than member functions, and considered better programming practice than public variables.
Public variables are a no-no.
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jun 8th, 2005, 10:11 AM
#3
Re: Property or Public Variable
Obviously, a public property, because you can place some logic in your get/set blocks at any time.
-
Jun 8th, 2005, 10:13 AM
#4
Re: Property or Public Variable
And by logic, that usually means validation logic; as in: "is this value appropriate?"
Nobody knows what software they want until after you've delivered what they originally asked for.
Don't solve problems which don't exist.
"If I had eight hours to cut down a tree, I'd spend six hours sharpening my axe." --- Abraham Lincoln (1809-1865)
2 idiots don't make a genius.
-
Jun 8th, 2005, 10:12 PM
#5
Thread Starter
Lively Member
Re: Property or Public Variable
yes
Property's are more natural in use than member functions, if i want to assign more values to bussiness layer member i should create more property is it correct. suppose i have 20 values to assign for business layer, then there should be 20 property members in my Bussiness layer? is this is applicatble?
-
Jun 8th, 2005, 10:22 PM
#6
Member
Re: Property or Public Variable
by applicatble im going to assume you mean a mixture of acceptable/applicable.
yes, perfectly acceptable
more readable than public variables and better programming practice.
it makes sense to add these to the business layer
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|