-
Notifications
You must be signed in to change notification settings - Fork 22
Complexes
A complex is a type that contains a set of members and a constructor. It is usually a .NET class but it extends to any other structure that can represent a set of member->value pairs (i.e.: members, properties), such as:
- Anonymous classes, are handled just as regular ones.
-
Dictionary<string, object>
, each key-pair value represents a member, -
JsonObject
where each value node represents a member. - Any other custom type that can hold a set of member _name _-> value pairs.
Complexes can be seen as an abstraction of a regular object, and they can be extended to handle custom types.
Members are variables associated with the complex type. They can be represented by propertes for .NET classes, key-value pairs for Dictionary<string, object>
) or any other slot that can contain named values for custom types.
A member should have a name and a getter and setter that changes depending on the handled type. Property getters and setters for .NET classes, indexer[] for Dictionary<string, object>
or any other accessor for custom types.
Members can be renamed, ignored, removed and custom code may be added to getters and setters, also they can hold annotations.