Showing posts with label Development. Show all posts
Showing posts with label Development. Show all posts

Saturday, May 04, 2013

Analayze your code with Ndepend

Ndepend is a static code analyzer  for .NET projects. It performs analysis of the project codebase;  and provides metrics, graphs and reports ; all of which helps a developer to enhance the code quality. I would like to  thank Patrick , for developing it, and also for providing a licence to me.

Post code analysis, Ndepend provides several tools to better your code . 

1) Dependency Graph - As the name implies, the graph  displays the caller and the callee in the project. This is important as it provides a birds eye view , when the code base is large.

2) Queries and Rules explorer - This is an amazing tool , which displays areas where the code needs improvement. The explorer addresses several sections - architecture, design considerations, dead code etc . I am providing a snapshot below :-



Once a rule is selected ; the query and rules editor automatically creates a CQLinq syntax , executes the query and displays the result. Alliteratively , the developer can also write a query ( for those not covered by Ndepend ) and get respective results.

3) Metrics - The Metrics window displays the usage and relevance of the code being analyzed.  The developer can use the metrics, to view where are the methods being called directly or indirectly. Besides methods, developers can also view metrics of namespaces , fields  ; which come in very handy to understand calling sequences and workflow in large projects.

4) Dependency Matrix - The dependency matrix is a visual representation of the methods being used, and the methods using them . I am posting a screenshot below .



The following is the representation of the green and blue colour .

The Matrix Cell is Green because the method (in column) is used by the method (in row). 

The Matrix Cell is Blue because the method (in column) is using the method (in row). 

More features can be found here.  Overall I find it a great tool ; I shall update this post once I come across new features.

Wednesday, December 23, 2009

Develop Office Addins in a breeze – Part 1

Five years back I was working on a product, which included Word automation. The task was simple ; let the user create a new Word document from within the product . The product was being developed in Visual C++ 6.0 and there was no VSTO . The key idea behind this feature was Office integration .  I had done this using Word automation and COM plumbing with the Word Object Model.
If you are new to Offiice Development ;  and interested in getting a quick overview, I would recommend VSTO 3.0 for Office 2007 Programming. On the other hand if you want to get more deep ,  I would recommend Visual Studio Tools for Office 2007: VSTO for Excel, Word, and Outlook .
Why Office Add - Ins
Things have changed in the last 5 years. Visual C++ 6 has been replaced by the Visual Studio suite, Windows Programming has become much easier, .NET has evolved,  global economy has gone north and new innovative and useful products have made development easier.
Maybe if I was developing the same product today, the concept might have been different . My boss would have probably told me , “Hey , why not develop a product specific menu  in the Word application itself, so the user can directly talk to our app while using Word”. This approach makes much sense, as it not only addresses our need, but also makes the user feel more comfortable ( he doesn't have to start our application to access  the  specific features )
So I would have landed developing a Word Add-in , maybe using Visual Studio Professional Edition ( Extensibility –> Shared Add In Project )  or Visual Studio for Office ( haven’t used it ever ) .