• 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

Design to invoke correct handler

 
Ranch Hand
Posts: 279
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a class called "DmsCheckinDoc". This class will invoke another class based on the "appName" parameter passed to it. If parameter passed is "cobs" then class "CobsHandler" will be invoked. If parameter passed in "dobs" then "DobsHandler" will be invoked.

The "DmsCheckinDoc" looks something like this



The decision as to which handler class to invoke is there in "DmsCheckinFactory". The lookup method finds out the handler class (from a properties file) based on the appName parameter. The "DmsCheckinFactory" looks like this



One of the handler class looks something like this


The interface implemented by CobsHandler looks like this


Can someone please let me know if the above approach is correct. Given these requirements, am I implementing the design pattern correctly?

Thank you
 
reply
    Bookmark Topic Watch Topic
  • New Topic