Skip to content
Code Carpenter

Code Carpenter

  • Home
  • Contact
  • More

    Author: Minghua Tong

    DESIGN PATTERNS 2 — Memento Pattern

    Memento pattern enables an object to restore to its previous state. It consists of three classes. Originator is the one who has an internal state. It can… Read more “DESIGN PATTERNS 2 — Memento Pattern”

    June 23, 2020June 27, 2020 by Minghua Tong

    Design Patterns 1 — UML Basics

    This will be a serie of articles about Design Patterns. To describe the patterns, we must have some basic knowledge of UML. UML uses ‘+’, ‘-‘ and… Read more “Design Patterns 1 — UML Basics”

    June 22, 2020June 23, 2020 by Minghua Tong

    Collection Initializer

    If you want to use collection initializer to initialize a instance of a collection class, there are two prerequisites: The collection class must implement IEnumerable. The collection… Read more “Collection Initializer”

    April 17, 2020 by Minghua Tong

    IEnumerable and IEnumerator

    foreach is pretty convenient in C#. It requires the iterated collection implemented IEnumerable or IEnumerable<T>. You can see that there’s only one method in this interface which… Read more “IEnumerable and IEnumerator”

    April 16, 2020April 16, 2020 by Minghua Tong

    GC, Finalizer and Disposal

    我花了2天时间,研究了.Net的垃圾处理机制,最终理解了Dispose Patter。好吧,先从一些概念开始。 memory management Processes don’t access physical memory directly, they use virtual space address. Every process has its own, separate virtual address space. By default, on… Read more “GC, Finalizer and Disposal”

    April 5, 2020April 5, 2020 by Minghua Tong

    Generic Variance

    The line 2 of the above code tried to convert IEnumerable<string> to IEnumerable<object>. You can see that the generic type is converted from string to object. This… Read more “Generic Variance”

    March 28, 2020March 30, 2020 by Minghua Tong

    Variable vs Variant

    VariableAn element, feature, or factor that is liable to vary or change. 有able后缀嘛,自然是强调“能变”,所以翻译成变量,即能变的量。“There are too many variables involved to make any meaningful prediction.” VariantA form or version… Read more “Variable vs Variant”

    March 28, 2020 by Minghua Tong

    Parameter VS Argument

    一个困扰了我n年的概念…说出来都让人笑话… Parameter is variable in the declaration of function. It’s formal parameter —— 形参。 Argument is the actual value of this variable that gets passed to function. It’s actual parameter ——… Read more “Parameter VS Argument”

    March 27, 2020 by Minghua Tong

    .Net Assembly and Module

    时不时地在.Net中接触到module这个概念,费解了好久。 先说说Assembly吧,一个dll或者一个exe就是一个assembly。Physically, we can compile related code files into an assembly. Assembly is the minimum unit of deployment.Logically, an assembly can have one or more modules which are… Read more “.Net Assembly and Module”

    March 27, 2020March 27, 2020 by Minghua Tong

    Autofac入门

    “Autofac is an addictive IoC container for .NET. It manages the dependencies between classes so that applications stay easy to change as they grow in size and complexity. This is achieved… Read more “Autofac入门”

    March 19, 2020March 27, 2020 by Minghua Tong

    Posts navigation

    Older posts
    Blog at WordPress.com.
    Code Carpenter
    Blog at WordPress.com.
    • Subscribe Subscribed
      • Code Carpenter
      • Already have a WordPress.com account? Log in now.
      • Code Carpenter
      • Subscribe Subscribed
      • Sign up
      • Log in
      • Report this content
      • View site in Reader
      • Manage subscriptions
      • Collapse this bar
     

    Loading Comments...