That looks dubious. You are setting up global values and allowing them to change. That is error‑prone.
wayne morton wrote: . . . 3 classes are going to use that exact same list of data.
If that list of data changes it will change for all 3 classes. . . .
wayne morton wrote:But in this case i have 3 classes that will be using exactly the same array and if it changes in any way it will change in exactly the same way for all 3 classes. So i thought of having a single array that i only need to change once if needs be rather than 3 separate arrays i need to change individually if a change is needed. It also reduces the scope for problems in the sense that having to change 3 separate files increases the chance of making a mistake in one of them if i ever did have to change the data.
To me that is reducing my possible workload if a change is needed but goes against that ethos of encapsulated data with the logic that uses it and to a certain degree the re-usability of the class if it was usable in another programme.
wayne morton wrote:I already did that as i don't want or need the values to change in any way. The array that is exported is effectively a copy (or clone, still getting to grips with terminology but it is it's own entity) of the original array so the original array never changes.
I probably should have said this originally and will update my original post to say it. If it changes in any way it will be hard programming it not having it change while the programme is running.
wayne morton wrote:In a way it probably seems obvious but i don't want to get into a way of thinking/doing things only to find out further along that i am doing it wrong. For this particular case it seemed logical to have a separate array class but going on previous information i was concerned i may have been digging myself a hole for later because i didn't know about the bigger picture.