\documentclass{article}

\usepackage{uml}

\begin{document}
  \begin{tikzpicture}
    \umlclass[name=A,label=a](1,1){}
    \umlclass[name=B,label=b](8,1){}
    \umlclass[name=C,label=c](8,8){}
    \umlclass[name=D,label=d](1,8){}
    \umlasso[name=1,name end=ne1,arity end=ae1,name start=ns1,arity start=as1](a)(b)
    \umlasso[name=2,name end=ne2,arity end=ae2,name start=ns2,arity start=as2](b)(c)
    \umlasso[name=3,name end=ne3,arity end=ae3,name start=ns3,arity start=as3](c)(d)
    \umlasso[name=4,name end=ne4,arity end=ae4,name start=ns4,arity start=as4](d)(a)
  \end{tikzpicture}

  \begin{tikzpicture}
    \umlclass[name=A,label=a](1,1){}
    \umlclass[name=B,label=b](8,1){}
    \umlclass[name=C,label=c](8,8){}
    \umlclass[name=D,label=d](1,8){}
    \umlasso[name=1,name end=ne1,arity end=ae1,name start=ns1,arity start=as1](a)(c)
    \umlasso[name=2,name end=ne2,arity end=ae2,name start=ns2,arity start=as2](b)(d)
  \end{tikzpicture}

\end{document}

