What is the Public Interface?

The Public Interface is the set of classes, interfaces and enumerations to which user assemblies are linked. We recommend to make a strict distinction between the Public Interface and the implementation classes and to package both sets of artifacts in separate assemblies, so that in no case user assemblies have to be linked to your implementation assembly.

The objective of packaging the Public Interface separately from the implementation are the following:

  1. It eliminates dependency problems: user assemblies will not need at runtime libraries that are used solely during the compilation process, like PostSharp.Core.dll, your implementation code and eventually some legacy libraries.
  2. It simplifies licensing: you can license the Public Interface and the implementation libraries under different licenses. It is perfectly possible to release your Public Interface to the public domain while publishing the implementation libraries under a more restrictive license. This way, you can avoid to propagate license constraints to user applications.

The PostSharp.Public assembly

The Public Interface of PostSharp Core is packaged in the PostSharp.Public.dll library. Unlike other assemblies, PostSharp.Public.dll is released to the public domain. The Public Interface of specific plug-ins will typically depend on this library.

With PostSharp.Public.dll, you can:

Freezing the Public Interface

Since user assemblies will be linked to the public interface, you should take care to design the Public Interface in such a way that you won't regret it in the future. Do not forget that you can neither delete, rename or change the characteristics of any public element (class, property, ...) once it has been deployed.