Subpatches can be created in Pd with the pd object.
Inlets and outlets in a Pd subpatch are created with objects named inlet and outlet.
The send and receive objects can be used to communicate with the subpatch (or inlets and outlets).
A subpatch can be set (via the inspector) to “graph on parent,” which allows GUI elements, comments, arrays and data structures placed in a sub-region of the subpatch canvas to be visible in the parent patch.