GoConqr has a new look! Let us know what you think.

Mind map

2.1 Create Types

Darren Olivier C# Microsoft English

Map content

2.1 Create Types

  1. 3 categories

    • Value Type
      • Contain value directly
      • Criteria -
      • Inheritance
        • Must use STRUCTS (cannot Inherit directly)
          • STRUCT eg => public struct Point { definition of Struct}
    • Reference Type
      • Reference specific value (e.g. URL)
    • Pointer Type
    • Generics R Good (unlike medication)
  2. Extensions and Overrides

    • Extensions
      • Called like a regular method
      • e.g. Method (this ExtMethod methodname)
      • BEst use case - LINQ
    • Overrides
    • If sealed = no extension/override
  3. Classes

    • Functions vs Methods
      • Functions - RETURN VALUE
      • Methods - Just do work. C# Preferred
      • Preferred - Split into Smaller Methods
    • SOLID Design Principles
      • S = Single Responsibility
        • Class should only be responsible for ONE THING
      • O = Open/Closed
        • Open for Extension, but Closed for Modification
      • L = Liskov Substitution
      • I =Interface Segregation
      • D = Dependency Inversion
  4. Generics

    • Parameter = Type (NOT SPECIFIC
    • Allows Nullables (usaally a coding nightmare - value types e.g. bool)
    • Constraints
      • Where T : Struct
        • Only Nullable nots allowed
      • Where T : Class
        • REFERENCE ONLY
      • where T : new
        • Must have default constructor
      • Where T : <base class> (i.e. T: <string>
        • T must be a string or derive from a string
      • Where T : <interface>
        • T must be interface or implement it

Information

Description
Microsoft C# Mind Map on 2.1 Create Types, created by Darren Olivier on 25/09/2018.
Created by
Darren Olivier
Views
1
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?