Friday, July 1, 2011

Pair Programming

Recently I had to work with my colleague on some software development tasks. What I learned from the pair-programming is to identify the areas of my weaknesses and the things where I had to stress harder to overcome my shortcomings. Not every developer is perfect, so it's a good idea to share your code with other developer, review others code, work on some task as a pair for sometime. Some developers are good in architecting applications, some are good in designing the front-end, some are good in databases, some are good in optimizing applications and so on. Pair programming can give you a chance to learn from others, to fill their gaps by your skills, and keep you going on the track. It can give options to brainstorm on certain areas while you do pair-programming. You can try and see you can benefit from pair-programming or not. I am sure you will.

Wednesday, May 25, 2011

Custom Properties of SharePoint2010 WebPart

Today I was searching for designing enhanced custom property of SharePoint2010 web parts and found a very good blog with the detailed and step by step procedure. Here is the link for that blog written by Jourdan Laik:
http://blog.concurrency.com/sharepoint/create-a-custom-web-part-for-sharepoint-2010/

Tuesday, May 24, 2011

Brief Introduction to SharePoint 2010 Development in Visual Studio 2010

Visual Studio 2010 is rich in SharePoint 2010 development. To work with SharePoint 2010 on your development machine, you can download and install SharePoint 2010 Foundation prior to test the SharePoint controls development in Visual Studio 2010. After you have successfully installed the SharePoint Foundation, you can fire up the Visual Studio, create a SharePoint 2010 empty project. The next step you can try is adding a Visual Web Part. There are number of other objects you can create for SharePoint 2010.

After you add the Visual Web Part, you can draw your controls on the design surface, build it and deploy to the SharePoint site. CreateChildControls is the method which gets executed while the web part is being show on the host page.

protected override void CreateChildControls()
{
            Control control = Page.LoadControl(_ascxPath);
            Controls.Add(control);
 }

Hope, this very brief introduction to SharePoint development in Visual Studio 2010 is helpful for the fresh SharePoint developers.

Saturday, March 19, 2011

How to Avoid Deployment Chaos


I have seen several time when the changes on a custom software works perfect while we run on a development box but when it comes to the deployment stage, it does not behave the way it should be. The better solution to overcome such issues is that we should deploy the changes to the similar environment as of the live one. If the application is hosted on a web server and utilizes the database, we should have the same configuration and same database (ideally with the same data and files) on the QA box.
So, start with configuring the web application and copy the application files from the live box to the QA box. Then restore the live database on to the QA box. Verify if the current application is running fine the same way it is running on the live site.
Now, start deploying the database changes and verify if the changes are OK. After that, deploy the web application changes to the QA box and verify if the changes are deployed successfully or not.
Now, test every change on the deployed version and fix if there are some issues. Once every fix is in place, and the new changes are working fine, deploy that on UAT box. Now, let user play with the changes untill they are satisfied with the new release. Once they are happy, deploy that release straight onto the live box. That's it!
I hope this process will minimize the deployment chaos unless you bypass the QA and UAT phase.

Friday, March 11, 2011

Software Quality Assurance

Quality is a key factor of every successful software. But the question is, how can we measure the quality. There are multiple factors involved in the software QA. For instance, the software should be error-free, easy-to-use, adaptable, scalable and the list goes on. I would like to write about few things by which we can make our software error-free.
If the software is fully tested and following the standard test procedures, we can minimize the chances of errors in software. There are different Testing tools out there. Now in visual studio, you can create test projects, define the unit tests and execute them to verify if the functions are running without errors and returning expected results or not. The benefit of such unit tests saves a lot of time during regression testing.
Once the unit tests are passed, you can start integration tests. In fact, the software should be tested by the developers first. Then comes the QA phase where QA specialists can operate the software and perform different operational tests. The last step is UAT where the actual end-user performs the tests.
User Acceptance Test (UAT) is highly important before the software version goes into release state. Once, users are happy with the software, you can release the software into live state.
In case of websites or web applications, all the browsers should be considered while testing the site or thin-client applications. It's also important to do stress testing of the websites. Some sites or applications work fine when they are being tested by 10 or 20 users. But when the requests cross huge number of requests, the performance of website drops radically which may introduce the customers frustration.
In a nut-shell, QA should be considered as an important phase of software development and should not be overlooked at all.

Visual Studio 2010 SP1 is Available Now

Visual Studio 2010 SP1 is available now. You can download from the following URL:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=75568aa6-8107-475d-948a-ef22627e57a5&displaylang=en

Saturday, January 22, 2011

How Important the Software Architecture Is

