I'm programming against a API Library which provides classes like Document, Folder, ContentElement, Action...
These classes are basically just their respective representation from the database.
I'd like to extend (doesn't necessarily mean subclass here, could also be composition) these classes for easier handling in my application, f.e. override toString() and provide dedicated manipulation methods for my use cases.
Naming these 'wrapper' classes poses a problem:
- going for MyDocument, MyFolder ... is just ugly (even with a better prefix)
- same goes for postfix notation DocumentWrapper, FolderWrapper ...
- Using the exact same name leads to ambiguity and naming conflicts
- Inventing new words (f.e. File instead of Document and Binder instead of Folder) hides which API Class is wrapped and misleads the user of my classes because he can't use his usual terminology
In an ideal world, I would just update the API classes to my needs which I unfortunately can't as the library is closed source.
Is there another way for 'extending without renaming' I missed or do I have to go with one of the solutions above?