Hi,
I'm not user where to post this so feel free to move it if its in the wrong place. I'm using vb.net 201 express and ql server 208r2
I am developing a system where I am using about 10 global variables. From reading online a lot of users prefer to store there global variables in a class with accessor methods and other non related methods and pass an instance of the class to each Form as required, this is easier than passing a long list of global variables and offers some level of encapsulation while implementing the OOP paradigm.
My dilemma is tho, if the class members are not related in any way to one another, for example ClientID, StaffID, UserID, ComputerID, and members like CalcTotals etc. this is surely wrong, as there is no object of this type, that has all these disparate elements and thus, is not modelling the real world?
Isn't it just another case of using a model for convenience rather than for the purpose it was intended, thus while I know using global variables is less secure, it is more honest.
Isn't creating one global class to hold all global members and methods, not just circumventing the system for our own convenience.
I am interested in hearing everyone opinion on this matter and what they would do/have done in this situation and what they have learned from it, because I feel I am going to have to do this too.....
I'm not user where to post this so feel free to move it if its in the wrong place. I'm using vb.net 201 express and ql server 208r2
I am developing a system where I am using about 10 global variables. From reading online a lot of users prefer to store there global variables in a class with accessor methods and other non related methods and pass an instance of the class to each Form as required, this is easier than passing a long list of global variables and offers some level of encapsulation while implementing the OOP paradigm.
My dilemma is tho, if the class members are not related in any way to one another, for example ClientID, StaffID, UserID, ComputerID, and members like CalcTotals etc. this is surely wrong, as there is no object of this type, that has all these disparate elements and thus, is not modelling the real world?
Isn't it just another case of using a model for convenience rather than for the purpose it was intended, thus while I know using global variables is less secure, it is more honest.
Isn't creating one global class to hold all global members and methods, not just circumventing the system for our own convenience.
I am interested in hearing everyone opinion on this matter and what they would do/have done in this situation and what they have learned from it, because I feel I am going to have to do this too.....