Link to home
Start Free TrialLog in
Avatar of Lotok
LotokFlag for United Kingdom of Great Britain and Northern Ireland

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.
Avatar of itsfact
itsfact

http://www.4guysfromrolla.com/webtech/091800-2.shtml
a good artical to use encapsulation in ASP .Net.
Avatar of Lotok

ASKER

Is there a version of this with VB.NET examples?

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
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

Open in new window

Avatar of Lotok

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?
ASKER CERTIFIED SOLUTION
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America 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
Avatar of Lotok

ASKER

Thanks for the explanation, Really appreciate it.
Glad to be of assistance

AW