Classes Archives - {coding}Sight https://codingsight.com/category/languages-coding/classes/ Blog for SQL Server DBAs and Developers Mon, 18 Oct 2021 15:03:52 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://codingsight.com/wp-content/uploads/2021/10/cropped-Soсial_-Fb_180х180-1-32x32.png Classes Archives - {coding}Sight https://codingsight.com/category/languages-coding/classes/ 32 32 Implementing OOP Inheritance in Classes that work with SQL and Entity Framework https://codingsight.com/implementing-oop-inheritance-in-classes-that-work-with-sql-and-ms-entity-framework/ Wed, 16 Aug 2017 10:49:21 +0000 http://codingsight.com/?p=2033 This article is about creating a data model that would nicely fit SQL and contain “proper” OOP inheritance. I must say that I encountered this problem at various times on different projects, and I solved it in different ways. The names of the approaches are taken from the terminology that has developed on the relevant …

The post Implementing OOP Inheritance in Classes that work with SQL and Entity Framework appeared first on {coding}Sight.

]]>
Steps to Reduce Code Size after Use of Strategy Pattern https://codingsight.com/steps-to-reduce-code-size-after-use-of-strategy-pattern/ Fri, 11 Aug 2017 07:38:39 +0000 http://codingsight.com/?p=1997 This article features a few tricks to reduce the size of the code resulting from the use of the ‘strategy’ pattern. As you can deduce from the title, all these tricks will be related to the usage of generic types. 1. Hierarchy of classes involved in magic rituals Suppose we have an abstract ‘vehicle’ class …

The post Steps to Reduce Code Size after Use of Strategy Pattern appeared first on {coding}Sight.

]]>
StringBuilder: the Past and the Future https://codingsight.com/stringbuilder-the-past-and-the-future/ Mon, 13 Feb 2017 15:49:01 +0000 http://codingsight.com/?p=555 In the previous article, I elaborated on peculiarities of string concatenation. In this article, I would like to consider the StringBuilder class in detail. As we all know, strings in .Net are immutable (without use of unsafe). Therefore, it is not a good idea to perform concatenation frequently. It means that the following code has …

The post StringBuilder: the Past and the Future appeared first on {coding}Sight.

]]>
Under the Hood of Stopwatch https://codingsight.com/under-the-hood-of-stopwatch/ Thu, 02 Feb 2017 14:04:56 +0000 http://codingsight.com/?p=460 Introduction As all developers, I often need to measure the execution time of my own (and not only my own) code. When I was a beginning programmer, I used the DateTime structure for this purpose. Time have passed and I learned about the Stopwatch class and began using it extensively. I think most of you …

The post Under the Hood of Stopwatch appeared first on {coding}Sight.

]]>
Effective Use of Classes in .NET https://codingsight.com/effective-use-of-classes-in-net/ Wed, 28 Dec 2016 09:15:45 +0000 http://codingsight.com/?p=3140 When you need to learn a programming language, you buy a book. From books, we learn basics of the language and how to program, but this is only the beginning – there is also a development environment, and the work with it is another complicated story. Let’s take a look at some secrets of Visual …

The post Effective Use of Classes in .NET appeared first on {coding}Sight.

]]>