I'm referring to the pattern (aka Universal Design Pattern) as discussed in this blog post

Universal Design pattern

I guess I'm not entirely clear how to use this in practice. And how it works to accomplish operations or tasks.

In particular regarding this explanation

It's the core API for any collection that maps names to values:

put(name, value)

There are typically also ways to iterate over the properties, optionally with a filter of some sort.

Are the keys the name? And what are the values?

And how do you perform operations? Where are instructions for performing tasks and operations on data stored? and how are they called? Are the embedded into the 'values' as classes?

  • It seems that the "Universal Design Pattern" may refer to different subject than the "Properties Pattern"
    – umlcat
    Commented Jan 19, 2015 at 17:28
  • @umlcat No I think the author of that blog is referring to them both to mean the same type of pattern. He just calls it universal because it appears everywhere.
    – erotavlas
    Commented Jan 19, 2015 at 17:37
  • 1
    Note that this is technically an anti-pattern - it's an implementation of dynamic typing, and even the author of the blog post agrees that avoiding it is a good idea. By making every aspect of the object mutable, you have no guarantees about what states it can be in.
    – Doval
    Commented Jan 20, 2015 at 3:46

1 Answer 1


Yes, the Keys are the name or identifier of each property.

You may add a changeValue method.

This pattern is also known a the Dynamic Object Design Pattern.

Example (Pseudocode):

void Example()
  KeyValueList MyControl = new KeyValueList();
    MyControl->put("id", "MyControl");
    MyControl->put("x", 34);
    MyControl->put("y", 125);
    MyControl->put("height", 200);
    MyControl->put("width", 250);
    MyControl->put("filled", false);

} // void Example()

As you may check in the previous example, is common to use a list that store key value items, where there the keys are of string types, and cannot be duplicated. The values may be stored as an type specific for each value, like integer or logical.

Or can be used as string, similar to H.T.M.L. or X.M.L. attributes, like this example:

Example (Pseudocode):

void Example()
  KeyValueList MyControl = new KeyValueList();
    MyControl->put("id", "MyControl");
    MyControl->put("x", "34");
    MyControl->put("y", "125");
    MyControl->put("height", "200");
    MyControl->put("width", "250");
    MyControl->put("filled", "false");

} // void Example()

Both, cases are optional.

The example is generic, identifiers and types, can change from library or programming language.

This Design Pattern is commonly used in programming languages that are not Object Oriented, (like "functional" or "procedural"), to emulate objects.

Is also used in Programming Languages that are already Object Oriented, but, the properties are statically designed, and cannot be added or removed at execution.


  • Why can't properties be added or removed at execution when using an Object oriented language?
    – erotavlas
    Commented Jan 19, 2015 at 19:14
  • @erotavlas Some Progr. Langs. are just designed with predefined properties, the programmer can change their value
    – umlcat
    Commented Jan 19, 2015 at 23:01
  • 2
    BTW thanks a lot for mentioning the alternative name for this pattern (dynamic object pattern)- that alone helped me find some great resources online (along with alternative terms such as dynamic object model and adaptive object model). I was having a hard time finding any information using the other name (properties pattern) in my searches.
    – erotavlas
    Commented Jan 20, 2015 at 1:34
  • That's a useful explanation, of the Properties Pattern as a way to emulate (or add to) objects. But it doesn't really account for why his article is so enthusiastic about the Pattern. Especially since his biggest example is the game he wrote (Wyvern), that used Python - which has Objects, Properties, and other things.
    – Cyclops
    Commented Sep 12, 2021 at 15:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.