473,387 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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

Similar topics

9
by: Patchwork | last post by:
Hi Everyone, I have a design related question (in C++) that I am hoping someone can help me with. It is related to my previous post but since it was pointed out that I was more or less asking...
2
by: Chris F Clark | last post by:
1) I would really like to ask this on comp.lang.c#, but no such group exists. However, perhaps someone in one of the above two groups will know the answer and help me out. In my product, I use a...
4
by: emma middlebrook | last post by:
Hi Straight to the point - I don't understand why System.Array derives from IList (given the methods/properties actually on IList). When designing an interface you specify a contract. Deriving...
17
by: tshad | last post by:
Many (if not most) have said that code-behind is best if working in teams - which does seem logical. How do you deal with the flow of the work? I have someone who is good at designing, but...
4
by: FluffyCat | last post by:
New on November 29, 2005 for www.FluffyCat.com PHP 5 Design Pattern Examples - the Command Pattern. Since you all enjoyed the Visitor Pattern so much yesterday, today I have the Command Pattern...
6
by: Daniel Santa Cruz | last post by:
Hello all, I've been trying to go over my OO Patterns book, and I decided to try to implement them in Python this time around. I figured this would help me learn the language better. Well,...
34
by: Nate | last post by:
Scenario: In a commerce application, there is a Product class. Along with the Product class there is a form (the text that goes in the labels of the input controls) for inputting and updating...
6
by: Orgun | last post by:
Hi, I sent this message to the moderated c++ group too but it is waiting for moderator approval and I wanted to send here too. I am new to Design Patterns. I want to write a simple...
0
weaknessforcats
by: weaknessforcats | last post by:
Design Patterns: Visitor Introduction Polymorphism requires a class hierarchy where the interface to the hierarchy is in the base class. Virtual functions allow derived classes to override base...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.