NDepend the massive code analysis tool for every developer

by mosessaur| 22 November 2008| 5 Comments

Before I start on this, I am sure I am not going to full fill all what I want to express about NDepend. NDepend takes your to the deep dark corners of your code and lights up those bright corners in it. Thanks to Patrick Smacchia and all this product development team for such great tool.

What is NDepend?

I don't think I can explain better than what is written in its web site:

"NDepend is a tool that simplifies managing a complex .NET code base. Architects and developers can analyze code structure, specify design rules, plan massive refactoring, do effective code reviews and master evolution by comparing different versions of the code.
The result is better communication, improved quality, easier maintenance and faster development."

So it is a massive code analysis tool, analyse every aspect of your code and produces informative reports with detailed matrices, diagrams and charts that should help you improve your code.

NDepend also generate and HTML report with all code analysis made alone with matrices and attached diagrams, figures and charts. One good thing I loved about this report, is when I found a term that I don't understand there is a link that takes me directly to online help where this term is defined. This helped me a lot, because some terms I am not familiar with, maybe my English or I am bad Engineer :o), either reason, it helped me and sure would improve any of those 2 defects in me :o).

Not only NDepend gives you these reports about your analysed code, but also it allows your edit constraints on and queries that produce these reports.

More...

Tips & Tricks when working with jQuery and ASP.NET AJAX

by mosessaur| 17 November 2008| 8 Comments

I posted about how to build and extender control using ASP.NET AJAX with jQuery. During my work I fall into few issues that I resolved and wished to share them with you.

These issues are related to callback functions in jQuery. For example when calling slideUp(speed, callback) or slideDown(speed, callback). Same thing when calling each(callback) function except that the callback in each(callback) function takes 2 arguments while those in Effects functions take no arguments by default -refer to jQuery documentation for more details-.

What are the issue exactly?

In all callback function in jQuery, "this" keyword will reference the DOM Element. For example in slideUp or slideDown functions if you specified a callback like this:

//Collapsed is your callback function
$('#elementId').slideDown(Collapsed);

Your callback function Collapsed should look like this:
function Collapsed() {
  //"this" refers to dom element
}

Now if you used "this" keyword in the callback function context it will reference the DOM Element which you are sliding down or up or making any kind of effects on it.

More...

PagedList Sorted Edition

by mosessaur| 04 November 2008| 13 Comments

Me and Amr Elsehemy are working together in something and he requested a feature in some APIs I built. In fact he liked the Rob Conery's PagedList that had been modified by Troy Goode. He used it on his jBlogMVC post series about building Blog Engine using MVC.

That was pretty simple and I noticed something missing on the PagedList that I wished to add! What about sorting. I mean build a PagedList that is sorted. So I made slight changes to the enhanced PagedList made by Troy to support sorting.

Prerequisites:

It is required that you refer to Rob Conery's PagedList and the modified version by Troy Goode before you proceed in order to understand how this PagedList is useful and helpful with MVC and LINQ to SQL as well as LINQ to Entities.

Summary of changes:

To summarize the changes I made, simply I used Lambda Expressions to enable sorting. And had to modify Class declaration (with constructors) and the Initialize method. Sorting is provided by OrderBy extension method. Please return to method documentation for more details.

More...