So I'm writing a network simulator in C++ as part of a university project. Right now, I have a class structure that looks something like:
//includes type aliases
#include "GlobalTypes.h"
//main body of simulator, contains various static members and methods that define behavior of simulator
class mySimulator : public myErrorHandler {static member1...static method1()...};
//these are things like a file IO handler, simulator environment initialization, etc
class largeSimulatorSubcomponent1 : private Simulator {static member1...static method1()...};
class largeSimulatorSubcomponent2 : private Simulator {static member1...static method1()...};
class largeSimulatorSubcomponent3 : private Simulator {static member1...static method1()...};
//various non-static object classes that are manipulated
//by the simulator and each other to perform the simulation
class cellTower{member1...method1()...};
class cellPhone{member1...method1()...};
class dataContainer1{member1...method1()...};
class dataContainer2{member1...method1()...};
class etc{member1...method1()...};
In a general sense, the mySimulator and largeSimulatorSubComponent classes form the "universe" and control the external behavior of the various objects that are created in order to perform the simulation.
For my point of view, my structure makes sense because the "Simulator" is not ever created more than once, so it doesn't seem necessary to allow it to be a non static class that can be traditionally instantiated. However, I've come to understand that static classes are typically frowned upon with many suggesting that using namespaces is better. At first, this is what I was doing, but I made the switch to classes with static members and methods because that allowed me control over what parts of the simulator were allowed to access the other parts.
I fully expect that this project will be taken over by students in the future, and I am trying to make the structure as clear and safe for them to use as possible, and I know that a lot of them will not be experts in C++ and may inadvertently cause bugs or implement behavior in a logically inconsistent ways. I am trying to protect them from that by carefully restricting access between parts of the program with clear logical encapsulation, const correctness, error handling, etc. I believe that my current structure allows that, but I'm interested to hear any suggestions or comments on my logic/structure.
Also, on a point of lesser importance, what is your opinion on using global aliases in this manner?
using typename1 = float; //typename 1 & 2 serve to "label" floats
using typename2 = float; //that are used to represent a certain category of
//values that important to the simulator;