ThingWorx Model Definition in Composer > Modeling > Thing Templates > Similarities to Object-Oriented Programming
Similarities to Object-Oriented Programming
ThingWorx Model objects are often compared to some basic object-oriented programming principles. The terms "extend" and "implement" may be used to describe the model.
You can think of a Thing Shape like an interface. A Thing Shape is best used in object-oriented design as a preferred technique, known as Composition. Composition is the functionality that is reused throughout your design. When you implement a Thing Shape in ThingWorx, you inherit its properties and services.
Composition can be described as a "has a" characteristic. For example, an Acme Tractor "has a" mower deck and "has a" motor.
You can think of a Thing Template as a class. In object-oriented design, a class can extend a base class. It is also referred to as inheritance, which means you can redefine or extend the established behavior of a base class. When you extend a Thing Template in ThingWorx, you inherit its properties and services.
Inheritance can be described as an "is a" characteristic.
For example, Economy Series Model 10 tractor:
"is a" Economy Series tractor.
"is a" Home and Garden tractor.
"is a" Acme tractor.
Was this helpful?