Can someone help me and explain how best to observe a method. This means that when a certain method is executed, the entire system should be recalculated internally at another point, for example. The same for example when a file is uploaded, then certain calculations should be triggered in the background.
Observer is deprecated and PropertyChangeListener does not help me in my case i think.
Does anyone have an idea or pattern how to map this case in Java?
Thanks
In my opinion there are 2 ways to do it:
User AspectJ. Like these two exemples: 1, 2
Create you own Annotation. Then you can receive the methods you want to trigger as the parameters. Something like this: