1 Reply Latest reply: Mar 12, 2010 7:07 AM by 800387 RSS

    suggest what design pattern is applicable for my case

    513500
      I have an object called GrantAward , these awards I have to show to the user for selection

      1. I call a web service to get list of GrantAwards.
      2.for each GrantAward check if this is present in my database
      a. if not there insert
      3.for each GrantAward check some conditions
      a if satisfied add to the list to show to user
      b if not satisfied do not add to list .


      these are the steps involved before I can show the GrantAwards to user for selection , please suggest me what design pattern can I use ?
        • 1. Re: suggest what design pattern is applicable for my case
          800387
          I'm not sure you want to hunt for patterns when you already know what you are implementing. A lot of people have pattern fever. Patterns are useful constructs for communicating design ideas and enforcing best practices. But I rarely go out and hunt for a specific pattern (or name my objects after patterns). If you are doing a heavyweight methodology with RUP or something similar, I could see stereotyping your UML with patterns.

          That having been said, you already have a Facade with your service. You are undoubtedly using DataAccessObject to fetch your records. Your conditions could be implemented with a ChainOfResponsibility and/or Strategy pattern. What you return could be a Composite. Potentially the request and response are a Command. And your overall architecture could be MVC.

          But IMO that is overkill.

          - Saish