Object instantiation

Results 1 to 2 of 2

Thread: Object instantiation

  1. #1
    Join Date
    Dec 1969

    Default Object instantiation

    Can some please advise<BR><BR>I&#039ve been doing ASP for over 2 years and have always used something along the lines of:-<BR>set objConn = server.createobject("ADODB.Connection")<BR>to instantiate my objects.<BR>I&#039ve now been told by a superior, that has never done ASP code incidentally, that we need to use the &#060;object&#062; tags to create our connection objects because they are more efficient.<BR>I&#039ve never seen this done anywhere(books,examples, etc..) and so firstly am interested in how it can be done (the guy has no examples) and secondly if it is really more efficient to do it this way.<BR>I&#039d really appreciate any advice that anyone can offer on this or a reference to some material that you may have found, it&#039s always nice to learn something new.<BR>Thanks in advance<BR>Jamie

  2. #2
    Ian Stallings Guest

    Default RE: Object instantiation

    Using the object tag allows the object to be created only when <BR>needed. In other words, when you use Server.CreateObject() it<BR>creates the object at that moment. Whether you use it or not<BR>doesn&#039t matter. When you create an object using &#060;object&#062; it<BR>creates the object when you actually use it, for instance when <BR>calling a method. It&#039s lazy initilization but MS refers <BR>to it as lazy evaluation. Here&#039s more info and some other tips:<BR><BR>http://msdn.microsoft.com/workshop/server/asp/asptips.asp#asptips_tip17<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts