I am working on a project that now needs business rules. One design discussed is to make API calls (based on the form we are on) which responds with business rules for form input. I am unsure if this is the best way. The business rules are in JSON, but the business rules server actually has a business rules engine (so the engine crunches the rules and spits out JSON).
Some background:
In our web app, various forms exist, such as for logging in, registering, editing a profile, etc. Maybe 25-30 forms. They are content managed.
For any of these forms, various rules exist to show or hide fields, or present error messages on the form based on logic such as a field name being too long, too short, or not meeting a regular expression. Other things such as required field validators, etc, exist.
The idea was to have everything centralized in a different environment (as mentioned above...on the business rules server).
I am concerned about making so many calls to a server to get simple rules like a first name being required, or showing or hiding a button based on if a person sells a certain number of widgets, etc.
Perhaps a better solution would be to have this rules engine publish to our server, and we just call the local server rather than make API calls from the front end each time.
What does everyone think? Is it natural to make API calls from our .net forms (using jquery) to get our rules for each form, each time?
Thanks!