-
Notifications
You must be signed in to change notification settings - Fork 308
Ruby DSL model format change
In the previous release of OmniDataObjects, the model format was XML-based. We’ve switched away from this since it introduced too many dependencies on developers of iPhone apps and it slowed startup time. The model in ODO apps is considered immutable (unlike CoreData were you can modify it in code before starting to use it for the first time), so the work of parsing and constructing the model from XML is wasted time (cheap on the Mac, expensive on the iPhone).
For now we have a Ruby DSL that generates ObjC source to build the model at runtime as quickly as possible. An example of how to use this can be seen in the unit tests. For convenience, the ‘odogen’ script will either emit the model sources or can check them and fail if they differ. So, you can either check in the generated output, adding it to Xcode as normal, or take an approach were you try to convince Xcode to build the derived sources reasonably.
To aid the people that had tried the XML model format, there is a XSL file to convert from the XML model to the Ruby DSL in Tools/xodo2odomodel.xsl (with a usage comment at the top of the file).