How to share functionality between plugins?

I did it via hardlinking every single shared file.
Not the most robust scalable solution though.