1
0
mirror of https://github.com/DesignPatternsPHP/DesignPatternsPHP.git synced 2025-06-11 16:30:51 +02:00
Files
Behavioral
Creational
More
Structural
Adapter
Bridge
Composite
Tests
uml
Form.php
FormElement.php
InputElement.php
README.md
TextElement.php
DataMapper
Decorator
DependencyInjection
Facade
FluentInterface
Proxy
Registry
README.md
.gitignore
.travis.yml
LICENSE
README.md
composer.json
composer.lock
composer.phar
phpunit.xml.dist
DesignPatternsPHP/Structural/Composite

Composite

Purpose

To treat a group of objects the same way as a single instance of the object.

Examples

  • a form class instance handles all its form elements like a single instance of the form, when render() is called, it subsequently runs through all its child elements and calls render() on them
  • Zend_Config: a tree of configuration options, each one is a Zend_Config object itself

UML Diagram

Alt Composite UML Diagram