Next code shows you a possible solution. Instead of new shapes or decorations I propose some .style which will add U or circles to regular nodes. I've preferred to use this solution instead of pics because It's not so easy to place last ones.
All component boxes are defined with
component/.style={draw, rounded corners, minimum width=3cm, minimum height=1.5cm, fill=green}
while u and o additions are based in two circle nodes
u/.style={draw,circle,minimum size=7mm,outer sep=0pt}, o/.style={draw,circle,minimum size=6mm,outer sep=0pt}
The o-arm is just a line with a circular node attached to it:
owest/.style 2 args={append after command={ \pgfextra \draw ([yshift=#1]\tikzlastnode.west)--++(180:6.5mm) node[o,anchor=east] (\tikzlastnode-#2) {}; \endpgfextra}}, owest/.default={0mm}{owest},
and the u-arm is also a line with a circular node, but clipped to its half:
ueast/.style 2 args={append after command={ \pgfextra \begin{scope} \clip ([yshift={#1+4mm}]\tikzlastnode.east) rectangle ++(1cm,-8mm); \draw ([yshift=#1]\tikzlastnode.east)--++(0:6.5mm) node[u,anchor=west] (\tikzlastnode-#2) {}; \end {scope} \endpgfextra}}, ueast/.default={0mm}{ueast},
As you can see both styles have two arguments, the first one is a x/y-shift around the main anchor (north, west, south, east) and the second a name sufix. Both arguments will help to draw double connections between component. By default their values are 0mm shift and suffix {u|o}{north|east|south|west}.
Both u and o components are circular nodes instead of just circles because this way it's easier to draw paths to any of their positions like in your last three examples.
As you can see all dimensions are fixed, but you can change according your taste. With the code provided, u-arm is 1cm long, o-arm is 1.25cm long and distance between nodes should be 2cm to simulate attaching both. May be you'll have to take care with these values in case you change line width.
\node[component,ueast,onorth] (A) {A}; \node[component, right=2cm of A, owest,unorth] (B) {B}; \draw[|<->|,red] ([yshift=-3mm]A.north east)--++(0:2cm) node[above,midway]{\SI{2}{\centi\meter}}; \draw[|<->|,red] ([xshift=5mm]B.north)--++(90:{1cm}) node[right,midway]{\SI{1}{\centi\meter}}; \draw[|<->|,red] ([xshift=-5mm]A.north)--node[left]{\SI{1.25}{\centi\meter}} ++(90:{1.25cm});
When component nodes are separated, you can draw lines between any positions of their u or o nodes.
Be careful. You can use something like B-owest when referring to a o-arm node because B-owest really means "draw until B-owest.center and stop at its border", but it you use this expression with an u-arm, the same will happen. The blue line in next example shows it. Next code shows how to solve this problem using explicit border anchor points, like A-ueast.west or B-owest.130. The last one is an anchor at angle 130 over nodes border and the first is an alias for A-ueast.180.
\node[component,ueast] (A) {A}; \node[component, right=5cm of A, owest] (B) {B}; \draw (A-ueast.west)--(B-owest); \draw[red] (A-ueast.170)--(B-owest.130); \draw[red] (A-ueast.-120)--(B-owest.south);

With this syntax it's easy to get joints like in third example:


When you have to draw more than one connection in same component side you can use the corresponding style, but providing corresponding arguments. Something like:
\node[component,onorth={-5mm}{-5},onorth={5mm}{5}] (A) {A}; \node[component, above=2cm of A,usouth={-5mm}{-5},usouth={5mm}{5}] (B) {B};

or
\node[component,oeast={-4mm}{-4},ueast={4mm}{4}] (A) {A}; \node[component,right=4cm of A,uwest={-4mm}{-4},owest={4mm}{4}] (B) {B}; \draw (A--4)--(B--4.east); \draw (A-4.west)--(B-4);

That's all. Now the complete code:
\documentclass[tikz,border=2mm]{standalone} \usetikzlibrary{positioning} \usepackage{siunitx} \begin{document} \tikzset{ component/.style={draw, rounded corners, minimum width=3cm, minimum height=1.5cm, fill=green}, u/.style={draw,circle,minimum size=7mm,outer sep=0pt}, o/.style={draw,circle,minimum size=6mm,outer sep=0pt}, ueast/.style 2 args={append after command={ \pgfextra \begin{scope} \clip ([yshift={#1+4mm}]\tikzlastnode.east) rectangle ++(1cm,-8mm); \draw ([yshift=#1]\tikzlastnode.east)--++(0:6.5mm) node[u,anchor=west] (\tikzlastnode-#2) {}; \end {scope} \endpgfextra}}, ueast/.default={0mm}{ueast}, uwest/.style 2 args={append after command={ \pgfextra \begin{scope} \clip ([yshift={#1+4mm}]\tikzlastnode.west) rectangle ++(-1cm,-8mm); \draw ([yshift=#1]\tikzlastnode.west)--++(180:6.5mm) node[u,anchor=east] (\tikzlastnode-#2) {}; \end {scope} \endpgfextra}}, uwest/.default={0mm}{uwest}, unorth/.style 2 args={append after command={ \pgfextra \begin{scope} \clip ([xshift={#1+4mm}]\tikzlastnode.north) rectangle ++(-8mm,1cm); \draw ([xshift=#1]\tikzlastnode.north)--++(90:6.5mm) node[u,anchor=south] (\tikzlastnode-#2) {}; \end {scope} \endpgfextra}}, unorth/.default={0mm}{unorth}, usouth/.style 2 args={append after command={ \pgfextra \begin{scope} \clip ([xshift={#1+4mm}]\tikzlastnode.south) rectangle ++(-8mm,-1cm); \draw ([xshift=#1]\tikzlastnode.south)--++(-90:6.5mm) node[u,anchor=north] (\tikzlastnode-#2) {}; \end {scope} \endpgfextra}}, usouth/.default={0mm}{usouth}, oeast/.style 2 args={append after command={ \pgfextra \draw ([yshift=#1]\tikzlastnode.east)--++(0:6.5mm) node[o,anchor=west] (\tikzlastnode-#2) {}; \endpgfextra}}, oeast/.default={0mm}{oeast}, owest/.style 2 args={append after command={ \pgfextra \draw ([yshift=#1]\tikzlastnode.west)--++(180:6.5mm) node[o,anchor=east] (\tikzlastnode-#2) {}; \endpgfextra}}, owest/.default={0mm}{owest}, onorth/.style 2 args={append after command={ \pgfextra \draw ([xshift=#1]\tikzlastnode.north)--++(90:6.5mm) node[o,anchor=south] (\tikzlastnode-#2) {}; \endpgfextra}}, onorth/.default={0mm}{onorth}, osouth/.style 2 args={append after command={ \pgfextra \draw ([xshift=#1]\tikzlastnode.south)--++(-90:6.5mm) node[o,anchor=north] (\tikzlastnode-#2) {}; \endpgfextra}}, osouth/.default={0mm}{osouth}, } \begin{tikzpicture} \node[component,ueast,onorth] (A) {A}; \node[component, right=2cm of A, owest,unorth] (B) {B}; \draw[|<->|,red] ([yshift=-3mm]A.north east)--++(0:2cm) node[above,midway]{\SI{2}{\centi\meter}}; \draw[|<->|,red] ([xshift=5mm]B.north)--++(90:{1cm}) node[right,midway]{\SI{1}{\centi\meter}}; \draw[|<->|,red] ([xshift=-5mm]A.north)--node[left]{\SI{1.25}{\centi\meter}} ++(90:{1.25cm}); \end{tikzpicture} \begin{tikzpicture} \node[component,ueast] (A) {A}; \node[component, right=5cm of A, owest] (B) {B}; \draw[line width=1mm, blue, opacity=.5] (A-ueast)--(B-owest); \draw (A-ueast.west)--(B-owest); \draw[red] (A-ueast.170)--(B-owest.130); \draw[red] (A-ueast.-120)--(B-owest.south); \end{tikzpicture} \begin{tikzpicture} \node[component,unorth] (A) {A}; \node[component, above right=3cm and -5mm of A, osouth] (C) {C}; \node[component, above left=3cm and -5mm of A, osouth] (B) {B}; \draw (A-unorth.-85)|-(C-osouth); \draw (A-unorth.-95)|-(B-osouth); \end{tikzpicture} \begin{tikzpicture} \node[component,onorth={-5mm}{-5},onorth={5mm}{5}] (A) {A}; \node[component, above=2cm of A,usouth={-5mm}{-5},usouth={5mm}{5}] (B) {B}; \end{tikzpicture} \begin{tikzpicture} \node[component,oeast={-4mm}{-4},ueast={4mm}{4}] (A) {A}; \node[component,right=4cm of A,uwest={-4mm}{-4},owest={4mm}{4}] (B) {B}; \draw (A--4)--(B--4.east); \draw (A-4.west)--(B-4); \end{tikzpicture} \end{document}