Friday, December 12, 2008

Refactoring: Improving the Design of Existing Code

Today, I finished from another invaluable reading. The “Refactoring: Improving the Design of Existing Code” book by Martin Fowler and other contributors.

During and after this reading I felt that I was following the different refactroing types by intuition - seriously! It is really amazing to feel about this as I also experienced this in the previous reading for Design Patterns.

In the end I can say that there are a lot of things the skilled programmer needs to know and as Kent Beck often makes about himself, "I'm not a great programmer; I'm just a good programmer with great habits."

Saturday, August 30, 2008

Another Reading about Design Patterns

Last week I finished reading from another book Foundations of Programming by Karl Seguin.

In these days I am busy with picking and reading good resources to establish a solid foundation to the next level of my career path:). I am not digging into theory too much! The authors of the aforementioned book and the previous one are not just explaining ideas and concepts; it's about a consolidation of practical experiences from different people got involved in consulting and implementing software solutions for real life scenarios.

You can download a free copy of the book, click here.

Saturday, August 23, 2008

Design Patterns by GoF

Last week I finished from reading the Design Patterns: Elements of Reusable Object-Oriented Software book for GoF.

This book is the most solid book I ever read about design patterns. You will improve your design skills and discover that you are using patterns by nature :)

Saturday, July 19, 2008

WCF with SSL

As we are more close to the production date, and as usual security delayed till production rollout! We tried to simulate the production environment security for our solution.

We will have multiple sites that can be accessed from the internet or intranet and communicate with a backend web services built using the WCF technology. Now, we want to secure this dialog between the clients and the service. As most of us know there are a lot of options and scenarios when interacting with a WCF service. So, we opt out to use the WSHttpBinding binding, TransportWithMessageCredential security mode, with username/password to authenticate the client’s identity on the service, and an SSL certificate installed on the IIS hosting the service.

After initial setup of the environment we got the following exception:

System.ServiceModel.Security.SecurityNegotiationException: Could not establish trust relationship for the SSL/TLS secure channel with authority 'dev-srv-03'. ---> System.Net.WebException: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. ---> System.Security.Authentication.AuthenticationException: The remote certificate is invalid according to the validation procedure.

You can solve this by using the following code snippets:



This is actually may happen due to the use of a certificate that is trial or not self-signed – you can have some clues from the value of the error parameter provided for the server certificate validation callback. On production environment you should remove the above callback code, given that you will use a valid SSL certificate issued from a trusted CA.

Wednesday, July 2, 2008

Sys.InvalidOperationException: ScriptLoader.loadScripts cannot be called while the ScriptLoader is already loading scripts

If you are using ASP.NET AJAX extensively, it is inevitable to have the JavaScript error: ScriptLoader.loadScripts cannot be called while the ScriptLoader is already loading scripts. We got this error for some pages that have grid and you sort quickly the result displayed.

One of the workarounds for this is to put the below code in your ASPX page:








For more information you can check below link:
http://www.codeplex.com/AtlasControlToolkit/WorkItem/View.aspx?WorkItemId=14712

Monday, June 16, 2008

Global Services in WCSF

I have been using the different software factories released from the P&P team for around 2 years. Even we used the old versions for the VS 2005 to be run under VS 2008 till now!

As we decided to embrace the software factories in implementing our projects, we are using the WCSF for one of the currently running projects.

One of the design goals for the WCSF is to allow cooperating modules to contribute and use shared infrastructure components. So, we had many common infrastructure services like navigation and session store components added to the services root container.

Last week we ran in a situation where our QAs reported a bug related to session data overlapping between different users! Some developers started to blame the underlying session module in the ASP.NET :). After we did some investigation, it appeared that our session store service had private variables that cache the data retrieved from the session (to minimize the casting for the stored objects) and those variables are shared across all the requests. Why? These global services are singletons. So, from design and implementation point of view, avoid sharing a state in those services (i.e. do not declare member variables).

Saturday, May 17, 2008

VS 2008 and TFS 2005 Issue

During our development for a project from December 2007 using VS 2008 / Team Explorer 2008 and the TFS 2005, we faced a major issue with the check in / out for any new project to / from the solution.


We had been struggling with this situation, we consumed too much of hours in iteration 1 of the project regarding TFS source control problems! Sometimes 6 developers got pending on issues like that. Although we followed the recommended practices for structuring the solutions on the client and server sides, we were still struggling!


As a workaround for this, when adding a new project to the solution, we let the developers check in all of their pending changes, then add the project, then let the team get latest from the team project from Team Explorer Source Control and this worked.


For more info check this: https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=322539

Saturday, May 10, 2008

Keep Tuned!

Blogging is inevitable! I consider it as a mean for relaxation and exposing what you think about, and to convey a message for others.

I am keen on posting some stuff. I will dedicate this mainly for technicalities :)

So, keep tuned!