Successfully reported this slideshow.

Day3

297 views

Published on

Published in: Education, Technology
  • Be the first to comment

  • Be the first to like this

Day3

  1. 1. CSE 136 Lecture 3 Part 1 Introduction to C# language Memory Management Static vs non-static Properties Inheritance Modifiers (public, private, protected, etc) Namespace and Assembly (dll, exe)
  2. 2. Overview
  3. 3. C# Simple Program
  4. 4. C# keywords Similar to Java
  5. 5. C# Pre-defined types
  6. 6. C# type values range
  7. 7. Stack Memory
  8. 8. Heap Memory
  9. 9. Value Type vs Reference Type
  10. 10. Value Types on Stack
  11. 11. Class Type
  12. 12. Class Type and Heap
  13. 13. Boxing
  14. 14. Unboxing Why box/unbox? Pass variables to method as reference
  15. 15. Value Parameter
  16. 16. Reference Parameter box/unbox concept
  17. 17. Out Parameter
  18. 18. Static Field
  19. 19. Static Function Members
  20. 20. Const field vs Static field
  21. 21. Properties
  22. 22. Constructor Same method name Different param types
  23. 23. Static Constructor
  24. 24. Destructor
  25. 25. Inheritance - Concept Object re-use
  26. 26. Inheritance - Casting
  27. 27. Inheritance - virtual & override
  28. 28. Inheritance - Class Object
  29. 29. Constructor and inheritance
  30. 30. Modifier Provide code security Assembly: Dll, Exe (Output of VS project)
  31. 31. Modifier and inheritance
  32. 32. Assembly and namespace Namespace is a collection of names wherein each name is unique  ex: names CSE136.students  ex: names CSE136.notes Assembly is an output unit (dll, exe).  An assembly can contain multiple namespaces  ex: CSE136.dll
  33. 33. Review question How many bits is type int Does stack store type struct Where is type class data stored (stack or heap)? Where is static class data stored? Is string a value type? Difference between ref and out? Difference between static and const? Difference between public and protected? Difference between override and overload?
  34. 34. Break
  35. 35. CSE 136 - Lecture 3 Part 2 Abstract Class Interfaces Generics Collections Enumeration
  36. 36. Abstract Class
  37. 37. Sealed The opposite of abstract class Instantiated as a stand-alone class Cannot derive from a sealed class
  38. 38. Interface 1 Similar to abstract class without the method implementation
  39. 39. Interface 2
  40. 40. Interface 3 - Polymorphism Multiple forms (Method overriding)
  41. 41. Interface 4 - Polymorphism Animal takes on multiple forms ILiveBirth takes on multiple forms
  42. 42. Generics 1
  43. 43. Generics 2
  44. 44. Generic 3
  45. 45. Generic 4Creating Variables and Instances Using a constructed type to create a reference and an instance
  46. 46. Generic 5Two constructed classes created from a generic class
  47. 47. Generic 6
  48. 48. Collections 1Using List to store string data
  49. 49. Collections 2 List can also be used as a list of int
  50. 50. Collections 3 Using Stack of string
  51. 51. DictionaryCollections 4 - Another generic collection type
  52. 52. Enumeration 1 Iterator Pattern (Design Pattern)
  53. 53. Enumeration 2 - IEnumerator interface
  54. 54. Enumeration 3 - interface
  55. 55. Review question Difference between abstract class and interface? Difference between inheritance and polymorphism? What is type safe? Is generic type safe? Difference between enumerable and enumerator?
  56. 56. Your assignment Finish your DB design and stored procedures based on your UML diagram Demo to TA by Thursday end of class (25% late penalty will apply for late turn-ins)
  57. 57. References .NET : Architecting Applications for the Enterprise C# Illustrated

×