I have to create a website in Classic ASP, and I really want to do a clean design so I will try to put everything in Classes and Models to emulate the ViewModel Pattern.
So can you tell me if this approach of creating objects is good because I will use it everywhere
Class User
Public Name
Public Adress
Public Title
Public Text
Public Rights 'ArrayList of Right objects
Private Sub Class_Initialize()
Initialize
End Sub
Private Sub Class_Terminate()
Dispose
End Sub
Private Sub Initialize()
Name = ""
Adress = ""
Title = ""
Text = ""
Set Rights = Server.CreateObject("System.Collections.ArrayList") ' Arraylist .net
End Sub
Private Sub Dispose()
End Sub
End Class
Class Right
Public Name
Private Sub Class_Initialize()
Initialize
End Sub
Private Sub Class_Terminate()
Dispose
End Sub
Private Sub Initialize()
Name = ""
End Sub
Private Sub Dispose()
End Sub
End Class
And then I do this for instantiating objects :
Dim myUser
Set myUser = New User
'Do some work
Set myUser = nothing 'Dispose the object
Any idea, suggestion or correction is welcome.