Why Reinvent the Wheel?

Throughout this chapter, we’ve looked at various third-party components that can greatly enhance your IIS/ASP web site. While most of these components come at a cost, it is almost guaranteed to be much lower than the cost in man-hours needed to develop a similar component inhouse.

Since its Introduction, this book has promoted code reuse repeatedly for several reasons:

  • Code reuse decreases the time needed to complete a project.

  • Code reuse decreases the time needed to complete future projects.

  • Code reuse leads to fewer bugs, since the reused code is more thoroughly tested than newly written code (and it has already been checked time and time again for typos and silly mistakes).

COM components, if they are Microsoft-created, third-party created, or developed in-house, are shining examples of code reuse and are guaranteed to save you time in development and debugging. My advice: if you can find a third-party COM component that can meet your needs, by all means, use it!

Tip

The only disadvantage of using third-party or Microsoft COM objects is you don’t have access to the source. This, in my opinion, has two disadvantages:

  • Sometimes it’s nice to be able to see under the hood of the car. With third-party COM components, you are in the dark as to how, exactly, they work. While this black-box implementation has its advantages in encapsulating the implementation complexity, there are still those times when you need to know what makes the component tick. For example, use of the Request object’s QueryString and Form collections is not available when using SA-FileUp, since SA-FileUp issues a BinaryRead. Since SA-FileUp is a compiled COM component, we cannot see the code that issues the BinaryRead. While the SA-FileUp help files thoroughly explain why you can’t use the QueryString and Form collections on a web page that uses SA-FileUp, it would be nice to be able to dissect the code ourselves, rather than having to rely on the help file.

  • It’s impossible to reuse COM component code. Perhaps a small portion of a COM object could be used in a future project. With VBScript classes (or COM objects developed in-house), you can take advantage of the existing COM component’s source code, creating a new component that reuses the needed section of the source code form the existing component.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.240.21