Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9232155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:14:48+00:00 2026-06-18T06:14:48+00:00

I’m reading this article: http://www.codeproject.com/Articles/479635/UnderstandingplusandplusImplementingplusDecoratorp I’m thinking of implementing this pattern in a school

  • 0

I’m reading this article:

http://www.codeproject.com/Articles/479635/UnderstandingplusandplusImplementingplusDecoratorp

I’m thinking of implementing this pattern in a school project. It’s not a requirement so I can half-ass it. But, I just thought it would be a good opportunity to expand my knowledge and expertise.

The school project is this: Create a pizza ordering application where employees enter the orders of customers. So a pizza, and it can have any number of toppings.

The above article (and the description from the Head First: Design Patterns book) seem to match my application perfectly.

Here is my issue: This doesn’t seem like a good pattern, and here is why:

Whenever “pizza place” adds a new topping to their menu…. they will have to add a whole new class, and recompile their ordering systems and re-distribute them?

I think perhaps the issue is that all of the examples I google have to deal with food and toppings of some sort.

  1. Am I just finding the wrong types of examples for this pattern?
  2. What are some better examples where this pattern would be implemented?
  3. Is the food industry one of them and it is just the implementations
    that are screwy?
  4. Is this one of those patterns that is out there but is hardly ever used in actual production code?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T06:14:50+00:00Added an answer on June 18, 2026 at 6:14 am

    Actually Decorator allows you to add some behavior without recompiling source code. You can declare IPizza interface in your pizza domain, and use this abstraction in your application. Then you can add another assembly, which will have other implementations if IPizza decorators, and inject those implementations to your application with dependency injection. Thus you will not need to recompile neither your application, nor domain.

    BTW Adding new class is better, than modifying existing classes. You always can break something what was working before your modifications. That’s why Single Responsibility Principle was introduced.

    Another your questions:

    1. No, you are finding good examples of Decorator pattern usage (especially one in Head First book). Also take a look on IO Stream class and it’s decorators for inspiration.
    2. Pattern just should solve problem. If you don’t have problem, which pattern is targeting, than it’s just wrong usage of pattern.
    3. Patterns do not stick to industry. They stick to problems of your code (often its about duplication of code)
    4. No, it’s good pattern. Think again about Streams in .Net. Is it production code?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not entirely sure how I managed to jack this up. http://pretty-senshi.com If you
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.