I'm currently writing a web software which is also going to be used by Client desktops via an API. The problem I'm facing right now is: Should I implement every action of adding/updating/deleting objects in the application twice? Once as it sits in the normal code and once isolated for the API?
Or should I much rather use a system of OOP model classes that represent all objects in my database and use those for both the API and normal code?
Or develop the API first hand and use it from my normal web interface too?
This is something I have always wondered about. Thanks in advance!
Doing things twice is almost always a bad idea -- you're probably better off implementing the API, opening it up to the end-user, and also using it for the client code as well, with some extra hooks for stuff that is interface-specific.