Please consider to contribute discovered incompatibility issues to this
module, to hide them where possible.
=head3 Tag abbreviations
XML is very verbose anyway, so it really does not help to abbreviate tags
leaving some vowels out. This makes it harder to readmessages and code.
It increases the chance on stupid typos in the code.
When you set L<new(long_tagnames)|Business::CAMT/"Constructors">, then your Perl structure will use
longer, understandable names: it gets easy to understand the message
without reading the documentation. This improves maintenance on the
long run.
This option will be applied both on L<read()|Business::CAMT/"Read and Write messages"> and L<write()|Business::CAMT/"Read and Write messages">. Of course,
the templates will show you how it works: see the C<templates-long/>
directory in the github repository.
=head3 No common types
Each schema is separate, although their type definitions are overlapping.
It is not guaranteed that equal types will stay that way over time.
This may cause instable code.
Probably, these issues will not emerge because the schema files are
generated from a central UML model. However: small changes in the data
structure will cause multiple schemas to change to a new version.
A better setup would be:
=over 4
=item * a schema forbase types, like "Amount"
=item * a schema formore complex (reused) structures
=item * a schema per message, which composes the complex structures
=back
=head3 Missed chances on XML
The way these schema's got generated, make them very low in using more
powerful XML schema features. Those features would have helped the
stability of the "interface"which these messages implement a lot.
Done this way, XML is not much better than JSON. To be honest, the
schemas are littered by missed chances.
The messages are designed withan UML tool, which means: limited to the
features of that tool and hindering the view on the quality of the schema.
This leads to structures like:
<Bal>
<Tp>
<CdOrPrtry>
<Cd>OPBD</Cd>
</CdOrPrtry>
</Tp>
<Amt Ccy="SEK">500000</Amt>
<CdtDbtInd>CRDT</CdtDbtInd>
<Dt>
<Dt>2010-10-15</Dt>
</Dt>
</Bal>
In Perl, this leads to (C<long_tagnames> on)
Balance=> {
Type=> {
CodeOrProperty=> {
Code=> 'OPBD',
}
},
Amount=> {
_=> '500000',
Currency=> 'SEK',
},
CreditDebitInd=> 'CRDT',
Date=> {
Date=> '2010-10-15',
},
}
The XML schema, whenB<designed> as XML schema, could have looked like
<OpeningBook Date="2010-10-15CEST">
<Credit Currency="SEK">500000.00</Credit>
</OpeningBook>
The useof C<group>'ed elements and C<substitutionGroup>'s would have
made messages so much clearer and easier. Even simple constructs
as C<extension> and C<restriction> of C<complexType>'s are not used.
It would have reduced the message size much further than by leaving
out the vowels from tags, as the example shows.
But more importantly: this hinders backward compatibility in the message
evaluation a lot! Using XML features better would result in better
maintainable applications. Much better.
=head1 SEE ALSO
This module is part of Business-CAMT distribution version 0.13,