Wikipedia Article for Design Patterns 'Before' and 'After' refactoring examples
3
votes
0answers
39 views
JavaScript Boilerplate - Review comments required
I am in between to create JavaScript Boilerplate (collection of best practices around) for low/medium complex project and will host on GitHub in sometime once finalized it.
Have divided the ...
0
votes
0answers
34 views
Does this code follow loose coupling pattern or should be refactored/re-designed?
I've to adming i don't like this design.
The main class (SMSHelper) is responsible of query a REST web service which in turn returns an XML string. This helper is going to return a new SMSCreditInfo ...
1
vote
0answers
18 views
contract validation and responsibility without exceptions in the constructor
my question is based on this "principles"
do not throw exceptions in a constructor
single responsibility / seperation of conerns
use logic exceptions for broken contracts and runtime exceptions for ...
1
vote
3answers
61 views
Fail-safe remote API operations - best practices
I'm working with two remote APIs, one which manages customers, the other (a Paypal API interface) which manages billing. To delete an account, I must delete the records from both.
function ...
0
votes
1answer
18 views
MEF composition with nested factories
I am implementing the Factory pattern for creating my objects and am trying to compose the factories using the AssemblyCatelog from MEF.
The problem I have is that while the Import of the ...
1
vote
0answers
137 views
EF Code First with Repository, UnitOfWork and DbContextFactory
I am about to >explode< :) due to amount of reading on this subject...
My head hurts, and I need some honest opinions...
There is a similar question/review that I noticed, but I believe my approach ...
0
votes
1answer
30 views
adding APL logger to an application [closed]
I have an application (Legacy code)
that contains interface Icomponent with save() methods
and many classes that implement it.
I want to add log after every save().
I thought to
use the ...
1
vote
2answers
79 views
Comments on my Java pattern for Mutable turned Immutable objects
Commenting omitted to give you the idea. I've been toying with this recently as a variant of the Builder pattern. I've recently fallen in love with immutable objects for the benefits they give in ...
2
votes
1answer
133 views
Knight's Travails solution
I created this as part of an interview process of graduate programming job. Submitted the code to them, and I was called for an interview.
This is the assignment brief: ...
1
vote
2answers
61 views
Performing a chain of mutually dependent actions, and reversing in case of failure
Description
I'm writing a program that makes changes to a few Python source files--creating some, and appending content to others. Since some changes depend on others, I check frequently to make sure ...
2
votes
2answers
55 views
Is this right way to implement Abort, Retry and Ignore activity pattern?
I've a bunch of sequential activities. These are long running. Once an activity is complete, it can't be rolled back. Now something deep down the line fails. Now I've few options
Report this to end ...
3
votes
1answer
52 views
Command Pattern in timed queue?
I have some code that needs to be executed at specific user-defined times of day (e.g. at 11:45:30 am). My code looks like this:
void OnTimer(UINT nTimerID)
{
if(nTimerID == somethingTimerId_)
...
2
votes
2answers
125 views
How to make this code fit into the base class
I have lots of classes that inherit from abstract base class, which has abstract method
public class BaseClass<T>
{
protected abstract void GetItems();
}
each subclass have almost the ...
2
votes
2answers
66 views
What is a good way to structure mark-up generating code and avoid the example mess?
Here are two methods of code that only vary in one place. Specifically, the first method calls GetReleaseYear(), and the second calls GetReleaseDate().
This is one example of a one-line difference in ...
4
votes
1answer
201 views
Is this a good design for a Factory Pattern?
I'm creating a system to generate math problems. As you know in mathematics, there are milles of kinds of problems: Binary problems, fractions, decimals, comparating two numbers, etc.
I'm creating an ...