A little about history of OOP, its motivation, and core concepts.
Exceptions are a very common concept in most of languages nowadays. In this article we will discuss why exceptions are needed, checked vs unchecked exceptions, and why C# doesn’t have checked exceptions.
This article is about my personal explanation of the famous design patterns: Model View Controller (MVC), Model View Presenter (MVP), Presentation Model (PM), and Model View ViewModel (MVVM).
Let’s start with Model.
Builder Pattern and Factory Pattern are pretty similar in a way: both of them encapsulate the details of object-creation processes. However, in cases there are many complicated processes to create various representations of objects, and those processes share a common trait, Builder Pattern is the better choice.
Object persistence — for example, saving/loading objects to/from a database — is easy, especially when using an ORM framework. It is easy because it breaks principles of OO design.
Have you ever hesitated between these two implementation of the Factory Pattern:
In recent years, Entity-Component Systems (ECS) has been recognized as the most notable architecture for game development. There are many good articles about the architecture that can be found on the Internet, some of them are:
- Entity Systems are the future of MMOG development
- What is an entity system framework for game development?
- Why use an entity system framework for game development?
- Understanding Component-Entity-Systems
- Entity Systems Wiki
- Entity component system [Wikipedia]
Of course these articles are excellent and well-written, but one thing I don’t like about them is that they are not fair at comparing OOP and ECS. They think that class inheritance is fundamental to OOP thus they blame OOP in order to praise ECS as a preference of composition over inheritance.
Hey dude, what are the differences between acceptance tests and unit tests?
Well, an acceptance test – aka scenario test – may involve many units of our software, while a unit test is a test for only one unit.
What if the acceptance test involves only one unit? Now the acceptance test and the unit test are the same?
All software are about functions operating on data. Data come with the concepts of structure  and state; concepts of functions include prototype and implementation. We can change data structures at coding-time and change data states at run-time. But the prototype and implementation of a function cannot be changed at run-time, they are allowed to be changed at coding-time only. Another different is that data are passive while functions can access data and/or call other functions. These differences between functions and data should be carefully considered when designing software.
Many programmers when concerning about OO design usually say: “Static methods are bad because they encourage procedural paradigm”. In this article, I would argue that static methods are not always bad and they have nothing to do with procedural paradigm.