File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Decorator Pattern

 
Maan Suraj
Ranch Hand
Posts: 299
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was going through decorator pattern from Head First. On one of the pages,it says that

" When i inherit behaviour by subclassing,that behaviour is set statically at compile time"


I am not getting what does "statically at compile time means in this context".



 
ramesh maredu
Ranch Hand
Posts: 210
Eclipse IDE Java Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I read it long back,if I am correct, the book is comparing between inheritance and composition.

When you extend a class and make a subclass then you get the behavior of super class and the behavior is static (you can not change the behavior at runtime). But if you compose then the behavior you get with composed reference could be dynamic.







 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic