{"id":61445,"date":"2021-12-31T06:00:50","date_gmt":"2021-12-31T05:00:50","guid":{"rendered":"https:\/\/drafts.code-maze.com\/?p=61445"},"modified":"2023-11-08T12:23:33","modified_gmt":"2023-11-08T11:23:33","slug":"static-classes-csharp","status":"publish","type":"post","link":"https:\/\/code-maze.com\/static-classes-csharp\/","title":{"rendered":"When to Use Static Classes in C#"},"content":{"rendered":"<p>C# language supports static classes. In this article, we are going to learn when to use static classes in C# and how to implement them using a .NET (Core) console application.<\/p>\n<div style=\"padding: 20px; border-left: 5px #dc2323 solid; display: block; margin-bottom: 20px; box-shadow: 1px 1px 5px 0px lightgrey;\">To download the source code for this article, you can visit our <a href=\"https:\/\/github.com\/CodeMazeBlog\/CodeMazeGuides\/tree\/main\/csharp-classes-struct-record\/StaticClasses\" target=\"_blank\" rel=\"nofollow noopener\">GitHub repository<\/a>.<\/div>\n<p>Let&#8217;s begin.<\/p>\n<h2><a id=\"what-are-static-classes\"><\/a>What Are Static Classes?<\/h2>\n<p>Static classes are<strong> classes that cannot be instantiated by their users.<\/strong> All the members of static classes are static themselves. They can be accessed through the class name directly without having to instantiate them using the <code>new<\/code> keyword.<\/p>\n<p>Let&#8217;s take a look at a C# syntax when defining static classes:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">static class ClassName  \r\n{  \r\n   \/\/static methods  \r\n   \/\/static data members  \r\n}  <\/pre>\n<p>Static classes contain static data members and methods. Besides that, these classes do not support inheritance and cannot have instance constructors like regular classes. Static classes can have one static parameterless constructor that cannot be inherited.<\/p>\n<p>Let&#8217;s discuss how to implement static classes in C# using a simple <code>Student<\/code> class.\u00a0<\/p>\n<h2><a id=\"how-to-implement-static-classes\"><\/a>How to Implement Static Classes in C#<\/h2>\n<p>A static class is defined using the\u00a0<code>static<\/code> keyword. Let&#8217;s define a static class called\u00a0<code>Student<\/code> that stores students&#8217; details such as names, date of birth, and ids:\u00a0<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static class Student\r\n{\r\n    private static string _name;\r\n    public static int Id { get; set; }\r\n    public static string Name { get { return _name; } set =&gt; _name = value; }\r\n    public static DateTime DateOfBirth { get; set; }\r\n}<\/pre>\n<p>Let&#8217;s go ahead and define a method <code>CalculateAge<\/code> to calculate the age of a student by using the <code>DateOfBirth<\/code> property:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static int CalculateAge(DateTime DateOfBirth)\r\n{\r\n    var today = DateTime.Today;\r\n    var age = today.Year - DateOfBirth.Year;\r\n    if (DateOfBirth.Date &gt; today.AddYears(-age))\r\n    {\r\n        age--;\r\n    }\r\n    return age;\r\n}<\/pre>\n<p>After that, we can implement a static method called <code>StudentDetails<\/code> to return the properties of the <code>Student<\/code> class as a string:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public static string StudentDetails()\r\n{\r\n    var studentDetails = string.Empty;\r\n    studentDetails = Name + \" \" + DateOfBirth + \" \" + CalculateAge(DateOfBirth);\r\n    return studentDetails;\r\n}<\/pre>\n<p>Next on, we shall proceed to invoke the static methods without instantiating the <code>Student<\/code> class in the <code>Main<\/code> method:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">static void Main(string[] args)\r\n{\r\n    Student.Id = 1;\r\n    Student.Name = \"John Doe\";\r\n    Student.DateOfBirth = new DateTime(1994, 12, 31);\r\n    Console.WriteLine(\"The student using a static class: \" + Student.StudentDetails());\r\n}<\/pre>\n<p>To understand the difference between static and non-static classes, let&#8217;s implement the same program through a non-static class.<\/p>\n<p>That said, we are going to create a new <code>CollegeStudent<\/code> class that has the same properties and methods as the <code>Student<\/code> class:\u00a0<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">public class CollegeStudent\r\n{\r\n    private string _name;\r\n\r\n    public int Id { get; set; }\r\n    public string Name { get { return _name; } set =&gt; _name = value; }\r\n    public DateTime DateOfBirth { get; set; }\r\n\r\n    public int CalculateAge(DateTime DateOfBirth)\r\n    {\r\n        var today = DateTime.Today;\r\n\r\n        var age = today.Year - DateOfBirth.Year;\r\n\r\n        if (DateOfBirth.Date &gt; today.AddYears(-age))\r\n        {\r\n            age--;\r\n        }\r\n        return age;\r\n    }\r\n\r\n    public string StudentDetails()\r\n    {\r\n        var studentDetails = string.Empty;\r\n        studentDetails = Name + \" \" + DateOfBirth + \" \" + CalculateAge(DateOfBirth);\r\n        return studentDetails;\r\n    }\r\n}<\/pre>\n<p>The next step is to modify our <code>Main<\/code> method to achieve the same result as the non-static class:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\">static void Main(string[] args)\r\n{\r\n    var student = new CollegeStudent();\r\n    student.Id = 1;\r\n    student.Name = \"John Doe\";\r\n    student.DateOfBirth = new DateTime(1994, 12, 31);\r\n    Console.WriteLine(\"The student details using a non-static class: \" + student.StudentDetails());\r\n}<\/pre>\n<p>As you can see in this case we had to instantiate the\u00a0<code>CollegeStudent<\/code> class.<\/p>\n<p>Let&#8217;s discuss when and when not to use static classes.\u00a0<\/p>\n<h2><a id=\"when-to-use-static-classes\"><\/a>When Should We Use Static Classes?<\/h2>\n<p>Here are some of the scenarios where we might want to use static classes.<\/p>\n<p>They are<strong> perfect for implementing utilities.<\/strong> Applications that don&#8217;t need any modifications or utility classes could use static classes. For example, in-built classes such as <code>Math<\/code> and <code>System.Convert<\/code> are some of the commonly used static classes.\u00a0<\/p>\n<p><strong>Static classes consume fewer resources. <\/strong>They do not require instantiation, hence, duplicate objects don&#8217;t take up additional memory space. Theoretically, static classes offer better performance than their non-static counterparts. This is usually unnoticeable in practical applications.<\/p>\n<p><strong>To use extension methods in our app, <\/strong>we have to use static classes<strong>.<\/strong><\/p>\n<h2><a id=\"when-not-to-use-static-classes\"><\/a>When We Should Not Use Static Classes?<\/h2>\n<p>Of course, there are some cons to using static classes as well.<\/p>\n<p><strong>Static classes break the Object-Oriented Programming principle of polymorphism. <\/strong>It is difficult to change the functionality of a static class without modifying it. For example, creating child classes from non-static classes helps programmers extend existing functionalities without making changes to parent classes.\u00a0<\/p>\n<p><strong>Static classes cannot be defined through interfaces.<\/strong> They become infeasible when we need to reuse them when implementing interfaces.<\/p>\n<p>As the functionality of a static method grows,<strong> it could result in the use of parameters that may not be needed<\/strong>. This is called <strong>parameter creep<\/strong>. The solution to this problem is to create derivative classes and overriding methods to support additional functionalities. However, as we have discussed in the previous points, static classes do not support inheritance and method overriding.\u00a0<\/p>\n<p><strong>Replacing the production code with the test code could be problematic during testing processes<\/strong>. We would need to use wrapper classes to test static classes.\u00a0<\/p>\n<h2><a id=\"static-vs-non-static-classes\"><\/a>Differences Between Static and Non-static Classes<\/h2>\n<p>Here are some of the main differences between the static and non-static classes:<\/p>\n\n<table id=\"tablepress-18\" class=\"tablepress tablepress-id-18\">\n<thead>\n<tr class=\"row-1\">\n\t<th class=\"column-1\">Static Classes<\/th><th class=\"column-2\">Non-static Classes<\/th>\n<\/tr>\n<\/thead>\n<tbody class=\"row-striping row-hover\">\n<tr class=\"row-2\">\n\t<td class=\"column-1\">Do not support instantiation<\/td><td class=\"column-2\">Support instantiation through the <code>new<\/code>\u00a0keyword<\/td>\n<\/tr>\n<tr class=\"row-3\">\n\t<td class=\"column-1\">Static classes do not support inheritance<\/td><td class=\"column-2\">They allow inheritance<\/td>\n<\/tr>\n<tr class=\"row-4\">\n\t<td class=\"column-1\">Can only have one private static parameterless constructor.<br \/>\nCannot have instance constructors.<\/td><td class=\"column-2\">Can have non-static constructors<\/td>\n<\/tr>\n<tr class=\"row-5\">\n\t<td class=\"column-1\">Static methods do not allow method overriding<\/td><td class=\"column-2\">Non-static methods allow overriding\u00a0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<!-- #tablepress-18 from cache -->\n<p>Let&#8217;s summarize what we&#8217;ve learned.<\/p>\n<h2><a id=\"conclusion\"><\/a>Conclusion<\/h2>\n<p>In summary, static classes can neither support instantiation nor inheritance. This makes them ideal for use in utility classes that do not need further modifications. On the other hand, if we need to add functionalities to our classes, non-static classes would be more ideal than their static counterparts.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>C# language supports static classes. In this article, we are going to learn when to use static classes in C# and how to implement them using a .NET (Core) console application. Let&#8217;s begin. What Are Static Classes? Static classes are classes that cannot be instantiated by their users. All the members of static classes are [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":62189,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"categories":[12],"tags":[336,983],"class_list":["post-61445","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-csharp","tag-static-class","tag-static-vs-non-static","et-has-post-format-content","et_post_format-et-post-format-standard"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>When to Use Static Classes in C# - Code Maze<\/title>\n<meta name=\"description\" content=\"Static Classes in C# are a type of class that cannot be instantiated and are useful in various scenarios involving utilities.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/code-maze.com\/static-classes-csharp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"When to Use Static Classes in C# - Code Maze\" \/>\n<meta property=\"og:description\" content=\"Static Classes in C# are a type of class that cannot be instantiated and are useful in various scenarios involving utilities.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/code-maze.com\/static-classes-csharp\/\" \/>\n<meta property=\"og:site_name\" content=\"Code Maze\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-31T05:00:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-11-08T11:23:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1100\" \/>\n\t<meta property=\"og:image:height\" content=\"620\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Code Maze\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/CodeMazeBlog\" \/>\n<meta name=\"twitter:site\" content=\"@CodeMazeBlog\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Code Maze\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/\"},\"author\":{\"name\":\"Code Maze\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\"},\"headline\":\"When to Use Static Classes in C#\",\"datePublished\":\"2021-12-31T05:00:50+00:00\",\"dateModified\":\"2023-11-08T11:23:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/\"},\"wordCount\":681,\"commentCount\":7,\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"keywords\":[\"static class\",\"static vs non-static\"],\"articleSection\":[\"C#\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/code-maze.com\/static-classes-csharp\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/\",\"url\":\"https:\/\/code-maze.com\/static-classes-csharp\/\",\"name\":\"When to Use Static Classes in C# - Code Maze\",\"isPartOf\":{\"@id\":\"https:\/\/code-maze.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"datePublished\":\"2021-12-31T05:00:50+00:00\",\"dateModified\":\"2023-11-08T11:23:33+00:00\",\"description\":\"Static Classes in C# are a type of class that cannot be instantiated and are useful in various scenarios involving utilities.\",\"breadcrumb\":{\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/code-maze.com\/static-classes-csharp\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png\",\"width\":1100,\"height\":620,\"caption\":\"C# Development\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/code-maze.com\/static-classes-csharp\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/code-maze.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"When to Use Static Classes in C#\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/code-maze.com\/#website\",\"url\":\"https:\/\/code-maze.com\/\",\"name\":\"Code Maze\",\"description\":\"Learn. Code. Succeed.\",\"publisher\":{\"@id\":\"https:\/\/code-maze.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/code-maze.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/code-maze.com\/#organization\",\"name\":\"Code Maze\",\"url\":\"https:\/\/code-maze.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png\",\"width\":3511,\"height\":3510,\"caption\":\"Code Maze\"},\"image\":{\"@id\":\"https:\/\/code-maze.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/CodeMazeBlog\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04\",\"name\":\"Code Maze\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/code-maze.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"contentUrl\":\"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png\",\"caption\":\"Code Maze\"},\"description\":\"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/company\/codemaze\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog\"],\"url\":\"https:\/\/code-maze.com\/author\/codemazecontributor\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"When to Use Static Classes in C# - Code Maze","description":"Static Classes in C# are a type of class that cannot be instantiated and are useful in various scenarios involving utilities.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/code-maze.com\/static-classes-csharp\/","og_locale":"en_US","og_type":"article","og_title":"When to Use Static Classes in C# - Code Maze","og_description":"Static Classes in C# are a type of class that cannot be instantiated and are useful in various scenarios involving utilities.","og_url":"https:\/\/code-maze.com\/static-classes-csharp\/","og_site_name":"Code Maze","article_published_time":"2021-12-31T05:00:50+00:00","article_modified_time":"2023-11-08T11:23:33+00:00","og_image":[{"width":1100,"height":620,"url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","type":"image\/png"}],"author":"Code Maze","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/CodeMazeBlog","twitter_site":"@CodeMazeBlog","twitter_misc":{"Written by":"Code Maze","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/code-maze.com\/static-classes-csharp\/#article","isPartOf":{"@id":"https:\/\/code-maze.com\/static-classes-csharp\/"},"author":{"name":"Code Maze","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04"},"headline":"When to Use Static Classes in C#","datePublished":"2021-12-31T05:00:50+00:00","dateModified":"2023-11-08T11:23:33+00:00","mainEntityOfPage":{"@id":"https:\/\/code-maze.com\/static-classes-csharp\/"},"wordCount":681,"commentCount":7,"publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"image":{"@id":"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","keywords":["static class","static vs non-static"],"articleSection":["C#"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/code-maze.com\/static-classes-csharp\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/code-maze.com\/static-classes-csharp\/","url":"https:\/\/code-maze.com\/static-classes-csharp\/","name":"When to Use Static Classes in C# - Code Maze","isPartOf":{"@id":"https:\/\/code-maze.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage"},"image":{"@id":"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage"},"thumbnailUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","datePublished":"2021-12-31T05:00:50+00:00","dateModified":"2023-11-08T11:23:33+00:00","description":"Static Classes in C# are a type of class that cannot be instantiated and are useful in various scenarios involving utilities.","breadcrumb":{"@id":"https:\/\/code-maze.com\/static-classes-csharp\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/code-maze.com\/static-classes-csharp\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/static-classes-csharp\/#primaryimage","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2021\/12\/social-csharp.png","width":1100,"height":620,"caption":"C# Development"},{"@type":"BreadcrumbList","@id":"https:\/\/code-maze.com\/static-classes-csharp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/code-maze.com\/"},{"@type":"ListItem","position":2,"name":"When to Use Static Classes in C#"}]},{"@type":"WebSite","@id":"https:\/\/code-maze.com\/#website","url":"https:\/\/code-maze.com\/","name":"Code Maze","description":"Learn. Code. Succeed.","publisher":{"@id":"https:\/\/code-maze.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/code-maze.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/code-maze.com\/#organization","name":"Code Maze","url":"https:\/\/code-maze.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez.png","width":3511,"height":3510,"caption":"Code Maze"},"image":{"@id":"https:\/\/code-maze.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/CodeMazeBlog"]},{"@type":"Person","@id":"https:\/\/code-maze.com\/#\/schema\/person\/09d29b223012c8e94a68ba62861d0b04","name":"Code Maze","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/code-maze.com\/#\/schema\/person\/image\/","url":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","contentUrl":"https:\/\/code-maze.com\/wp-content\/uploads\/2020\/01\/Code-Maze-Only-Logo-Transparent-HRez-150x150.png","caption":"Code Maze"},"description":"This is the standard author on the site. Most articles are published by individual authors, with their profiles, but when several authors have contributed, we publish collectively as a part of this profile.","sameAs":["https:\/\/www.linkedin.com\/company\/codemaze\/","https:\/\/x.com\/https:\/\/twitter.com\/CodeMazeBlog"],"url":"https:\/\/code-maze.com\/author\/codemazecontributor\/"}]}},"_links":{"self":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/61445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/comments?post=61445"}],"version-history":[{"count":12,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/61445\/revisions"}],"predecessor-version":[{"id":96505,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/posts\/61445\/revisions\/96505"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media\/62189"}],"wp:attachment":[{"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/media?parent=61445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/categories?post=61445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/code-maze.com\/wp-json\/wp\/v2\/tags?post=61445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}