Deciding which type you should use

Choosing the wrong type of object to use in your application can have bad implications for your app on several levels. For instance, your app could suffer from unwanted side-effects when a reference type is modified in some unexpected place. Or you could end up with a lot of duplicated logic if you use a struct instead of a class in certain places. Your app could even suffer in terms of performance when you choose a slow reference type where a value type would have been a better choice. You should always evaluate what type of object is best-suited for your current use case to make sure your code strikes a balanced trade-off between maintainability and performance.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset