How to store/deal with data available to other classes
I’m writing a CAD program. Let’s say I have in input class, this class reads various data from a text file and creates lots of lists/dictionaries and …. These data need to be accessed by other methods in other classes to be modified. Now here is how I have done it so far:
How to design similar purpose static methods
I know that you cannot override static functions, but for what I’m looking to do, it seems like the logical way to design my class.
Proper MVC practice for a hierarchy of elements
I am trying to develop my first major MVC application, and as such I am new to doing this on a large scale. I’ve read as much as I can online and am continuously striving for making my code as clean as possible and not introduce any bad practices. Right now, I’m starting to question if my setup is the way it would be done in the real world.
Proper MVC practice for a hierarchy of elements
I am trying to develop my first major MVC application, and as such I am new to doing this on a large scale. I’ve read as much as I can online and am continuously striving for making my code as clean as possible and not introduce any bad practices. Right now, I’m starting to question if my setup is the way it would be done in the real world.
Proper MVC practice for a hierarchy of elements
I am trying to develop my first major MVC application, and as such I am new to doing this on a large scale. I’ve read as much as I can online and am continuously striving for making my code as clean as possible and not introduce any bad practices. Right now, I’m starting to question if my setup is the way it would be done in the real world.
Why VB local variables can be ‘static’, not ‘shared’?
In Visual Basic .NET, I can see different keyword for the same(?) concept:
Static console object or dependency injection?
For a current project I have created a Console
class which wraps up C++’s usual cout
, writes output to a file or uses Console::WriteLine
depending on the environment. Currently I’ve setup my code base to inject a console object into each class that I use, making all of them extend a base class: Debuggable
. This seemed like a great plan at first but now that I have to pass the console to every object and ensure that it is created before all of them I’m having second thoughts.
Static console object or dependency injection?
For a current project I have created a Console
class which wraps up C++’s usual cout
, writes output to a file or uses Console::WriteLine
depending on the environment. Currently I’ve setup my code base to inject a console object into each class that I use, making all of them extend a base class: Debuggable
. This seemed like a great plan at first but now that I have to pass the console to every object and ensure that it is created before all of them I’m having second thoughts.
Etymology of “static” functions
I get why static local variables are called “static” — we want them to be allocated in static memory! But what is the reason for calling functions and variables we want restricted to the current file “static”? I don’t see the connection; either way, they’re allocated in static memory, right?
What is a best design to hold a “global” mutable list?
Let’s say that I have an ArrayList of class Person and I have two objects that are generated from two different classes which read and write to this ArrayList.