The Sample Components


Three sample components will be defined in this section to demonstrate the main component types. The transform component will then be expanded in Chapter 15 to include a user interface. All code samples will be available on the Web site for this book, which you can find at www.wrox.com.

Component 1: Source Adapter

The source adapter needs to be able to do quite a few things in order to be able to present the data to the downstream components in the pipeline in a format that the next component understands and is expecting. Here is a list of what the component needs to do:

  • Accept a Connection Manager

  • Validate the Connection Manager (did it get the right type of Connection Manager?)

  • Add output columns to the component for the downstream processes

  • Connect to the data source

  • Get the data from the data source

  • Assign the correct parts of the data to the correct output columns

  • Handle any data errors

This component is going to need to do quite a bit of work in order to present its data to the outside world. Stick with it and you'll see how easy this can be. Your aim in the source adapter is to be able to take a file with a custom format, read it, and present it to the downstream components. The file will look like this:

 <START> Name: Age: Married: Salary: <END> 

As you can see, this is a nonstandard format that none of the source adapters out of the box could deal with.

Component 2: Transformation

The transform is where you are going to take data from a source, manipulate it, and then present the newly arranged data to the downstream components. This component performs the following tasks:

  • Create input columns to accept the data from upstream

  • Validate the data to see that it is how the component expects it

  • Check the column properties because this transform will be changing them in place

  • Handle somebody trying to change the metadata of the transform by adding or removing inputs and/or outputs

The requirement here is to take data from the source and reverse the contents. The quirk, though, is that the column properties must be set correctly, and you can only perform this operation on certain data types.

Component 3: Destination Adapter

The destination adapter will take the data received from the upstream component and write it to the destination. This component will need to do the following:

  • Create an input that accepts the data

  • Validate that the data is correct

  • Accept a Connection Manager

  • Validate the Connection Manager (did you get the right type of Connection Manager?)

  • Connect to the data source

  • Write data from the data source

The destination adapter is basically a reverse of the source adapter. When it receives the input rows, it needs to create a new file with data resembling that of the source file except that some of the data will be the opposite way around compared to when it started out in the pipeline.

The components you'll build are really quite simple, but the point is not their complexity, but how you use the methods in Microsoft's object model.



Professional SQL Server 2005 Integration Services
Wireless Java : Developing with Java 2, Micro Edition
ISBN: 189311550X
EAN: 2147483647
Year: 2006
Pages: 182

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net