9 properties & indexers

1,605 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,605
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
42
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

9 properties & indexers

  1. 1. Properties and Indexers Programming in C# tnngo2@gmail.com
  2. 2. Properties
  3. 3. Properties ( smart fields) ensure accuracy and validity of values of fields. Use of properties Modifies private values Validates private values Performs required actions Implements abstraction and encapsulation.
  4. 4. Get & Set accessors https://gist.github.com/2391947
  5. 5. Types of Properties
  6. 6. Difference between Properties and Fields
  7. 7. Difference between Properties and Methods
  8. 8. Real world use cases of properties Lazy Initialization http://www.codeproject.com/Articles/275932/Lazy-Loading-in-Csharp Dirty Tracking http://stackoverflow.com/questions/33469/caching-patterns-in-asp-net
  9. 9. Indexers
  10. 10. Indexers are data members that allow access data within objects in a way similar to accessing arrays. fast access to the data within an object as they help in indexing the data called smart arrays
  11. 11. Implementation https://gist.github.com/2398898
  12. 12. Difference between Properties and Indexers

×