Class PerspectiveDocument

  • All Implemented Interfaces:
    Discoverable

    public class PerspectiveDocument
    extends Object
    implements Discoverable

    Instances of this class represent XML/JSON like files. XSD Schema functionality can be created via special classes, that wrap perspectives.

    XML is used for simple documents, because it provides things in order support needed functionality: it supports namespaces, XSL, XSD and XPATH. The only downside is, that defining schemas with XSD and validating files with these schemas is complicated, costly and 2 languages (Java and XML) need to be supported for things like automatic refactoring. Especially the integration of XSD files into editors is not as easy as one might think. The best way to solve this, is to automatically apply schema validation any time that XML files are processed.

    When these downside are too big, PerspectiveDocument is used instead. Also keep in mind, that some XML files or just some content may always be XML files, because there may be no alternative format definition.

    Currently PerspectiveDocument and Perspective usage are based on XML, because XML is the base of all syntax tree currently. In other words PerspectiveDocument and Perspective are compatible to XML, because it can be rendered as XML, but the other way around is not the case. This class will probably be a replacement for XML, if XML does cause to much problems or costs to much development resources. If and when this is the case, a slow migration process will take place, where XML will be made compatible to PerspectiveDocument and Perspective, by providing an conversion function from XML to PerspectiveDocument and Perspective. Compatibility between these system will not be removed after that, because this can be used as bridge with extern file formats.

    Extending classes should always provide an empty constructor, because this is just data and not something like a template.