Principles of Package Design by Matthias Noback

Principles of Package Design by Matthias Noback

Author:Matthias Noback [Matthias Noback]
Language: eng
Format: epub, mobi
Publisher: leanpub.com
Published: 2014-04-18T04:00:00+00:00


The Common reuse principle

In the previous chapter we discussed Release/reuse equivalence principle. It is the first principle of package cohesion: it tells an important part of the story about which classes belong together in a package, namely those that you can properly release and maintain as a package. You need to take care of delivering a package that is a true product.

If you follow every advice given in the previous chapter, you will have a well-behaving package. It has great usability and it’s easily available, so it will be quickly adopted by other developers. But even when a package behaves well as a package, it may at the same time not be very useful.

When you group classes into packages there are two extremes that need to be avoided. You may have a very nice collection of very useful classes, implementing several interesting features. If you release all the classes as one package, you force your users to pull the entire package into their project, even if they use just a very small part of it. This is quite a maintenance burden for them.

However, if you put every single class in a separate package, you will have to release a lot of packages. This increases your own maintenance burden. At the same time users have a hard time to manage their own list of dependencies and keep track of all the new versions of those tiny packages.

In this chapter we discuss the second package cohesion principle, which is called the Common reuse principle. It helps you decide which classes should be put together in a package and what’s more important: which classes should be moved to another package. When we are selecting classes or interfaces for reuse, the Common reuse principle tells us that:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.