Quote:
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(char 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