(--------)
Your example is interpreted as a sequence diagram, that's why it is drawn as:
If you want a class/object diagram, you can change it in:
Object bar Foo <--o bar