2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
layout: pattern
|
|
|
|
title: Property
|
|
|
|
folder: property
|
2015-08-15 18:03:05 +02:00
|
|
|
permalink: /patterns/property/
|
2015-08-20 21:40:07 +02:00
|
|
|
categories: Creational
|
2021-05-19 10:49:05 -06:00
|
|
|
language: en
|
2015-12-28 15:52:44 +02:00
|
|
|
tags:
|
2019-12-13 21:09:28 +02:00
|
|
|
- Instantiation
|
2015-08-13 23:54:40 +02:00
|
|
|
---
|
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Intent
|
|
|
|
Create hierarchy of objects and new objects using already existing
|
2015-08-13 23:54:40 +02:00
|
|
|
objects as parents.
|
|
|
|
|
2019-12-07 20:01:13 +02:00
|
|
|
## Class diagram
|
2015-08-13 23:54:40 +02:00
|
|
|

|
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Applicability
|
|
|
|
Use the Property pattern when
|
2015-08-13 23:54:40 +02:00
|
|
|
|
2019-12-13 21:09:28 +02:00
|
|
|
* When you like to have objects with dynamic set of fields and prototype inheritance
|
2015-08-13 23:54:40 +02:00
|
|
|
|
2016-01-03 21:14:30 +01:00
|
|
|
## Real world examples
|
2015-08-13 23:54:40 +02:00
|
|
|
|
2015-08-15 18:03:05 +02:00
|
|
|
* [JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Inheritance_and_the_prototype_chain) prototype inheritance
|