How use spring @Service?

I would like to have a @Service layer with all the business rules like in my others spring boot app.

As Jmix is based on entities, I need to create lots of computed values to use them in my different screens, but I didn’t manage to inject services in entities (and I’m not certain that’s a good pattern)…

So maybe my question is what are the recommendations to architecture business logic and reuse logic in computed values, screens code, listeners,…

Using services from entity accessor methods is certainly not a good idea.

My recommendation is to use load/commit delegates as shown in External Data Sample project.

Ok, I can add behavior on my entity with business logic written in the service.

But why set the event load/commit logic of the entity in the UI ?

In the sample project Transient Attributes Demo

If I create an api for this entity I will have to duplicate the load/commit call…
Isn’t it better to have this logic in the EventListener or Lifecycle ?

It’s up to you where to place the logic: in the load/commit delegates or in a service which is invoked by these delegates.