devxlogo

Using <OBJECT> tag Instead of Server.CreateObject()

Using <OBJECT> tag Instead of Server.CreateObject()

When you create an object in ASP using the Server.CreateObject() method, the object is created as soon as the method is called. Any threads, memory, or other resources are allocated at the point of instantiation, or creation and thus the resources are held from that point onwards. However, you can create the object in such a way that it is not actually created until the first method or property of the new object is referenced. You can do this using the HTML tag with the Runat=Server attribute. The syntax for creating an object using the tag is:

 

This may not seem like a lot of savings. Still, while designing a system that has to withstand a high number of hits per day, it can be a consideration to keep in mind.

See also  5 Ways to Improve Customer Experience
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist

©2024 Copyright DevX - All Rights Reserved. Registration or use of this site constitutes acceptance of our Terms of Service and Privacy Policy.