Table of Contents

Data model

The ZeroInstall.Model namespace contains the data model for the Zero Install feed format with the Feed class as the entry point.

The ZeroInstall.Model.Capabilities namespace contains the data model for capabilities extension for the feed format.

Serialization

These classes are serialized to and from XML using .NET's XmlSerializer. The serialization code is generated at compile-time for better performance.

Normalization

After deserialization from XML a feed is in a non-normalized form. Before it can be used by Zero Install's other Services it needs to be normalized, by calling the .Normalize() method. This will:

  • Propagate values from <group>s to <implementation>s
  • Extract <manifest-digest>s from <implementation id='...'>
  • Convert <implementation main='...'> to <command>s
  • etc.

However, if you intend to edit a feed and save it as XML again, you should not call the .Normalize() method, in order to preserve the feed's structure.

Nullability

Required fields in the data model are marked as non-nullable. However, in a Feed instance deserialized from XML these fields may be null anyway. Calling .Normalize() throws an InvalidDataException if any required/non-nullable fields are unset. Therefore, only a normalized Feed should be treated as "null-safe".