Browse by Tags
All Tags »
C# 3.0 »
DEV (
RSS)
One of the ‘best-practice’ and code styling guidelines say that you need to use constants instead of literals for more readability and ease of maintenance. Among the usages there are time that you want to specify database field names, xml attribute / element names and etc. In such cases the code easily get messed with dozens of constants around the code and make it harder to find the constant you need. A little trick can aid here: Instead of: 1: class TheClassUsingTheConstants 2: { 3: public const...
Today I read the Ran Wahle ’s "Session manager" that was (kind of) response to Shlomo Goldberg ’s post about a way to use the session state in type-safe way. Because I tried out both approaches but was only satisfied with another (slightly sharper approach to Ran’s) and I will be glad to share it too (as in all other fields, pick the best that works for you project in hand). After several projects I have got to conclusion that there is no need for more than one object graph in the session...
This argument exists since the first version of WPF (Windows Presentation Framework), so what should one select, WPF or Windows Forms? I will start with my conclusion / disclaimer: Any new windows client should use WPF! Now, for the explanation: The biggest "flaw" of WPF is its learning curve, it is slightly hard to understand the "rhythmic" of it. Thus, many companies / developers prefer the comfort zone of windows forms as it seems more easy and "fast" to develop....
I wanted to start a short tips series for improving code and application quality, each post will be 1 to few sentences with a tip. First tip: Say “Defects”, not “Bugs” For me, the word “bug” sounds as “something not so important that is in the nature of the application”, which at least it isn’t true! when the application doesn’t do what it should (or do it wrong, or crash etc) it is a Defect in our application. It is hard because we are so naturally says it, but we should start to change our terminology...
During development of WPF application using M-V-VM design pattern (by Josh Smith on MSDN Mag.) I came across a problem of refactoring the view model classes, especially the properties’ names. The view model classes are implementing the INotifyPropertyChanged interface by inheriting from a helper NotifyPropertyChanged base class which have a method to raise the property changed event called ‘SendPropertyChanged’. That method gets “propertyName” parameter which is a string, and this was the problem...