• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Pettern Advice needed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't think so any pattern will solve that flexibility, you have to design your framework for this.
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Maalti Iyer
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic