mercredi 31 août 2016

How to organize the data analysis classes from the perspective of class design?

I give the following example to illustrate my question:

class DataGenerator
{
  public:
         Data data;
         void generator_data();
         Auxiliary info;
};

This class will initialize and generate data after calling generator_data function.In the meantime, some auxiliary information associated with the data is also generated.

class DataAnalyzer
{
  public:
       DataAnalyzer(DataGenerator &dataGenerator):data(dataGenerator)
       {

        }
       line& get_the_longest_line_in_data();

       DataGenerator &data;
}

This class will perform some analysis on the data, and generate some information after anlyzing the data. For example, line& get_the_longest_line_in_data()

class KnowledgeGenerator
{
  public:
     void generate_knowledge()
     {
            DataGenerator abc;
            abc.generator_data();

            DataAnalyzer def(abc);
            def.get_the_longest_line_in_data();

            organize_lines();

            generate_conclusion();
          }

}

This class will invoke DataGenerator and DataAnalyzer class and perform a higher level analysis, and in the end we will get some more concrete stuff. For example, it may be a decision whether the stock should be sold or not.

Aucun commentaire:

Enregistrer un commentaire