Publishing, Finding, and Reusing Components

   

The biggest challenge of component-based development is managing all the separate components. Within a single application you may have hundreds or even thousands of separate components, and use each of these components in many different places in the program. What's more, you can reuse many components in other applications, saving enormous development time and effort — if you can locate the right component when you need it.

Visual Component Manager addresses the three main requirements for storing and organizing components: publishing, finding, and reusing them.

It provides a single source to organize, find, and insert components into your project. It can also be the centralized location for approved project programming conventions, functional specifications, and architectural models and diagrams.

Publishing Components

Publishing a component means storing it in a Visual Component Manager repository database, along with attributes and search keywords that will make it easy for others to find and reuse it.

When you publish a component, you add it to a Microsoft Repository database. This can be a local (Microsoft® Access) database on your own workstation, or it can be a shared Microsoft® SQL Server™ database on a network server. A shared database gives everyone who has access to that server the ability to find and reuse your component.

Visual Component Manager provides a single location for anything that can be added to a Microsoft® Visual Studio™ project. It allows you to catalog components, to find them easily using flexible search criteria, and to insert them into your project with point-and-click ease.

For example, you might create a template for a standard form used in all the accounting applications at the company, or a standard tax-calculation object that can be used in many applications. Cataloging these components on a shared repository database provides an easy way for all of the organization's developers to find and use the components. It also provides a convenient method of documenting their interfaces and usage requirements.

In addition to single components, Visual Component Manager can also store component libraries, templates, models, and complete application frameworks. For example, a tool developer might create a set of forms and basic modules that are the starting point for new forms and modules of the same type. By creating a template stored in Visual Component Manager, any developer can get a copy of the forms or modules and be able to add to or change it without affecting the original.

Because Visual Component Manager supports multiple databases, it is possible to selectively browse through items in a local repository database, switch to a departmental repository database (on a shared server), and then finally to enterprise scope on another shared database. In any repository database, you can use Visual Component Manager to drag items of interest into your local database, or insert them directly into your project.

For More Information   To see step-by-step instructions for publishing components, see Publishing Components. For detailed information about the Microsoft Repository, search online in the MSDN Library Visual Studio 6.0 for "Repository Overview".

Finding Components

Visual Component Manager provides a flexible keyword and search mechanism to help organize and cross-reference components very flexibly. You can catalog and search for components by the component name, type, description, keywords, and annotations. With full text search capability, you can find components even if you don't know the exact component name.

Making best use of this search capability requires careful thought and consideration when you are publishing a component. You should be sure to enter the keywords most likely to describe the component to someone looking for it, or for someone searching for a component that has its functionality.

The keyword scheme also lets you group and categorize components hierarchically. For example, "Accounting" components might be further subdivided with keywords such as "Accounts Receivable" and "Payroll." By defining keywords to match both the larger category and the subcategories, a user can find either all items with the "Accounting" keyword, or just a subset with the "Payroll" keyword.

To provide good examples of well-indexed component entries, Visual Component Manager allows you to install entries for all controls, templates, forms, and other components supplied by Microsoft® Visual Basic®. You are given this option when you first run Visual Component Manager from within Visual Basic. Useful descriptions and keywords have already been entered, allowing you to find the component or tool you are looking for, and then launch or add it to your project with a click of the mouse.

For More Information   For step-by-step instructions on finding components in a Visual Component Manager repository database, see Finding Components.

Reusing Components

Visual Component Manager lets you easily share and reuse code components, documentation, and other pieces of a project, as well as complete projects. When you locate a component you need, reusing it in your current project is usually as simple as clicking Add to my project on the component's shortcut menu. When reusing components that require Component Object Model (COM) registration, Visual Component Manager automatically registers the component for you when adding it to your project.

Programmers often create modules that contain "utility" functions that are used over and over again, to avoid reinventing the wheel. Storing such modules in Visual Component Manager provides an easy way to find and reuse such modules.

You can also associate additional files with components. A particular component may require the presence of additional support files such as .dll files, Help files, or documentation. With Visual Component Manager, you can associate multiple files with any component. This association becomes a part of the component item's properties in Visual Component Manager, and the associated files can be loaded along with the item.

When you use it in this way, Visual Component manager can also be the central location for approved project programming conventions, functional specifications, architectural models, and diagrams.

For More Information   For step-by-step instructions on reusing components that have been published in Visual Component Manager, see Reusing Components in Your Project.