Table of Contents Previous Section Reusable Components

Reusable Components

One of the strengths of the WebObjects architecture is its support of reusable components. Any component that you define can be reused by any WebObjects application. The most common type of component represents an entire HTML page. However, WebObjects also supports components that represent a part of a page and can be used within multiple pages of the same application or even multiple sections of the same page.

Although some pages must be crafted individually for an application, many could be identical across applications. Even pages that aren't identical across applications can share at least some portions (header, footer, navigation bars, and so on) with pages in other applications. With reusable components, you can factor out a portion of a page (or a complete page) that's used throughout one or more applications, define it once, and then use it wherever you want, simply by referring to it by name.

To reuse an existing component, you must add it to each application that wants to use it.

When you add one component to the page of another component, WebObjects Builder displays it as a custom element. You use this component just like you would use any other dynamic element that you drag from the palette.

For more information on reusable components, see "Creating Reusable Components" in the WebObjects Developer's Guide. Also, "Reusing Components" and "Creating Reusable Components" in this guide describe how to use a component within another component and how to create a reusable component using WebObjects Builder.


Table of Contents Next Section