File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes OO, Patterns, UML and Refactoring and the fly likes Use the delegate pattern? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Use the delegate pattern?" Watch "Use the delegate pattern?" New topic

Use the delegate pattern?

Bhavee Abhilash

Joined: Jan 20, 2009
Posts: 3
I have got 2 major entities which undertakes multiple functions.

Class X - calls Class X1 --> X2 --> X3--> X4

Class Y - Calls Class Y1, --> Y2 -->Y3 --->Y4

(Where 1 is posting to Queues and 2,3,4 are separate classes representing some major functions)

Am using Spring - where all these are inter-twined using IOC principles. So when X is invoked, it completes all tasks till X4 and then moves to task Y.

However my requirement says - once X1 is called, Y to be invoked immediately . X2,X3,X4 may happen parallel while B is in operation.

Since there is no "easy" options (within my limited experience) in Spring to invoke parallel invocation of X and Y beans, I was wondering to have some sort of pattern like Delegate can help me to resolve this.

For eg : So X pushes to message to MQ.. While MQ-listener (X2) takes over the rest of the job, Y is invoked immediately.

What would be the best solution I can apply? Any suggestions / Feedback - would be highly appreciated.


I agree. Here's the link:
subject: Use the delegate pattern?
It's not a secret anymore!