samedi 28 janvier 2017

Interface and implementation design structure?

I'm quite new to designing large programs in C++. I'm writing series of operations, each of which have their own class, which will be invoked by the ProcessMgr class.

I'm using ProcessMgr as an interface class, from which each operation can be invoked:

class ProcessMgr
{
 private:
   class OperationOne;
   class OperationTwo;
   class OperationThree;
}

class ProcessMgr::OperationOne 
{
 private:
   ...
};
class ProcessMgr::OperationTwo
{
 private:
  ...
};
class ProcessMgr::OperationThree
{
 private:
  ...
};

This enables me to control the types of access to the Operation classes, therefore not exposing much of their underlying code.

My questions:

1) Is this a good approach to designing large programs? Are most libraries, such as CURL, structured in this way?

2) Are there better/more efficient methods of separating interface and implementation?

Aucun commentaire:

Enregistrer un commentaire