Where to learn about ASP Classes

Where to learn about ASP Classes

am 20.11.2007 17:39:30 von bruce

I've been searching for some information on the use of Classes in ASP, but
found very little information.

I found this http://www.daniweb.com/tutorials/tutorial19997.html .

Are there more information somewhere online?

Thanks

Re: Where to learn about ASP Classes

am 20.11.2007 17:53:27 von Jon Paal

http://en.wikibooks.org/wiki/Active_Server_Pages/Appendix_A: _Language_Reference#Object-Oriented_Programming


"Bruce" wrote in message news:uBVBNR5KIHA.4196@TK2MSFTNGP04.phx.gbl...
> I've been searching for some information on the use of Classes in ASP, but found very little information.
>
> I found this http://www.daniweb.com/tutorials/tutorial19997.html .
>
> Are there more information somewhere online?
>
> Thanks
>

Re: Where to learn about ASP Classes

am 20.11.2007 17:54:40 von Jon Paal

http://en.wikibooks.org/wiki/Active_Server_Pages/Appendix_A: _Language_Reference#Object-Oriented_Programming


"Bruce" wrote in message news:uBVBNR5KIHA.4196@TK2MSFTNGP04.phx.gbl...
> I've been searching for some information on the use of Classes in ASP, but found very little information.
>
> I found this http://www.daniweb.com/tutorials/tutorial19997.html .
>
> Are there more information somewhere online?
>
> Thanks
>

Re: Where to learn about ASP Classes

am 20.11.2007 17:55:04 von Jon Paal

http://en.wikibooks.org/wiki/Active_Server_Pages/Appendix_A: _Language_Reference#Object-Oriented_Programming


"Bruce" wrote in message news:uBVBNR5KIHA.4196@TK2MSFTNGP04.phx.gbl...
> I've been searching for some information on the use of Classes in ASP, but found very little information.
>
> I found this http://www.daniweb.com/tutorials/tutorial19997.html .
>
> Are there more information somewhere online?
>
> Thanks
>

Re: Where to learn about ASP Classes

am 20.11.2007 17:56:51 von Anthony Jones

"Bruce" wrote in message
news:uBVBNR5KIHA.4196@TK2MSFTNGP04.phx.gbl...
> I've been searching for some information on the use of Classes in ASP, but
> found very little information.
>
> I found this http://www.daniweb.com/tutorials/tutorial19997.html .
>
> Are there more information somewhere online?
>

Here is the documentation:-

http://msdn2.microsoft.com/en-us/library/23t9k18c.aspx

Follow the links at the bottom of the article to get a rounded out
understanding.

--
Anthony Jones - MVP ASP/ASP.NET

Re: Where to learn about ASP Classes

am 21.11.2007 18:40:34 von Dave Anderson

Bruce wrote:
> I've been searching for some information on the use of Classes in
> ASP, but found very little information.
>
> I found this http://www.daniweb.com/tutorials/tutorial19997.html .
>
> Are there more information somewhere online?

Please keep in mind the fact that ASP is not a language, and that the
information provided by other respondents applies to VBScript ONLY.

The complete list of ASP objects is below. Classes are not listed:
http://msdn2.microsoft.com/en-us/library/ms524716.aspx



--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.

Re: Where to learn about ASP Classes

am 24.11.2007 12:24:21 von Brynn

On Nov 20, 10:39 am, "Bruce" wrote:
> I've been searching for some information on the use of Classes in ASP, but
> found very little information.
>
> I found thishttp://www.daniweb.com/tutorials/tutorial19997.html.
>
> Are there more information somewhere online?
>
> Thanks

I studied the HECK out of ASP classes. I spent a lot of time doing it.
Classes in ASP don't really seem to be all that worth it in most
cases. I haven't really found any of my code that benchmarks faster as
a class in ASP. I don't personally waste my time with them ... and I
use a lot of classic asp still. But here is a starter anyway.



<%
'// Class Example - obviously the clas would generally be in a
seperate file
'// The name os this class object.
class exampleClass

'// Variables that only this class can use.
private someVar, someOtherVar, someArray(2,0)



