Declarative and flexible attachments