G
Guest
I am quite new to design patterns and would like advice and help on the following problem I am having
I am writing a program to send emails to customers for a company. There are different types of emails that have common elements such as order and payment details. Other elements are different such as the first paragraph. EG “Thank you for your recent order of the followingâ€, “Thank you for your recent return of the followingâ€, “Thank you for your recent return reorder of the followingâ€. The email may be sent in HTML format or text format with future formats being a possibility. My problem is that if use one class to build a whole text letter, then the logic for determining email content would have to be copied to the class to create html letters as well which is not a good idea as changes in one would require changes in the other. Html letters have different formatting to take advantage features of HTML however the textual content is the same. The import to the text builder is a orders class which contains all necessary details of the order required for the letter. In future I would also be providing printed copies of the letters with barcoding so that is another future format.
If someone has any ideas on a class hierarchy I would be eternally gratefu
Regard
Danie
I am writing a program to send emails to customers for a company. There are different types of emails that have common elements such as order and payment details. Other elements are different such as the first paragraph. EG “Thank you for your recent order of the followingâ€, “Thank you for your recent return of the followingâ€, “Thank you for your recent return reorder of the followingâ€. The email may be sent in HTML format or text format with future formats being a possibility. My problem is that if use one class to build a whole text letter, then the logic for determining email content would have to be copied to the class to create html letters as well which is not a good idea as changes in one would require changes in the other. Html letters have different formatting to take advantage features of HTML however the textual content is the same. The import to the text builder is a orders class which contains all necessary details of the order required for the letter. In future I would also be providing printed copies of the letters with barcoding so that is another future format.
If someone has any ideas on a class hierarchy I would be eternally gratefu
Regard
Danie