On Fri, Aug 22, 2008 at 2:02 AM, Jim R. Wilson wilson.jim.r@gmail.com wrote:
On the other hand, if you consider the supporting PHP classes through which api.php makes its calls as part of "the API" then I still contend that there are probably cases where it would be easier or simpler (or both) to just use it than say construct all the database queries onesself.
Those are what I'm calling the "backend", which is supposed to be called separately by both the human UI and the bot API. As well as any extensions.
On Fri, Aug 22, 2008 at 2:51 AM, Nikola Smolenski smolensk@eunet.yu wrote:
As an extension author, I can say that in one of my extensions I have used the API to great satisfaction of everyone :)
Which one?
On Fri, Aug 22, 2008 at 4:40 AM, Roan Kattouw roan.kattouw@home.nl wrote:
Using the API internally is useful in some cases, yes. If you're gonna run a complex query the API happens to support, you're usually better off using the API, to prevent code duplication.
So why does the API have any logic to do anything except translate the HTTP query into backend functions and display the results? If you have a lot of internal logic anywhere, that other callers would like to use, I suspect that would be best moved into the actual classes somehow. It's the same as with the human UI: you shouldn't (ideally) be mixing business logic with logic for a specific output type.