Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old July 7th, 2008, 04:19 PM
Member
 
Join Date: Sep 2007
Posts: 54
Default 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.
Reply
  #2  
Old July 7th, 2008, 04:25 PM
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 922
Default

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
Reply
  #3  
Old July 7th, 2008, 05:18 PM
Member
 
Join Date: Sep 2007
Posts: 54
Default

Quote:
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.
Reply
  #4  
Old July 7th, 2008, 05:23 PM
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 922
Default

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

Dr B
Reply
  #5  
Old July 7th, 2008, 06:53 PM
Member
 
Join Date: Sep 2007
Posts: 54
Default

anyone can help?

thanks.
Reply
  #6  
Old July 8th, 2008, 09:49 AM
DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 922
Default

Moved to the Software Development Forum - you might get a bit more general exposure here.
Reply
  #7  
Old July 8th, 2008, 12:02 PM
Nepomuk's Avatar
Moderator
 
Join Date: Aug 2007
Location: Germany
Age: 21
Posts: 1,817
Default

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
Reply
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles