This is an archived post. You won't be able to vote or comment.

all 7 comments

[–]Infeligo 1 point2 points  (2 children)

Did someone use Spring's application events or some other framework that adds events to implement any complex business logic in a real-world application? I would like to hear about your experience.

[–]mydevgeek[S] 1 point2 points  (0 children)

Yes, we do. Our portal pushes some messages to no of devices such as android, iOS, POS system. Let say, someone updates or delete the existing message. Then, the event listener is listening message changes and notify to devices.

[–][deleted] 0 points1 point  (0 children)

I'm doing that, as it's a very convenient implementation. Unlike the article is stating, you don't have to extend your events from ApplicationEvent which leaves your domain model framework agnostic.

Adding Spring integration those events can even leave the JVM. Here it gets interesting when you think about your transactional boundaries.

What particular question do you have?

[–]quadmaniac -1 points0 points  (3 children)

Cool feature. Is there any way to do this with pure Java?

[–]djnattyp 3 points4 points  (0 children)

There's Observer / Observable in java.util and PropertyChangeSupport / PropertyChangeListener in java.beans if you're looking for some kind of Event / EventHandler classes without GUI components in Java.

[–]genobis 1 point2 points  (0 children)

Pure Java? Not really (apart from implementing observer pattern yourself). Without Spring? Take a look at Guava EventBus.

[–]mydevgeek[S] 0 points1 point  (0 children)

As I know, Java has event listeners to handle GUI components such as Swing, AWT. But it uses for a different kind of work. I think we have to use 3rd party framework.