Function Revealing Package Name

(Referenced from CreatingJavaPackages)

Sometimes you have a set of classes that participate in a set of common functions, but whose purposes cross layer boundaries in a FourLayerArchitecture. An example of this would be in a set of standard utility classes. Let's say that you create a special Collection class that is useful both in your Servlets and also in your database brokers. How do you place such classes in a package?

Package naming and package placement is a tricky problem. Obviously, you would not want to place a generally useful class like this in a package with other, vastly unrelated classes, as this would make it challenging to deploy these classes, or create unwanted dependencies betweeen packages. However, beyond that, even if you do decide to put your special collection in a class with similar classes, what do you name this package?

A "layered" Java package naming convention (like that suggested in http://c2.com/ppr/envy/) would not apply in this case, since these classes cross layer boundaries. Therefore,

Create a package name that reveals the purpose and function of the classes it contains, but that does not reflect a particular layer. For instance, name your Collection package com.xxx.collections.


EditText of this page (last edited August 10, 2000) or FindPage with title or text search