Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-x5gtn Total loading time: 0 Render date: 2024-05-21T06:59:59.966Z Has data issue: false hasContentIssue false

6 - Packaging Conventions

Published online by Cambridge University Press:  07 September 2010

Allan Vermeulen
Affiliation:
Ambysoft Inc., Toronto
Scott W. Ambler
Affiliation:
Rogue Wave Software
Greg Bumgardner
Affiliation:
Ambysoft Inc., Toronto
Eldon Metz
Affiliation:
Rogue Wave Software
Trevor Misfeldt
Affiliation:
Rogue Wave Software
Jim Shur
Affiliation:
Rogue Wave Software
Get access

Summary

This section contains guidelines for creating packages. See Rules #15–17 for conventions related to package naming.

Place types that are commonly used, changed, and released together, or mutually dependent on each other, into the same package.

This rule encompasses several related package design principles:

The Common Reuse Principle

A package consists of classes you reuse together.

If you use one of the classes in the package, you use all of them.

Place classes and interfaces you usually use together into the same package. Such classes are so closely coupled you cannot use one class without usually using the other. Some examples of closely related types include

  1. ■ Containers and iterators.

  2. ■ Database tables, rows, and columns.

  3. ■ Calendars, dates, and times.

  4. ■ Points, lines, and polygons.

The Common Closure Principle

A package consists of classes, all closed against the same kind of changes. A change that affects the package affects all the classes in that package.

Combine classes that are likely to change at the same time, for the same reasons, into a single package. If two classes are so closely related that changing one of them usually involves changing the other, then place them in the same package.

The Reuse/Release Equivalence Principle

The unit of reuse is the unit of release. Effective reuse requires tracking of releases from a change control system. The package is the effective unit of reuse and release.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2000

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

Available formats
×