11.03.2014 13:48, Alex Peshkoff wrote: > On 03/11/14 15:58, Dimitry Sibiryakov wrote: >> Fix every user application using API to create data buffers in exact >> format? It is not >> good because a) won't let change this format ever and b) too cruel. > > I understand your worries. Will try to explain why they are they wrong > in this case.
I know why FB works now. But let's think about the future when (if) new API become widely used. > What may be discussed is should we document exact order of fields in the > message or probably let user create arbitrary one. If we decide to use 2 > approach - them offsets really should travel over the wire. No, please. Read again: documenting of data buffer format will engrave it in stone, you won't be able to change it even if you want. IMHO, right way is to hide field order behind interface. > This is the simplest solution, but requires a lot of virtual calls per > every row. Therefore we decided not to use it. Not virtual calls is a bottleneck. Memory copying and data scattering are much more unpleasant. >> To accomplish that, every module should work with objects (interfaces) >> coming from >> outside without attempts to guess their implementation and using only their >> API. > > And where do we guess? We use some documented suggestions. You use undocumented requirement to follow fb_utils::sqlTypeToDsc() behavior which is not optimal but compatible with old versions. It puts too tight restrictions on plugins and components authors. > Well, I agree - it's OK to add a check for offsets returned by > IMessageMetadata when converting it to BLR. Arghhh... Check not. Use them. I don't know REMOTE internals, but shouldn't integer data to be converted to network byte order before sending to a wire? If yes, it anyway must be done in field-by-field basic, and there is no reason for fixed-format continuous buffer on entrance. -- WBR, SD. ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel