Skip to content

Multiple Client Support

ahanusa edited this page Jan 28, 2019 · 10 revisions

Designing and developing your middle tier with peasy-js offers the beneficial side effect of being able to consume your code from any client (browser) or server (node.js) javascript application.

Because BusinessService implementations require the injection of data proxies, your middle tier can live in different environments, with the only difference being data store implementations.

An example of this would be exposing web services (HTTP, SOAP, etc.) via node.js and Express that consume your middle tier and inject your business services with data proxies that communicate directly with a database.

You might then deploy a client application (react, angular, ember, aurelia, etc.) that consumes the same middle tier, only to have your business services injected with data proxies capable of communicating with your web services instead of a database.

In this scenario, the middle tier logic (initialization, business and validation rules, and command logic) can all be consumed by multiple clients varying only by business services injected with different, swappable data proxy implementations.

Clone this wiki locally