Tagged Questions
3
votes
4answers
294 views
Are Compiler Directives an Antipattern?
I'm working on a legacy system that has a helper class that is symbolically linked into many different .Net projects within a solution. The logic is riddled with compiler directives that change it's ...
0
votes
1answer
215 views
Best place to write SQL queries
I've been working on this project for my company. Currently I am embedding my SQL statements inside the program itself as and when they are needed. I do have two seperate classes -
QueryBuilder ...
1
vote
0answers
87 views
Acceptable placement of the composition root using dependency injection and inversion of control containers
I've read in several sources including Mark Seemann's 'Ploeh' blog about how the appropriate placement of the composition root of an IoC container is as close as possible to the entry point of an ...
1
vote
2answers
88 views
Exposing a Disposing event
I'm implementing a .NET class which implements IDisposable. After being disposed, the object's state is invalid and so nobody should be accessing it, of course.
There are some situations where two ...
5
votes
2answers
251 views
Which design pattern is illustrated by inheriting IStructuralComparable interface?
We know that some design patterns are found so useful that they become features of the language itself.
For instance, the interface IEnumerator which is implemented by Array object.
This helps in ...
1
vote
2answers
152 views
Client Server .NET application with queuing message
I am new, so forgive me if my question is mistaken or anything, just give me an alert and I'll be glad to fix it.
Me and my team is about to develop a system where the database is located in a ...
11
votes
2answers
440 views
.Net developer trying to learn ruby on rails
I am a .NET developer and I just had the chance to play with Ruby on Rails this weekend.
In .NET we separate layers of the application by creating separate class library projects. From the design ...
11
votes
3answers
422 views
Is using unit tests to tell a story a good idea?
So, I have an authentication module I wrote some time ago. Now I'm seeing the errors of my way and writing unit tests for it. While writing unit tests, I have a hard time coming up with good names and ...
2
votes
2answers
225 views
What are the caveats of the event system built on Messenger rather than on classic .NET events?
MVVM Light and PRISM offer messenger to implement event system.
the approximate interface looks like the following one:
interface Messanger
{
void ...
4
votes
3answers
162 views
Help identify the pattern for reacting on updates
There's an entity that gets updated from external sources. Update events are at random intervals. And the entity has to be processed once updated. Multiple updates may be multiplexed. In other words ...
3
votes
4answers
1k views
C# Open Source software that is useful for learning Design Patterns
In college I took a class in Expert Systems. The language the book taught (CLIPS) was esoteric - Expert Systems: Principles and Programming, Fourth Edition. I remember having a tough time with it. ...
1
vote
2answers
185 views
Is it better to define all routes in the Global.asax than to define separately in the areas?
I am working on a MVC 4 project that will serve as an API layer of a larger application.
The developers that came before me set up separate Areas to separate different API requests (i.e Search, ...
0
votes
2answers
126 views
Implenting ActiveRecord with inheritance?
I recently converted an old application that was using XML files as the data store to use SQL instead. To avoid a lot of changes I basically created ActiveRecord style classes that inherited from the ...
4
votes
8answers
921 views
What do you consider to be the essential design patterns? And do you use them? [closed]
It seems to me that programmers have an increasingly uphill task of staying up-to-date.
In my efforts to improve my programming ability, I am in search of the essential design patterns that are ...
22
votes
7answers
2k views
Return magic value, throw exception or return false on failure?
I sometimes end up having to write a method or property for a class library for which it is not exceptional to have no real answer, but a failure. Something cannot be determined, is not available, not ...