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?
Printable View
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?
Property's are more natural in use than member functions, and considered better programming practice than public variables.
Public variables are a no-no.
Obviously, a public property, because you can place some logic in your get/set blocks at any time.
And by logic, that usually means validation logic; as in: "is this value appropriate?"
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?
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