07.03.2014 14:15, Alex Peshkoff wrote:
> n 03/07/14 16:45, Dimitry Sibiryakov wrote:
>> >     After prepare we get from server a metadata-only object. There is no 
>> > need in offsets in
>> >this object. Offsets are not a part of metadata at all, IMHO, and their 
>> >presence in
>> >IMessageMetadata is an architectural mistake.
> You suggest to add a special roundtrip to get them?
> I get_all_  metadata at once, and I do not understand why you call it
> "architectural mistake".

   You get not "all metadata". You get... errrr... "true metadata" and offsets 
are not 
among them. Offsets are calculated later and whole code is based on hope that 
two 
different pieces of code will calculate them in the same way. I.e. offsets are 
encapsulated into metadata and there is no way to keep them consistent with 
real data. As 
the result, all Firebird developers have to be aware that different pieces of 
code placed 
in different classes (and modules) are not independent and changing one of it 
without 
appropriate changes in the counterpart will crash everything.
   This is what I call "architectural mistake".

   As the example: common/calsses/InternalMessageBuffer produces message 
metadata from BLR 
using MetadataFromBlr(). After that remote/client/BlrFromMessage produces 
_different_ BLR 
from input message metadata, but the rest of interface code works with 
assumption, that 
new BLR is compatible with old buffer, created for old BLR. BlrFromMessage just 
don't use 
offsets from input metadata.
   If method MsgMetadata::makeOffsets is changed to group all null indicators 
in the 
beginning of buffer (to save some space on alignments), whole remote module 
will fail 
miserable.

   You know, that encapsulation is one of basic things about OOP, right?..

-- 
   WBR, SD.

------------------------------------------------------------------------------
Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce.
With Perforce, you get hassle-free workflows. Merge that actually works. 
Faster operations. Version large binaries.  Built-in WAN optimization and the
freedom to use Git, Perforce or both. Make the move to Perforce.
http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to