All Questions
14 questions
-1
votes
1
answer
107
views
How can I prevent an object from being re-sanitized everytime it is passed as input to a function?
Suppose that I have a class named CharStream
Additionally, there are a large number of functions which convert their function input into a CharStream
def funky_the_function(_input):
input = ...
0
votes
2
answers
933
views
Best pattern/practice to execute a multi-step code generation process
I am working on a project that generates an API with the possibility of doing CRUD operations based on a high-level description of the resources that the user would like to have in an application. In ...
0
votes
1
answer
672
views
Source of "... against the interface, not the implementation"
For a paper I am writing, I need to find the origin of the following two phrases:
Code against the interface, not the implementation
and
Test the interface, not the implementation
(Note: the ...
1
vote
1
answer
822
views
Is it bad practice to run different versions of code in different environments? (i.e. test, prod)
As an example, let's say you have the following pseudocode:
if test environment: # meaning you don't have the typical service account prod perms
sudo as service account + do operation
else: # in ...
3
votes
1
answer
176
views
Is good or bad practice to share reporting modules between systems/apps?
At my new work, a few people want to share modules between systems/apps, and I'm a bit skeptical about it.
Context: we have a lot of little apps living in different servers, some of them are ...
0
votes
1
answer
2k
views
Best design pattern for Notification System => How to handle multiple languages and items
As always I came here to ask for some light in a design issue I am facing.
I have a system that issues some notifications :
PackageReceivedNotification
PackageSentNotification
...
-3
votes
1
answer
3k
views
Best practices: Number of return statements [duplicate]
I'd like to ask about best practices on return statements.
So, what would be more preferable, something like...
...
String r = null;
if(var != null) {
r = "NOT NULL!";
}
return r;
Or something ...
0
votes
1
answer
121
views
MV(X) Patterns: How much nesting is too much? Is not enough?
Posts may be smaller than they appear! Skip the bulleted list.
Lemme Just Say...
I know that this is going to be largely (entirely...) opinion-based. Everyone has their own approach, and their own ...
3
votes
0
answers
88
views
Should my application call statsd directly or should I call statsd based off logs?
I'm planning on incrementing counters in statsd based of various events within my application. I have logging in place for these events. So, from my viewpoint I have two options:
Update the ...
0
votes
1
answer
1k
views
Why use the Singleton pattern over class functions and fields? [duplicate]
I'm going to start by saying that I understand that programming in mostly class functions and variables can be harmful to object-orientation, and that most of the time an instance is preferred. I'll ...
0
votes
1
answer
83
views
How to record/store edits?
In many programs and web apps (stack exchange included) the program is able to backtrack what edits where made to the piece. My issue is similar: I want to be able to store a "timeline" of edits, ...
9
votes
2
answers
3k
views
Returning an IQueryable from an IRepository
Using the Repository pattern, is it proper to return an IQueryable of a data set (table), for generic usage?
It is very handy in many cases, especially when using external libraries that leverage ...
8
votes
2
answers
324
views
Low coupling processing big quantities of data
Usually I achieve low coupling by creating classes that exchange lists, sets, and maps between them. Now I am developing a Java batch application and I can't put all the data inside a data structure ...
18
votes
4
answers
6k
views
Should injecting dependencies be done in the ctor or per method?
Consider:
public class CtorInjectionExample
{
public CtorInjectionExample(ISomeRepository SomeRepositoryIn, IOtherRepository OtherRepositoryIn)
{
this._someRepository = ...