java - Is it a decorator pattern? -
I have read this post, but I want an expert's opinion on the job for an example of this post:
< P>
Can we decorate classes with members of the figures?
Whenever you implement an interface and integrate If you do, using the collected object to provide part of the functionality implemented, you will have a decorator pattern.
Note : This definition is exactly what you can find in the Gough Book: Design Pattern: Reusable Object-Oriented Soft The element of the wires and the link you post on is found on it.
Subclasses from your
employee decontroller
which you are addingemployee
being the "intermediate" class (employee decorator
) is a way of covering the delegation in a parent category, such asTeamMember
andTeamLead
do not copy the delegation code.
Comments
Post a Comment