Lotok
asked on
VB.NET: Interfaces and Encapsulation
I am learning ASP.NET 2.0 using VB.
I understand the reason for encapsulation however I am not sure how to implement it within the website. What goes in the class and how do I use it on the web page?
Also where do interfaces come into this?
A very broad question I know, hoping I can get some help understanding this.
I understand the reason for encapsulation however I am not sure how to implement it within the website. What goes in the class and how do I use it on the web page?
Also where do interfaces come into this?
A very broad question I know, hoping I can get some help understanding this.
ASKER
Is there a version of this with VB.NET examples?
VB.NET foes this differently with GET/SET
VB.NET foes this differently with GET/SET
in VB.NET, the KungFoo NameSpace and Foo class would look like this:
The body of the discussion about encapsualtion is language independent.
AW
The body of the discussion about encapsualtion is language independent.
AW
namespace KungFoo
Public Class Foo
Private _phoneNumber as String
Public Sub New()
_phoneNumber = "703-567-8860"
End Sub
Public Property PhoneNumber() as String
Get
Return _phoneNumber
End Get
Set (Value as String)
_phoneNumber = Value
End Set
End property
End Class
ASKER
Would you create a class in the app_code folder or would this all be on the code-behind page?
Where do interfaces come into it?
Where do interfaces come into it?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks for the explanation, Really appreciate it.
Glad to be of assistance
AW
AW
a good artical to use encapsulation in ASP .Net.