On 9/8/07, Romain Beauxis <[EMAIL PROTECTED]> wrote: > I actualy don't think it would be clean to separate it, or at least it would > require some attention at build: harbor server code has know the type of the > input class, so in case of two different files, the sources/harbor_input.ml > would have to be compiled before tools/harbor.ml... > Or we could think of a more complicated paradigm, but I don't think we need > extra complexity here... :)
I don't have any strong opinion about splitting, but let's tame your remark. You are the one making things more complicated than they are, because your mind is infected by the over-rigid nominal subtyping used in most OO languages ;) Nominal OO means that the type of an object is given by the name of its class -- the subtyping is the subclassing, allowed if one class (name) is explicitely declared to be derived from another class (name). Instead, OCaml has structural subtyping for objects. The type of an object is just a description of what you can do with it. A type is an instance of another one if it allows more behaviours. The inheritance and the subtyping are no more tied. As a consequence, the server code doesn't need to know the source's class. It just needs to know that somewhere are stored objects which have a method #set_socket. That doesn't create a complicated architecture as your describe. Yeah, I know, OCaml is great ;) -- David
