Experiences with settings package dependencies

Is there a best practice around setting package dependencies for non-adapter packages? For example, should we be setting a dependency between a project package and a utility package, such as PSUtilities? I couldn’t fine much information outside the Developer User’s guide, which has the following info:

If a package needs the services in another package to load before it can load, you must setup package dependencies. For example, you should identify package dependencies if astartup service for a package invokes a service in another package. The startup servicecannot execute if the package containing the invoked service has not yet loaded.

You should also identify package dependencies if Java services in a package need to access Java classes contained in another package.

I received the following response from a wM PS resource, but I wanted to open up the discussion to a broader audience, since we don’t currently set dependencies, except between a connections package and it’s consumer package.


It is a generally recommended practice to set package dependencies whenever a service or object is referred from external packages. This way there is an explicit relation is set, which makes runtime and deployment time dependencies very visible. (The deployer does a good job at it though !) It becomes very apparent in case of Adapter connections, but it helps even when external services or objects are referred from within a service. There are no downside to adding dependencies.

Server will take a longer duration to start if there are too many dependencies.

I only set dependencies when “a package needs the services in another package to load before it can load, you must setup package dependencies.” Typically, this is only the case when startup services make calls to other packages.

I avoid setting dependencies in other cases. For example, I don’t set a dependency in my packages for WmTN, WmEDI, etc. The reason is that when reloading WmTN, WmEDI, etc. it will reload all dependents as well. If essentially all or many of your packages depend on one of these, the reload can be a lengthy process, akin to an IS restart–and virtually pointless. So IMO, there is a downside to adding dependencies, and essentially no upside except in relatively rare cases when it must be done.

Side note: it is a common practice to not use PSUtilities directly. Instead, copy the services you want to use to your own utilities/public package and use those. Also, avoid the math services in PSUtilities.