A package, as stated previously, is a directory in which classes reside. Packages are represented in UML via the package diagram. You can use them to represent dependencies between packages and show the classes contained in a package. A package diagram is shown in Figure 5.5.
Package diagrams help you get a high-level overview of how your system will be put together. Writing these is a very iterative process, like the class diagrams. You don't always know ahead of time how you will implement a certain feature, whether you'll do it using this or that technology. Package diagrams can help you see what you can share, what you can reuse, and how you might organize your classes for reuse in other systems.
That covers the primary, fundamental aspects of how you can use UML to help plan your system. Now we move away from UML and look at two more key features of OOP: encapsulation and inheritance. In this chapter we will define these terms, overview why they are important and how they work, and prepare you for later chapters.
Top |