aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Pettern Advice needed 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 "Pettern Advice needed" Watch "Pettern Advice needed" New topic
Author

Pettern Advice needed

Maalti Iyer
Ranch Hand

Joined: Jul 11, 2001
Posts: 52
Hi,

I'm new to the pattern world. My problem at hand is :
My JMS client receives three types of messages (JMS) and based on the type of content (several thousand messages) it will update or insert several tables (which are also used by an online system). The system has to be flexible enough to accomdate more tables in the future. Wondering what pattern suits this problem?.

Thanks
Maalti
Amit G Piplani
Ranch Hand

Joined: Jul 21, 2004
Posts: 83
I don't think so any pattern will solve that flexibility, you have to design your framework for this.


SCJP,SCWCD,SCBCD,SCDJWS1.4, SCDJWS1.5
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
I find myself using Command / Strategy a lot. I have a goal of a stable core that is closed for modification but open for extension for new products and user groups.

Create a command based on some field in the inbound message and delegate to the command. You can build a core message receiver & dispatcher that never changes and add dozens of new commands through configuration.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Maalti Iyer
Ranch Hand

Joined: Jul 11, 2001
Posts: 52
I understand Command. For each message type I issue one command.What will be the role of Strategy?. How to implement it here?

Again Thanks
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Command, Strategy and State all look a lot alike in the static object models. You obtain a concrete object based on some criteria and delegate to it. The motivation, benefits and timing are subtly different. If you have GoF review just the problem descriptions and reasons you might use the pattern. See if I used command terminology in a place where strategy might be a better fit. The code will work either way
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Pettern Advice needed