{"id":31,"date":"2008-01-10T15:07:12","date_gmt":"2008-01-10T19:07:12","guid":{"rendered":"http:\/\/jianmingli.com\/wp\/?p=31"},"modified":"2013-01-19T10:08:09","modified_gmt":"2013-01-19T15:08:09","slug":"a-great-site-for-design-patterns","status":"publish","type":"post","link":"https:\/\/jianmingli.com\/wp\/?p=31","title":{"rendered":"Design Patterns with C#"},"content":{"rendered":"<div class='toc wptoc'>\n<h2>Contents<\/h2>\n<ol class='toc-odd level-1'>\n\t<li>\n\t\t<a href=\"#Creational_Patterns\">Creational Patterns<\/a>\n\t\t<ol class='toc-even level-2'>\n\t\t\t<li>\n\t\t\t\t<a href=\"#Singleton\">Singleton<\/a>\n\t\t\t<\/li>\n\t\t<\/ol>\n\t<li>\n\t\t<a href=\"#Behavioral_Patterns\">Behavioral Patterns<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#Structural_Patterns\">Structural Patterns<\/a>\n\t<\/li>\n\t<li>\n\t\t<a href=\"#References\">References<\/a>\n\t<\/li>\n<\/ol>\n<\/ol>\n<\/div>\n<div class='wptoc-end'>&nbsp;<\/div>\n<span id=\"Creational_Patterns\"><h2>Creational Patterns<\/h2><\/span>\n<span id=\"Singleton\"><h3>Singleton<\/h3><\/span>\n<pre lang=\"csharp\">\r\n\/\/ Declare a singleton instance\r\nprivate static SingletonClass instance;\r\n\/\/ Hide constructor\r\nprotected SingletonClass(){\r\n}\r\n\/\/ Construct singleton instance\r\npublic static SingletonClass Instance(){\r\nif (instance == null){\r\ninstance = new SingletonClass();\r\n}\r\nreturn instance;\r\n}<\/pre>\n<span id=\"Behavioral_Patterns\"><h2>Behavioral Patterns<\/h2><\/span>\n<span id=\"Structural_Patterns\"><h2>Structural Patterns<\/h2><\/span>\n<span id=\"References\"><h2>References<\/h2><\/span>\n<p>* <a href=\"http:\/\/sourcemaking.com\/design_patterns\">http:\/\/sourcemaking.com\/design_patterns<\/a><br \/>\n* <a href=\"http:\/\/www.dofactory.com\/Patterns\/Patterns.aspx#list\">http:\/\/www.dofactory.com\/Patterns\/Patterns.aspx#list<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Creational Patterns Singleton \/\/ Declare a singleton instance private static SingletonClass instance; \/\/ Hide constructor protected SingletonClass(){ } \/\/ Construct singleton instance public static SingletonClass Instance(){ if (instance == null){ instance = new SingletonClass(); } return instance; } Behavioral Patterns &hellip; <a href=\"https:\/\/jianmingli.com\/wp\/?p=31\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[12],"tags":[],"class_list":["post-31","post","type-post","status-publish","format-standard","hentry","category-architecture"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8cRUO-v","_links":{"self":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/31","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=31"}],"version-history":[{"count":3,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/31\/revisions"}],"predecessor-version":[{"id":4538,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=\/wp\/v2\/posts\/31\/revisions\/4538"}],"wp:attachment":[{"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=31"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=31"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jianmingli.com\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=31"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}