I have a set up for web app that is separated into to applications acting in client-server manner. Client app is web accessible. Server app can be accessed only by the client app. Only server app has access to DB and other business logic related stuff. Both are built on some MVC frameworks.
Models will be present in both applications where client's models will use the server's API instead of DB for repository and gaining some kind of transparency. Models in server app are used as usual - objects representing DB entities. Client app will decide, if needed, what call to be made to the server app depending on the model's name, method, parameters and so on.
Something like:
// in client app
$product = new Product();
$product->setFromArray($someDataGoesHere);
$product->save();
// equals to: POST http://ift.tt/1B0PVly
// which creates a new product
I wonder if there is some design pattern close to that idea that I can use as a reference and best practices?
Aucun commentaire:
Enregistrer un commentaire