How to handle complex business logic?


#1

Hi. I’m discovering Solid, it seems very promising for me.

By reading the documentation i have one doubt. How to handle the case of having complex bussiness logic to update the data stored in a pod, or side effects that occur outside the system?

For example, let’s say we have an online shop. Some articles are available for buying only if the quantity in stock in a physical warehouse is above some level, that varies for different product categories, or in particular seasons.

If we put the logic in the front app that manages the data, how can I ensure that the data in the POD is always valid? If the pod allows any arbitrary create or update operation, some authorized user could use a generic app and put whatever nonsense value in the store.

Can we model these business rules in the RDF semantics? Or can I embed my custom logic inside the POD some way?

Or this is not the kind of system that Solid is designed for?

Thanks.


#2

I guess that is arguable but I don’t take that view!

Your overall question is important though as well as more general - how to do x, y, z with a simple storage back-end?

I think there will be multiple approaches, the obvious and easy way is to do complex business logic in the same we as now, but as a separate service, which you will realise breaks many of the aims here. One problem is how to discourage that!

A better way is to find solutions that are consistent with decentralised data - either by extending the backend to support this or by finding novel solutions that don’t require this. My preference is the latter, but I don’t have answers to this, and have wondered myself about the data validation issue you give as an example.

Sorry not to be giving more concrete answers, but it is an opportunity so I wanted to let you know it is a good question and one worth digging into!


#3

Thanks very much. Your response is also interesting!

It’s a pity that this issue is not addressed from the beginning in Solid framework. I think that having backend that only can do plain CRUD operations with basic data validation, limits a lot the range of applications that this is useful for.

I hope that someone thinks of a novel solution to decentralize the business logic, as you say. I’ll keep investigating, let’s see if I find something.