DEV Community

Discussion on: Design Patterns: Decorator Pattern

Collapse
 
julipatrush profile image
Juli Patrush

Hey, Henri! Nice article, good explained ;)
I've got a question on Java: you defined in the Taco interface a method cost as abstract. Why? why not leave the method without "abstract"?

PS: Gonna check your blog on having more similar articles ;)

Collapse
 
henriavo profile image
Henri Idrovo

Hi Juli. Good question. The terms 'public' and 'abstract' in the Taco interface are redundant. They were left over from the textbook example that used an abstract class. Thanks for pointing that out! Hope you find my posts useful :-)