On 4/24/09 6:36 AM, Eugene Zelenko wrote:
Hi!
On Thu, Apr 23, 2009 at 8:59 PM, Andrew Garrett<agarrett(a)wikimedia.org> wrote:
The advantage of this clear separation is that
writing an API module
is very simple, and it can be called internally, too!
I think will be good idea to use API internally (not only have
possibility to call), as result code will have more testing and
coverage.
My general inclination is to structure code into a couple layers:
Backend/internal interface:
* Wraps over direct database, processing, etc
User interface:
* Web UI
* API module
Client-side JavaScript UI code can use the API to reach the backend, but
I don't see much benefit to trying to use the API on the PHP UI end;
it'll generally just be awkward.
API code should rarely have to do any serious DB or processing work
itself; it should be calling the backend model/controller-level interface.
-- brion