Your full service technology partner! 
-Collapse +Expand
To/From Code
-Collapse +Expand Cross Ref Guide
-Collapse +Expand Members-Only
Sign in to see member-only pages.
   ► KBTo/From GuidesASP Classic  Print This     

Class..Object (ASP Classic and VB.Net Cross Reference Guide)

By Mike Prestwood

ASP Classic versus VB.Net: A side by side comparison between ASP Classic and VB.Net.

OOP Basics

Some languages support object-based concepts such as Paradox, Access, and VB Classic. Other languages have OO extensions and fully support object orientation in a hybrid fashion (such as C++ and Dephi for Win32). Finally, some lanages such as C#, VB.Net, Prism, and Java are entirely written in OO. Meaning, every line of code written must occur within a class).


[Other Languages] 

Languages Focus

In short, a class is a data type, and an object is an instance of a class type. A class has methods (routines), properties (member variables), and a constructor. The current values of the properties is the current state of the object. The UML is one of the diagraming disciplines that allows you to document the various changing states of a series of objects.

ASP Classic:   Class..Set..New

Ultra-primitive (no inheritance) but useful and encourages you to think and design using objects. Unlike VB, you can have more than one class per file.

Classes in ASP do support member fields, properties, and methods.

Syntax Example:
'Declare class.
Class Cyborg
  Public Function IntroduceYourself() 
    Response.Write("Hi, I do not have a name yet.") 
  End Function 
End Class
'Create object from class.
Set T1 = new Cyborg
Set T1 = Nothing      'Be sure to clean up!
VB.Net:   Class..End Class..New

Declare and implement VB.Net classes after the form class or in their own .vb files. Unlike VB Classic, you can have more than one class in a .vb class file (VB classic uses .cls files for each class).

Syntax Example:

Class definition:

Public Class Cyborg
  Inherits Object
  Public Sub IntroduceYourself()
  MessageBox.Show("Hi, I do not have a name yet.")
 End Sub
End Class

Some event like a button click:

Dim T1 As New Cyborg
//No need to clean up with managed classes.
//The garbage collector will take care of it.

Sales Website: Or visit our legacy sales site:

©1995-2024 Prestwood IT Solutions.   [Security & Privacy]