I have been playing with the existing code I have and it has some limitations based on where we want to go with it. I think I want to reimplement it as Object-Oriented so....
A fabric is composed of switches (and devices but those can come later). The switches are composed of modules. The modules in turn have the physical ports on them. The switches are interconnected through interswitch links (ISLs) There may be multiple ISLs from one switch to another and those may be grouped so the switch treats them as one link - so 3 2Gigabit links are treated as 1 6gigabit trunk, or 4 2Gb links may be treated as 2 4Gb trunks with 2 links in each trunk.
Going back to my somewhat hazy memory of the OO programming courses I audited once upon a time I see at least 4 clases that mirror what a fabric looks like in real life and probably 5.
A Fabric object that holds switches as a dynamic array of switch objects. and a dynamic array of ISLs. The fabric class doesn't really have any attributes of its own other than maybe a fabric name. I can scan the first switch file to find out how big the switch array needs to be, then create the fabric object with all the switches.
A switch object is in turn composed of module objects. The modules may or may not be port modules - some modules are the brains of the switch. The modules in turn are composed of an array of port objects. There are a few special port cases that are virtual ports, those may be defined at switch level since they really aren't attached to a module.
I want a fifth class for ISLs that is an attribute of the fabric. The fabric will have an array of ISLs. This will be important for future use. The ISL in turn will be an array of port objects.
What do you think?
A fabric is composed of switches (and devices but those can come later). The switches are composed of modules. The modules in turn have the physical ports on them. The switches are interconnected through interswitch links (ISLs) There may be multiple ISLs from one switch to another and those may be grouped so the switch treats them as one link - so 3 2Gigabit links are treated as 1 6gigabit trunk, or 4 2Gb links may be treated as 2 4Gb trunks with 2 links in each trunk.
Going back to my somewhat hazy memory of the OO programming courses I audited once upon a time I see at least 4 clases that mirror what a fabric looks like in real life and probably 5.
A Fabric object that holds switches as a dynamic array of switch objects. and a dynamic array of ISLs. The fabric class doesn't really have any attributes of its own other than maybe a fabric name. I can scan the first switch file to find out how big the switch array needs to be, then create the fabric object with all the switches.
A switch object is in turn composed of module objects. The modules may or may not be port modules - some modules are the brains of the switch. The modules in turn are composed of an array of port objects. There are a few special port cases that are virtual ports, those may be defined at switch level since they really aren't attached to a module.
I want a fifth class for ISLs that is an attribute of the fabric. The fabric will have an array of ISLs. This will be important for future use. The ISL in turn will be an array of port objects.
What do you think?
Comment