Tagged Questions
0
votes
0answers
33 views
How to perform method [migrated]
I have class Person, two child classes Staff and Student, interface IPerson. Also I have a class Database and class Gateway. Class Database has
private string name = "username";
and method
...
6
votes
4answers
254 views
How to prevent duplicate data access methods that retrieve similar data?
In almost every project I work on with a team, the same problem seems to creep in. Someone writes UI code that needs data and writes a data access method:
AssetDto GetAssetById(int assetId)
A week ...
4
votes
4answers
334 views
Best Method of function parameter validation
I've been dabbling with the idea of creating my own CMS for the experience and because it would be fun to run my website off my own code base.
One of the decisions I keep coming back to is how best ...
4
votes
3answers
120 views
Using “prevent execution of method” flags
First of all I want to point out my concern with some pseudocode (I think you'll understand better)
Assume you have a global debug flag, or class variable named "debug",
class a :
var debug = ...
4
votes
3answers
501 views
What is a good pattern for combined caching and reinitialization?
I have a situation where I have three requirements:
Lazy initialization - don't create the collection until asked for it
Caching - keep the collection in memory on the object
Reinitialization - be ...