Skip to content

Latest commit

 

History

History

Decorator

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Purpose

To dynamically add new functionality to class instances.

Examples

  • Web Service Layer: Decorators JSON and XML for a REST service (in this case, only one of these should be allowed of course)

UML Diagram

Alt Decorator UML Diagram

Code

You can also find this code on GitHub

Booking.php

Booking.php

BookingDecorator.php

BookingDecorator.php

DoubleRoomBooking.php

DoubleRoomBooking.php

ExtraBed.php

ExtraBed.php

WiFi.php

WiFi.php

Test

Tests/DecoratorTest.php

Tests/DecoratorTest.php