Componentizing Winamp – Pt 4
When we last left off, in Part 2 of this series we had installed Winamp while monitoring all the resources installed or modified on the system, capturing that information in a log. After that, in Part 3, we had ported the registry and file resources from that log into Component Designer.
Next up, let’s get your component cleaned up by adding a few component objects (Repository object and Package object). In Part 5 we’ll do the dependency analysis which will be fun.
Not many people probably know this, but I’ve got OCD tendencies that are enough to drive you batty if you have to be near me for a while. As such, at this point of the component development there is this “itch” I haven’t scratched yet and that’s the cleanup of the SLD and Repository folders so everything can be nice and tidy.
So let’s say I’m working on my dev machine in the D:\Working\Winamp folder. I will create the following sub folders below to contain my SLDs, File Repository and documentation or notes for the folks that will be consuming this package:
D:\Working\Winamp
\SLD
\REP
\DOCs
Obviously all SLDs go to “SLD”, all file resources (including those with decorated names) go to the “REP” folder, and all dev notes or import instructions go to the “DOCs” folder.
I have to bite my tongue when someone gives me their package of componentized drivers and they have all SLDs and file resources lumped into the same folder, it’s really messy and more prone to error or accidents while dev’ing it. Keeping SLDs and file resources seperate will make your job a little saner.
Now that we have everything in its place, open the SLD in Component Designer and create your Repository object. To do this, right click on the Repositories node and “Add Repository”, give it an intuitive name like “Winamp”. The important part here when creating this object that some people mess up is ensuring you have the correct “Source Path”. The default Rep location is “.\”, click the Browse button and browse to the “REP” folder you created above or wherever you dumped the file resources. If you did it like the path I created above should now read “.\..\Rep”.
Next, under the Packages node in your SLD, add a new package object. Let's call it “Winamp”. This is important because you’re going to associate all other objects in this SLD to this package object. So if you later need to delete Winamp from the database all you have to do is delete the “Winamp Package” from Database Manager and everything associated with it will be removed as well! Not many people have figured this out, it’s very handy.
In the repository’s Group Membership node, select "Add Group Membership" and expand the Packages node to see all available packages in the database and in the SLD, it should include your new package even though you haven't imported it yet. You’ll see the newly created “Winamp” package object here, select this in order to associate your Rep object with the package.
Next, under the Winamp component, go to the “Group Memberships” node and select “Add Group Membership”. Assign it to a category like “Test and Development” or to your own custom category (see the post on creating your custom category).
Overall what you’ve accomplished is:
• Cleaned up the folder structure for the bits and sld
• Created a Package object
• Created a Repository object which points to the REP folder as the source location for the files. The contents of this folder is what is copied to the Embedded Component Database when the component package is imported through Database Manager.
• Made the Winamp component depend on the Package object
• Added the Winamp component to a category
• Made the Repository object depend on the Package object
- Andy
Comments
- Anonymous
September 02, 2005
Over the Spring of '05, I posted a series of blog posts on the end to end process to componentize 3rd...