Select design pattern which allow extrapolate repeat of code in separate classes

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • perhapscwk
    New Member
    • Sep 2007
    • 123

    Select design pattern which allow extrapolate repeat of code in separate classes

    ....
    ...
    ...

    Both of the procedures have repeating sections of code: sending an e-mail and adding a log entry.

    Task:
    *1.Select a design pattern (substantiate your choice) that would allow extrapolating repeating sections of code in separate classes
    2.The selected programming pattern must support the appropriate level of abstraction to allow for additional handlers (ie. marketing modules) to be hooked into any business procedure.

    Anyone can give me some advise? use which design pattern?
    After I choose the specific design pattern, do you think i need to write the code
    as well? I not sure what this task want me to do. thanks.
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    Hi perhapscwk,

    The question doesn't ask you to write any code but then I'd double check with whoever set you the work to be sure. As for the design pattern I'd have thought that your own classes/text books will give you a better idea of the sort of answer that is expected here - I presume that you've had some lessons on this stuff?

    Dr B

    Comment

    • perhapscwk
      New Member
      • Sep 2007
      • 123

      #3
      Originally posted by DrBunchman
      Hi perhapscwk,

      The question doesn't ask you to write any code but then I'd double check with whoever set you the work to be sure. As for the design pattern I'd have thought that your own classes/text books will give you a better idea of the sort of answer that is expected here - I presume that you've had some lessons on this stuff?

      Dr B
      I go to interview and this question is one of the test question..I fail it.
      SO want to know how to answer. thanks.

      Comment

      • DrBunchman
        Recognized Expert Contributor
        • Jan 2008
        • 979

        #4
        Ah I see, sorry to hear that and sorry I can't help you here.

        Dr B

        Comment

        • perhapscwk
          New Member
          • Sep 2007
          • 123

          #5
          anyone can help?

          thanks.

          Comment

          • DrBunchman
            Recognized Expert Contributor
            • Jan 2008
            • 979

            #6
            Moved to the Software Development Forum - you might get a bit more general exposure here.

            Comment

            • Nepomuk
              Recognized Expert Specialist
              • Aug 2007
              • 3111

              #7
              Originally posted by perhapscwk
              ....
              ...
              ...

              Both of the procedures have repeating sections of code: sending an e-mail and adding a log entry.

              Task:
              *1.Select a design pattern (substantiate your choice) that would allow extrapolating repeating sections of code in separate classes
              2.The selected programming pattern must support the appropriate level of abstraction to allow for additional handlers (ie. marketing modules) to be hooked into any business procedure.

              Anyone can give me some advise? use which design pattern?
              After I choose the specific design pattern, do you think i need to write the code
              as well? I not sure what this task want me to do. thanks.
              Sounds to me like generic programming, maybe combined with Inheritance. This would allow "repeating sections of code in seperate classes" (e.g. addText(string blabla) or setTextFormat(c har format)) and have "the appropriate level of abstraction to allow for additional handlers" (e.g. setEMailAddress (string address) or postComment()) to be added.

              I don't know, if such an answer was requested, but it's what I would answer in short.

              Greetings,
              Nepomuk

              Comment

              Working...