I am new to programming against interfaces, and I try to make this the right tool for developing a test.
We currently have many manager classes that implement the CRUD interface. However, some managers still do not make updates, and some do not delete, some of them can never do it.
An exception is not implemented?
It's alright just
throw new NotImplementedException()
until the method is implemented, or even for the whole time, if it never does?
(obviously, with a source code comment telling the programmer "this method is not supposed to be used, for example, such as" male "," female "are never deleted)?
Split up?
Or should I split my CRUD interface into Creatable, Readable (Searchable), Updatable, and Deletable? Wouldn't that hurt the definition of my class?
PersonManager implements Creatable<Person>, Updateable<Person>, Deletable<Person>, Searchable<Person>
Split and merge?
Or do I need to combine some interfaces, such as all 4, in CRUD, and possibly some other combinations, such as Read + Update?
Maybe this will also create a load of interfaces, where you need to click on a large inheritance path to find out which interface implements all the necessary atomic interfaces for the current situation (do I need to read and create, so one of them implements two ?, and this can become much more complicated fast)