aprile 2008 Blog Posts


Disabling Session State

If you don't use session state, you can improve performance of your web application by disabling session state. If you want to disable the sessions for the whole application, you need to set the web.config in the following way:   <configuration>       <system.web>       <sessionState mode="Off" /> If you want you can disable the sessions state in a specific page: <%@ Page Language="C#" AutoEventWireup="true" EnableSessionState="False" %> Tags: ASP.NET

The Patterns Panacea and Under-Engineering

We have a Patterns Panacea effect when we forget the first rule of XP methodology: simplicity  and we want to use a pattern in any case. We need to relax our mind and choose the easiest way, it will be the better way. If in the future we need to change it in order to remove some duplicates or some overload we will refactor it.   The Under-Engineering is far more common than Over-Engineering. When we produce poorly designed software we under-engineer. The big problem of under-engineering is maintaining the software we have producted....

Over-Engineer

I was reading the book of Martin Fowler: Refactoring to Patterns. Just on the first five pages of this book there are so many information to think about. One of these is the Over-engineering terminology. The Over-engineering word means: When you make your code more flexible or sophisticated than it needs to be, you Over-Engineer it. Some programmers do this because they believe they know their system's future requirements. If your predictions are wrong, you waste precious time and money. What typically happens with code you produce in anticipation of needs that never...

Increase ASP.NET ViewState data security

To increment the security of the ASP.NET ViewState data you must enable the encryption of the data. To do that, you can choose between two option: 1 - By the web.config file:   <configuration>       <system.web>       <pages viewStateEncryptionMode="Always" /> Through this option you will enable the encryption of the ViewState data for all the application pages. 2 -  By the page: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" ViewStateEncryptionMode="Always" %> Make attention on the ViewStateEncryptionMode. In this case you enable the encryption...