I recently started working in domain of mesh generation . My programs usually contains large chunks of procedural code consisting of several phases. Eg.
class MeshAlgo1
{
/* A very long function */
void DoSomething(MeshData data)
{
// Phase 1
...
// Phase 2
...
// Phase N
}
};
I would like to break down these long member functions into smaller functions for better readability and maintainability.
class MeshAlgo1
{
/* Shorter function! :-) */
void DoSomething(MeshData data)
{
DoSomething1();
//...
DoSomething2();
//...
DoSomethingN();
}
};
But since this code is procedural, DoSomething1(), DoSomething2(),etc would not be independent of each other, and so do not fit into OOP style. That is, DoSomething2() assumes that DoSomething1() has been called before it. I would like to know what is the correct way of writing such code in Object Oriented style. Thanks a lot.