Design

The Open/Closed Principle – OCP

The second principle we’re going to talk about is the Open/Closed Principle. If we look at Wikipedia, we will see the following definition: The Open/Closed Principle states that software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification. Problem Statement What it means, in essence, is that when we need to introduce a change, we shouldn’t dig deep into [...]

By |2017-09-04T09:39:57+00:00September 4th, 2017|.NET, C#, Design|0 Comments

Single Responsibility Principle – SRP

This entry is part 3 of 4 in the series SOLID

SRP Definition In this article, we will look at what is single responsibility principle and look at some simple examples in C# which demonstrate the single responsibility principle and how to adhere to the SRP. Single Responsibility Principles or SRP in short states that every object should have a single [...]

By |2017-09-04T09:27:23+00:00June 28th, 2017|.NET, Best Practices, C#, Design|1 Comment

Software Architecture: Meta and SOLID Principles in C#

This entry is part 1 of 4 in the series SOLID

Learn how to develop maintainable software systems applying Meta and SOLID Principles. Teaching Approach No fluff, no ranting, no beating the air. I esteem your time. The course material is succinct, yet comprehensive. All important concepts are covered. Particularly important topics are covered in-depth. For absolute beginners, I offer my [...]

By |2017-06-28T10:53:16+00:00June 6th, 2017|.NET, Best Practices, C#, Design, Video Courses|0 Comments

Abstract Class VS Interface in C#

You can open any C# tutorial and you’ll find some information about abstract classes and interfaces. Most likely, you’ll not find any information about what is the difference between abstract class and interface. This theme was discussed earlier on the Internet several times but I want to consolidate all the most important thoughts regarding the problem of choosing between an abstract class and interface [...]

By |2016-07-23T15:40:21+00:00July 22nd, 2016|.NET, Best Practices, C#, CodeProject, Design|5 Comments

Designing and Implementing API in C#

Nowadays I’m writing my new programming video course. I chose an interesting topic for the next course: “Designing and Implementing API in C#”. How to design API? In this course, you’ll learn how to design and implement types in C# so that the other developers won’t hate you when using one of the types developed by you. It means you are going to learn [...]

By |2016-07-23T15:47:19+00:00July 22nd, 2016|.NET, Best Practices, C#, Design, Refactoring, Video Courses|1 Comment

MVVM: When EventAggregator (aka MessageBus) is an Anti-Pattern

Very often we can see that developers tend to use static message buses for all kind of interactions between objects. For those, who unaware of this pattern I want to recall that this pattern allows organizing loosely coupled communication channel between objects which don’t want (or can’t) to know each other. Let’s have a brief look at how a regular example of using this [...]

By |2016-07-08T20:58:17+00:00June 28th, 2016|.NET, Best Practices, Design, WPF|2 Comments

Money Type as Value Object, or Don’t Rely on Primitive Types!

Primitive Types Obsession Problem Today I’m going to discuss the problem of using primitive types instead of abstractions. This problem was discussed in the blog of Mark Seemann. Read it, if you haven’t read it yet. In this post I’m going to talk about Money type as an abstraction instead of using decimal type for representing money-values. In the last project I’ve been participating [...]

By |2016-04-26T16:35:43+00:00March 17th, 2016|.NET, Best Practices, C#, Design, Refactoring|0 Comments

When Method Is Better Than Property?

That’s a well known question. Actually, I knew the difference between methods and properties long ago. Despite of that, recently I stumbled upon my own incorrect choice between those semantic constructions. That’s why I decided to write this post – in order to solidify the understanding of the difference between property and method. Method vs Property fail in BCL The most notorious fail of [...]

By |2016-04-26T16:34:03+00:00February 27th, 2016|.NET, Best Practices, C#, Design|0 Comments

Hidden Dependencies as a Smell

Mark Seemann has written a nice post  “Service Locator violates encapsulation”. The name of the post speaks for itself that it’s about a pattern (anti-pattern) named Service Locator. When a programmer arbitrarily inside the code base calls for the IoC-container to resolve a dependency of an object – he uses a Service Locator anti-pattern. Mark provides the following example: public class OrderProcessor : IOrderProcessor [...]

By |2017-09-13T08:48:13+00:00October 27th, 2015|.NET, Best Practices, CodeProject, Design, Refactoring|4 Comments