Topic: To divide private and the general or not
There is at me one which works, but it is required to make the considerable changes there. And for the present there is time for silly questions. The essence is that. There is a server which stores the space data and when the user outlines the frame objects on a card and sends armies..., it is necessary to export, the layers which have got to selection and objects, in other format - DXF or MID/MIF or still what which is required tomorrow. All "algorithm" consists of several parts: 1. We open a source. It always same. 2. We adjust the driver . Here there can be nuances, depending on a format. 3. We create . Here too there can be nuances. 4. We start to remove in a cycle from a source layers and in each layer objects. Here all is identical. 5. What to copy the data it would be necessary to make a copy of layers in . I.e. to create a layer same as in a source, and the layer structure should be same or not so. And here already there are nuances. In DXF concepts of a layer are not present, and it is not necessary to create attributes of a layer, all the automatic machine the driver becomes. Type division into layers already goes in applications across the field layer. That there , into such layers also breaks. And here in MID/MIF it is already possible to do all humanly. 1 layer from a source = 1 layer in . And attributes of a layer should be created hands, at least copying structure of a layer of a source. 6. There is an object copying further. The geometry is simply copied, and attributes again depending on a format. DXF - we fill a field layer with attribute layerName from a source. In MID/MIF it is necessary to copy at least all attributes from a source. 7. Still there can be any operations after export. Somehow to be processed result files. MID/MIF consists of two files, means it is necessary to envelop in zip. Well and depending on the coding file handling can be demanded. A question in, whether it is necessary to rest and how it is possible to divide more strongly, a pier here the code the general for everything, and here the code of already specific format? It is a lot of points where it is necessary to consider singularities of this or that format. My first variant was with base class, and in the successor functions CreateLayerDefn, CopyAttr etc. which in the designer of the successor are defined, initialize base class variables. And the base class when it is necessary simply caused them in the fullness of time. But looked at all it and I think, can not and all code to copy in each class for this or that format?