DNK has a spanking new server up and running like clockwork. Stability problems are a thing of the past. Our new monitoring service reports 100% uptime since the move!
16
kicks
published 1 year, 9 months ago, submitted by lowendahl 1 year, 9 months ago

lowendahl.net — With C# 3.0 MS realeases Automatic Properties as a simplified encapsulation that generates getters and setters for a similary automated backing field. But is this really the way to go? Should you have dumb getters/setters or are you violating YAGNI when doing so? What are the rational behind MS decision to do so. This post address all thoose questions.

Add a comment 1 comment | category: | Views: 17 | Get KickIt image code
Encapsulation and Automatic properties in C# 3.0
tags: , | tag it

new Add a live kick counter to your blog >> liveImage

You can even customize the image by choosing your own colors, and then clicking the button below to update the preview and the html code:

  • "Kick It" text
  • "Kick It" background
  • kick count text
  • kick count background
  • border

Simply copy and paste this HTML into your blog post.


Users who kicked this story:

Comments:
Author can't see the forest through the trees; so caught up in trying to show a "YAGNI violation" that he misses the simple convenience that automatic properties offer. FYI: a "YAGNI violation" is when your customers spec something simple and you create something monstrous which they end up not using anyway...thus, YAGNI. Also, a C# MVP who doesn't understand the binary difference between a field and property--what's up with that? If you even *think* you're going to use the setter and getter eventually, it's a hell of a lot easier to start with a property than to refactor a field into a property later on. Deploy some DLLs to customers and you'll understand what I mean.
posted by jesse 1 year, 9 months ago



information Login or create an account to comment on this story

Related Stories:
 

Search: