On 8/12/2016 7:07 PM, Craig Farrow wrote:
> FlexTools was originally written for Fieldworks 6, which was before
> the switch to XML storage. Going through Flex code for the database
> access meant minimal changes to FlexTools to handle the database
> format change. Also, the Flex code handles certain data integrity
> constraints, etc. Working directly with the xml creates a much larger
> task in keeping in sync with model changes, etc. I think integrating
> the FlexTools functionality *into* Fieldworks would be the better path.
There is no guarantee that Flex 7 & 8 users are using the xml storage
system at all, since the other supported option is an object database.
Most of the Flex 7, 8, & 9 code has no idea how the data is stored, or
even *if* it is stored. Flex 7 was set up that way to make it easier to
change persistence systems on fairly short notice, if a better one came
along. (I tested 6-8 different cross-platform persistence systems,
before LSDev committed to switch to what became Flex 7.)
As such, it is a bad overall architectural design for programs to make
any assumptions about how Flex data is stored. Doing so would bind that
program to both the storage structure *and* to the Flex model. (The
FlexTools approach is only tied to the actual model.) I don't think Flex
believes its storage xml is any kind of a formal standard that anyone
can use. Flex can import and export select data in those kinds of
standards, of course, but its own system is not such a standard at the
moment.
In the early days, it was simply not possible to create a DTD for the
Flex data model, given how it defined its model and the rules of DTDs.
(Object and/or property names were 'overloaded', which means they had
different meanings in different contexts.) Whether a clever person could
create a Schema today out of the model is an interesting question, but I
suspect it would be quite ugly for a human to try and read it, when it
came time to make changes in an external program.
I guess Flex has never had a felt need to validate its persisted data,
since it handles that consistency business in its own code, before it is
persisted. Flex 7 has tests that ensure that the data that is serialized
and then de-serialized are the same, but it isn't an xml schema validator.
Randy Regnier