'// Private subroutine that only this class can use.
private sub mySub()

end sub



'// Variable that can be set outside the class with the object.
public anotherVar, yetAnotherVariable, maybeDatabaseConn



'// A subroutine that you can call from outside the object
public doThis()
'// does somethings in here .. and ...
call mySub() '// the private sub for this class
end sub


'// Functions ... private function ... public function ... same way
end class




'// IN USE
dim myObj
set myObj = exampleClass
'// maybe your class is doin database stuff
myObj.maybeDatabaseConn = "DSN=yourdatabase;"

'// or set whatever other variables ... then execute the public
subroutine
with myObj
.anotherVar = "whatever"
.yetAnotherVariable = "whatever"
call .doThis()
end with
set myObj = nothing '// set to nothing when done
%>

Re: Where to learn about ASP Classes

am 24.11.2007 13:21:16 von reb01501

Brynn wrote:
> On Nov 20, 10:39 am, "Bruce" wrote:
>> I've been searching for some information on the use of Classes in
>> ASP, but found very little information.
>>
>> I found thishttp://www.daniweb.com/tutorials/tutorial19997.html.
>>
>> Are there more information somewhere online?
>>
>> Thanks
>
> I studied the HECK out of ASP classes. I spent a lot of time doing it.
> Classes in ASP don't really seem to be all that worth it in most
> cases. I haven't really found any of my code that benchmarks faster as
> a class in ASP. I don't personally waste my time with them ... and I
> use a lot of classic asp still. But here is a starter anyway.
>
>

Classes are not about performance: they are about reusability and
maintainability.The idea is that encapsulating frequently-used code in
classes makes it easier for that code to be re-used.

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"

Re: Where to learn about ASP Classes

am 24.11.2007 14:01:30 von Anthony Jones

"Brynn" wrote in message
news:abda465c-afbc-4ef5-9011-460e6171453d@v4g2000hsf.googleg roups.com...
> On Nov 20, 10:39 am, "Bruce" wrote:
> > I've been searching for some information on the use of Classes in ASP,
but
> > found very little information.
> >
> > I found thishttp://www.daniweb.com/tutorials/tutorial19997.html.
> >
> > Are there more information somewhere online?
> >
> > Thanks
>
> I studied the HECK out of ASP classes. I spent a lot of time doing it.
> Classes in ASP don't really seem to be all that worth it in most
> cases. I haven't really found any of my code that benchmarks faster as
> a class in ASP. I don't personally waste my time with them ... and I
> use a lot of classic asp still. But here is a starter anyway.
>

There are two primary uses for classes in ASP neither of which have to do
with performance.

1) Manage complexity. There comes a point where the requirements of an
application can reach a level of complexity which can't easily be handled by
procedural approach alone. An OO design helps to manage that and Classes in
VB can help implement an OO design. Of course a level complexity that
requires this would probably be best implemented in another language which
exposes components to be consumed by ASP.

2) Manage indentifier namespace. VBScript does not contain the concept of a
module which contain private variables and procedure not accessible outside
the module. This can be a problem in ASP application which stores libraries
of useful utilities in include files. For any ASP page that wants to
include one or more such libraries ALL functions and variables must use a
unique identifier. This includes functions and variables only actually used
internally by the library.

By implementing a library as a Class the class can expose only those
functions and properties that consuming code need access to. Additional
those public identifiers will not polute the global namespace since they
will now be prefixed by the name of an object variable. This especially
important when you have a team of developers; that don't need to check with
all other developers and all other modules whether a specific name is
available for use. E.g,-


'Include1.asp
<%
Class Include1
Public Function DoSomething()

End Function
End Class
%>

'Include2.asp
<%
Class Include2
Public Function DoSomething()

End Function
End Class
%>

'Consumer.asp


<%

Dim o1 : Set o1 = New Include1
Dim o2 : Set o2 = New Include2

o1.DoSomething
o2.DoSomething

%>

>
>
> <%
Removed code not showing anything not already present in link the OP
had already indicated had been read.

> %>



--
Anthony Jones - MVP ASP/ASP.NET