469,086 Members | 1,141 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,086 developers. It's quick & easy.

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

123 100+
....
...
...

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.
Jul 7 '08 #1
6 2767
DrBunchman
979 Expert 512MB
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
Jul 7 '08 #2
perhapscwk
123 100+
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.
Jul 7 '08 #3
DrBunchman
979 Expert 512MB
Ah I see, sorry to hear that and sorry I can't help you here.

Dr B
Jul 7 '08 #4
perhapscwk
123 100+
anyone can help?

thanks.
Jul 7 '08 #5
DrBunchman
979 Expert 512MB
Moved to the Software Development Forum - you might get a bit more general exposure here.
Jul 8 '08 #6
Nepomuk
3,112 Expert 2GB
....
...
...

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
Jul 8 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Patchwork | last post: by
2 posts views Thread by Chris F Clark | last post: by
17 posts views Thread by tshad | last post: by
4 posts views Thread by FluffyCat | last post: by
6 posts views Thread by Daniel Santa Cruz | last post: by
34 posts views Thread by Nate | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.