System architecture doubts [closed]

0

Good afternoon, I have to change the system here of the company, and it will get more complex. We are a construction company, each work we work on is pre-budgeted, when the buyer is going to add an order, the system has to check if there is a purchase requisition made by the construction site personnel with this material, then the system has to check if the material is in the budget, and then check if the unit values are not greater in the request than in the budget, then check the same thing for the total amount ... each material that the buyer adds ad access in the database, loading a budget list and doing the validations, would it have to be that way? What strategy would you use to solve this?

    
asked by anonymous 25.02.2016 / 21:26

1 answer

1

If you do not want to make multiple requests to the database, which I honestly do not think is a problem when the methods are well implemented, and the query returns do not have a lot of data, then you can do another approach. By implementing a procedure in the database, where you implement all of your business rules that you quoted above.

However, this is not a practice of putting business rules inside the database is not very well accepted in the face of most of the developed patterns in the market, but some rare times is the only solution.

Now if you do not want to leave in the database, and do not make too many access to the database in your application layer, then you could consider implementing some kind of asynchronous service, and you can use a webservice for that. But you will have to assess the impact very well as it may impact the usability of the software.

I hope I have helped.

    
25.02.2016 / 21:51