Is the decorator pattern really needed here?

Is the decorator pattern really needed here?

I am learning the decorator design pattern from the Head first design patterns book. Their example treats different types of coffees as a Beverage. The beverages are decorated with things like milk, soy, whip cream etc. For example, the DarkRoast coffee with mocha and whip cream :&nbsp;<a href="https://i.stack.imgur.com/AaQQY.png" target="_blank"><img src="https://i.stack.imgur.com/AaQQY.png"></a>

I am learning the decorator design pattern from the Head first design patterns book. Their example treats different types of coffees as a Beverage. The beverages are decorated with things like milk, soy, whip cream etc. For example, the DarkRoast coffee with mocha and whip cream : 

The class diagram : 

I understand that this example is used only because it is simple. But, I have an alternate and simpler way to implement this example without decorator pattern. We can have an Item class with description and cost. Then, the Beverage class can have baseCost, totalCost and list of Items.

Does this alternative design have any major disadvantages over the decorator pattern ? Can you give any specific scenarios where the decorator pattern would be better than my design ?

PS - In case anyone wants to see the decorator code : https://github.com/bethrobson/Head-First-Design-Patterns/tree/master/src/headfirst/designpatterns/decorator/starbuzz

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Java Design Patterns for Beginners - Design Patterns in Java

"Java Design Patterns for Beginners - Design Patterns in Java - Design Patterns Tutorial" will provide you with detailed knowledge about Java Design Patterns and along with it. Why do we need Design Patterns? Structure of Design Patterns. Types of Design Patterns. Creational Design Patterns. Factory Design Pattern. Overview of Design Patterns

Design Patterns for Beginners with real-world Examples

Design Patterns for Beginners with real-world Examples. When do you use Design Patterns? How do you implement different Design Patterns in Java? What are Design Patterns? Why do you use Design Patterns? What are the different types of Design Patterns? When do you use Design Patterns? What are the real-world examples for Design Patterns.

Design Patterns For Beginners — with Java Examples

In this guide, we give you an introduction to the world of design patterns. For each pattern, we understand: the pattern, the context in which it is applicable  —  with a real world example.