Version française
Home     About     Download     Resources     Contact us    
Browse thread
The Bridge Pattern in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Oliver Bandel <oliver@f...>
Subject: Re: [Caml-list] The Bridge Pattern in OCaml
Zitat von Jim Farrand <jim.farrand@gmail.com>:

> On 28/03/2008, Oliver Bandel <oliver@first.in-berlin.de> wrote:
> >  It seems that you already know, what things you
> >  want to write to the files
>
> No.
>
> The opposite in fact.  I want to be able to serialize things I (the
> framework designer) never even thought of.  I want the users of my
> framework to have maximum flexibility to implement whatever behaviour
> they like, without restricted them to the things I thought of putting
> into the file format.
[...]

OK, so I misunderstood your needs.
sorry, I didn't read the thread completely and just jumped in.

>
> O'Caml marshalling is in the right direction (take any closure and
> serialize it, this is very flexible in this respect), but it is far
> to
> restricted in other ways to be of use (file format tied to particular
> executable).


OK. Marhsal-module is nice, but there are disadvantages:
if the marshalled data is loaded but was corrupted, this
can crash your program!
So I would never recommend to use it.
It also possibly could be a security hole, when using that module.
Another reason why I would never recommend it's usage.

Beter write your own implementation of the serialization
on top of OCaml, without of Marhsalling-module (which
is too deep inside the internals of Ocaml, and therefore make things
possibly unreliable!).


Ciao,
   Oliver