Kim Lindhard
Making the implicit explicit

property vs attribute

As a software developer it is easy to confuse the concepts of properties and attributes, they have been used interchangeably in many programming languages to describe a value of an object. But they have very different meanings and are worth us getting right when we talk about entities, especially in the world of domain driven design.

Property

A property is a quality of an object without any attributions. It is fact you can not dispute nor alter the meaning of.

Attribute

A quality we attribute to someone or something. You may have different perspectives than other people and argue about a attribute.

Examples

Properties of a pillow can be the dimensions: 20x20x10 cm and a weight of 1 kg. We can attribute it to be soft, or small.

A property of a pan on a stove could be that it is 40 degrees celsius. A attribute of the same pan could be that it is luke warm.

The car is driving 110 km pr hour is a property. The car is speeding is an attribute.

The height of a person is a property, for instance: 175 centimeters.
Some places in the world we would attribute the person to be tall while other places in the world we would attribute the same person as average height.