There is a famous saying that if the base is strong the whole building is strong. The same concept applies to the software too. In my opinion, the architecture of the software is the most important building block. Architecture should be designed before the actual coding begins. The software architect should decide which pattern they should follow to build the software. There are many patterns out there we can adopt to follow in the software construction. But we should be careful that the application is not over-engineered. This can happen that you try to apply some pattern, as soon as you know about it, but that is not suitable for the subject problem. So, you should be very careful while selecting a particular pattern in your software architecture.

You should divide the whole problem into different layers. Each layer should be self contained and should the ability to communicate with other layers in order. That does not mean that the every layer should capable of communicating with non-adjacent layer. For instance, the presentation layer should not directly communicate with the data access layer. It should talk to the database layer via the business layer, in 3-tier architecture.

If the application blocks are tightly coupled, we may face some difficulty while doing unit tests. The loosely coupled classes have a major advantage over tighly coupled when the testing comes into action. The Dependency Injection is a good pattern to decouple the dependent classes. This way, your software will be maintainable and scalable and you will definitely realize after sometime.

Saturday, January 15, 2011

Selenium - Software Testing Framework

Selenium is a software testing framework primarily built for testing the web applications. It records and can create the tests for you in few clicks.

Check details here http://seleniumhq.org/

Interactive JavaScript Reference

I found this reference a very useful resource.

http://superexpert.com/JavaScriptReference/

jQuery 1.5 Beta Relased

The beta version of jQuery 1.5 has been released.

You can get details here http://blog.jquery.com/2011/01/14/jquery-1-5-beta-1-released/

Should We Refactor Old Code

Technology is growing so fast that if we do not keep us upgraded, we may stand far behind in the techno race. Every developer will agree with this that he can code a better solution whenever he looks back at his code after few months. Someone may disagree by saying that why should he touch the stable code. Let me explain this with an example.
Suppose, you have coded the following script in your SQL Server stored procedure.
DECLARE @unitPrice int
DECLARE @qty int
DECLARE @total int
DECLARE @grandTotal int

SET @grandTotal = 0

DECLARE cursorTxn CURSOR FOR
SELECT unitPrice, qty
FROM Transactions

OPEN cursorTxn
FETCH NEXT FROM cursorTxn INTO @unitPrice, @qty

WHILE @@FETCH_STATUS = 0
BEGIN
       SET @total = (@unitPrice * @qty)
       SET @grandTotal = @grandTotal + @total

       FETCH NEXT FROM cursorTxn INTO @unitPrice, @qty
END

CLOSE cursorTxn
DEALLOCATE cursorTxn

This snippet works fine, calculates the correct grand total of all the transactions and return the result to the caller. One can say that it is a stable procedure and does the job well. However, if he checks his code after few months and he has already polished his skillsets, he may call this piece of code a crap. He can easily upgrade this piece of code by using the following alternative.
DECLARE @grandTotal int

SELECT @grandTotal = SUM(unitPrice * qty)
FROM Transactions

The above code will return the same result but in a much optimized way.

So, instead of rewriting your code, do refactor your code.

Thursday, January 13, 2011

Issues with Disqus Commenting System

Disqus is a commenting system which is being used by different sites. The usage of this system is very very easy. You just need to create a site/forum thru their Admin panel, specify the website URL where you need to use the Disqus system. You can put a universal code which simply declares a couple of Javascript variables and creates and adds a javascript file reference to the DOM - head tag. I tried but faced a couple of issues:

1. The Facebook Connect login does not work properly. Although it gets you authenticated to the Facebook but somehow the Disqus page does not consider you as a logged on user.
2. The Twitter login does not work as expected, especially on IE 8.

The reason could be some deprecated APIs still being used by the Disqus. I hope the Disqus team would be able to fix these critical issues as soon as possible so we can make the Disqus commenting system on our website.

For further readings, visit disqus.com

MVC Pattern

MVC stands for Model-View-Controller. MVC is very famous software architecture which splits the whole software structure into three main domains, i.e. Model, View, & Controller. Model is related to the data model, View is basically the UI to interact with model and Controller is the supervisor which bridges the gap between Model and View. Model can be as simple as a POCO. View can be a simple HTML with placeholders to plug the data from model. Controller can receive the user's request and call proper mechanism to send the view with the model data.
In the current version of MVC3, we have a couple of view engines which are ASPX view engine and the Razor view engine. One of the major benefits to use MVC is test driven development. You can create mocks to test different areas of the whole solution.

For further details, you can visit www.asp.net/mvc

Holy Quran (Flash version)

This Flash based Quran looks awesome. Have a look on this URL http://www.quranflash.com/en/quranflash.html.

The user experience is really great.