Why and How to avoid Event Handler memory leaks?

I just came to realize, by reading some questions and answers on StackOverflow, that adding event handlers using += in C# (or i guess, other .net languages) can cause common memory leaks… I have used event handlers like this in the past many times, and never realized that they can cause, or have caused, memory … Read more

What is the difference between the template method and the strategy patterns?

Can someone please explain to me what is the difference between the template method pattern and the strategy pattern is? As far as I can tell they are 99% the same – the only difference being that the template method pattern has an abstract class as the base class whereas the strategy class uses an … Read more

Business logic in MVC [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 1 year ago. Improve this question I have 2 questions: Q1. Where exactly does “business logic” lie in the MVC pattern? I … Read more

How will I know when to create an interface?

I’m at a point in my development learning where I feel like I must learn more about interfaces. I frequently read about them but it just seems like I cannot grasp them. I’ve read examples like: Animal base class, with IAnimal interface for things like ‘Walk’, ‘Run’, ‘GetLegs’, etc – but I’ve never been working … Read more

How to explain dependency injection to a 5-year-old? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more