Page

16.4.0- Summary

  by NT Community Manager.
Last Updated  by Jim Minatel.  

PublicCategorized as 16. Building Script Components for ASP.

Not tagged.
<< 16.3.3- Building the Script ComponentChapter16

Summary

This chapter has been all about components. We've learned that we can think of a component as a self-contained nugget of code that provides a certain amount of related functionality and information – in the form of methods, properties and events. There are lots of advantages to writing and using components in our code:

 

  • A component makes for easy code re-use, and allows us to distribute our code safely and simply among our colleagues and customers
  • Components make for more easy maintainability of our applications
  • Compiled components bring performance advantages, because the code doesn't need to be compiled before it is executed
  • Compiled components are also more secure, because they exist in a binary format which is almost impossible for a human to read
  • Components make it easy to dissect functionality into related parts, collecting related bits of functionality in the same component

 

We discussed two kinds of components in this chapter:

 

  • Compiled components are components that are written in a language such as Visual Basic or C++. These components are compiled before they are registered. The compiled executable code is in a binary format, which makes it secure and efficient
  • Script components are not compiled; they are written in a scripting language such as VBScript, JScript or PerlScript. We used the Windows Script Component wizard to create script components. A WSC component is a .wsc file that contains the logic for our components, in a scripting language. This component's script must be compiled before it is executed, which makes it less efficient and less secure, but more easy to use

 

We've seen two examples in which we encapsulated parts of our application logic into a component. Then we registered the component, and created an instance of the component from script using the Server.CreateObject method. Then, we were able to use the methods and properties of those components in just the same way as we have used the methods and properties of other objects, all the way through this book.

 

We've even seen how a WSC component can encapsulate ASP logic and data access logic.

 

We'll begin the next chapter with a look at transactions, and how they can make our applications more robust. Then we'll return to the notion of componentization, and bring components and transactions all together in our final example of that chapter.

<< 16.3.3- Building the Script ComponentChapter16

Copyright © 2003 by Wiley Publishing, Inc.

Powered by Near-TimeTerms of Services | Privacy Policy | Security Policy |