| Chapter16 | 16.1.0- A Brief Introduction to Components >> |
Building Script Components for ASP
We've already seen a number of components in this book, and we've seen some of the advantages that they can bring to our ASP applications. In Chapter 6 , the MyTelephone.dll component encapsulated the functionality of a Telephone object – with methods like PlaceCall and Answer, and events like CallWaiting, which reflected the functionality and behavior of a real telephone.
In Chapter 11 , we looked at the so-called 'Active Server components' – a particular group of components provided with IIS 5.0, that we can use in our ASP applications to perform a whole range of different tasks. One such is the Ad Rotator component – a component that decides which of a number of ads or images will appear at a particular point in your ASP page, using a weighted rotation system to do so. Another is the Browser Capabilities component, which provided the functionality required to peek at the user's setup and establish what type of browser is being used to view the page.
More generally, components come from all sorts of sources, and perform all sorts of tasks. And because of the advantages that components can bring to our applications, component design has become a hugely important part of application development today.
Many components are written in compiled languages, such as Visual Basic or C++, and there are good reasons for this (as we'll see later). However, this doesn't mean that we need to learn a new programming language in order to write a component. In this chapter we'll meet the Windows Script Components (WSC) tool – an accessible way to develop components and the ideal tool with which to begin learning the art of component design. We'll see how to write some simple components using WSC, and we'll be exercising these new components within ASP pages.
So, in this chapter, we will:
- Explain what a component is
- Discuss the benefits of components, and the fundamentals of how they work
- Talk about the pros and cons of writing components in script, or writing components in a compiled language
- Discuss the elements and syntax of WSCs, showing how XML is used as the framework of the script object
- Build some script-based components of our own, using the Windows Script Component Wizard
- Use our components within our own ASP pages
| Chapter16 | 16.1.0- A Brief Introduction to Components >> |

RSS

