Archive for May, 2010

Leverage the Power of ASP.NET and Silverlight Platforms with WCF RIA Services

Wednesday, May 12th, 2010

It has always been difficult if not impossible to develop N-Tier applications. Though there were few applications framework some commercial and other few open source which helped the developers in building the apps based on the N Tier architecture and SOA principles. But the tables are now turning around; Microsoft has added one more jewel in their crown called WCF Ria Services, formerly known as .NET Ria services. I have been using this framework right from its raw bits and it is now in its RC2 stage. I must admit that that features have exponentially grown with every new release. It is now complete end to end application framework to build N-tier apps.

As the name suggests the framework in based on Core WCF (Windows Communication Foundation), which is a great enabler of SOA.As a developer using WCF Ria Services Framework you don’t have to worry about nities and grities of WCF. All that plumbing code is readily available to you from out of the box. But I recommend that knowledge of WCF can help you to troubleshoot your app develop on this framework. The framework uses the DomainService pattern, which is highly scalable pattern. It means that the framework can be glued to any UI Technologies, be it Silverlight, Ajax or Asp.net.The diagram below gives more clear idea.

WCFRiaClients

Gateway’s Customer Advantage

  1. You get your app developed in the latest technology with UI as Silverlight and all Domain Operations based on the WCF Ria Services. Asp.net Web Forms are now a decade old technology.
  2. Your application gets developed in true N-tier sense where the separation of concerns is also taking into the consideration by following MVVM pattern. This pattern is a great booster in Unit Testing.
  3. Your core business logic is given utmost priority because the developer is free from the plumbing logic code of various tiers as the framework is tightly integrated with Microsoft DAL Technologies like Linq and Entity Framework.
  4. Your offshore team can get started right away as Visual Studio 2010 provides the complete application template to develop the application based on this framework. So you save that precious hours ($) as developer does not have to assemble different projects and assemblies.
  5. Last but not least our technical expertise in this application framework.

Should you have any questions or feedback, feel free to post a comment and I’d be happy to discuss about that.

3 Little Known (Yet Very Effective) SQL Performance Optimization Tips

Monday, May 10th, 2010

As a software engineer, most of us know how to write SQL Queries, but many of us DO NOT know how to write an optimized SQL query. Query optimization is a kind of ignored subject. In majority of the cases the developers don’t take into consideration if they are writing an optimized query or not, they just write them.

Writing an optimized query does not always require special skills or techniques but a few of the basic things. Some of you might be surprised if I say that using specific names of the columns instead of * makes your query work faster. Let’s take few examples:

Tip 1: Use of Select *

There could be times when you need to work on only two columns from a table, but you may query all the columns by specifying SELECT *. This is done just because this is easy to do. The basic idea here is to limit the data to be returned by the database query.

For example when you need only name and salary columns from the database table,

SELECT * FROM employees WHERE deptno=10

would be less efficient than

SELECT name, salary FROM employees WHERE deptno=10

Tip 2: Use of Having clause

A common mistake would be something like below:

SELECT deptno, count(deptno) FROM employees GROUP BY deptno HAVING deptno !=10 AND deptno != 20

In the above query first we are grouping all the deptno’s and the applying the having filter. The correct way of writing this would be to first eliminate all the not required deptno and then do the grouping – as done correctly in the below query:

SELECT deptno, count(deptno) FROM employees WHERE deptno !=10 AND deptno !=20 GROUP BY deptno

Tip 3: Use of UNION ALL

Use UNION ALL instead of UNION. UNION checks for the duplicate rows and then eliminates them which make it slower as compared to UNION ALL. This is another very common mistake. In most of cases when we are making UNION of two or more statements we just use UNION irrespective of the fact we require it or not.

As a software engineer, your main focus should be to serve your client. And just by optimizing performance of even a minor query, you are serving your client better. And that’s what matters.

Unleash the Power of MVVM with Silverlight

Saturday, May 8th, 2010

Businesses always dream of data centric applications which are easier to maintain, robust and flexible enough to accept the future changes. Silverlight being a part of .Net framework has all of these ingredients well thought of. Apart from such basic features, it provides rich user interface with minimum efforts.  Though Silverlight is relatively new technology, it has a little learning curve for seasoned Microsoft developers. Silverlight also provides cross-browser and cross-platform support which is very important for targeting larger client base with diverse needs.

Three Important Benefits of MVVM

The goal of any system/application is to automate the business process and help people achieve utmost efficiency. Following are some key points which may compel us to use MVVM (Model-View-ViewModel) pattern:

  1. Eradicate tight coupling: Every system has N layer defined or undefined. When these layers are tightly coupled with one another i.e. every layer knows how the other layer is accomplishing its job, the system becomes unmanageable and least flexible. Change in any one layer requires changes in all the layers and thus creating chaos.  MVVM decouples all the layers and helps us achieve robustness and flexibility which in turn makes the system absolutely manageable.
  2. Separation of responsibility: MVVM helps in a great way to separate the responsibilities in the development process. Multiple Software Engineers work on a system/application at a time during its development process. To make this process easier, separation of responsibility is very important. This can be very well achieved using MVVM for example, a designer and developer can work simultaneously and with least dependency on Silverlight application if we implement MVVM design pattern. As View on which designer has to work and ViewModel and Model are totally separate contexts on which Engineers work.
  3. Testability: Unit testing is very important part of development process especially during initial development and maintenance. MVVM creates loosely coupled system components which can be unit tested separately without any hassle.

How Silverlight Married with MVVM can Produce Great Results?

To get the best result out of a technology and a design pattern, it is very important that both of them are compatible with each other. If not then it would be more of an overhead on the system. Following of Silverlight features make it a best mach for MVVM design pattern:

  • Databinding: Silverlight provides robust infrastructure for binding the data which helps in binding View with ViewModel in such a way that both of them are unaware of each other’s functioning.
  • Datatemplates: Datatemplate is the actual template where ViewModel gets bound and this data template also defines how data will be shown to user. This helps in separating responsibilities of designer and developer.
  • Commands: Commands are the actions that need to be performed. It is set of activity that gets performed.  As we know ViewModel also has the state and behavior of the Model.  When Command is bound to a ViewModel, it performs certain actions on user interaction. For example in a customer registration “Add customer” is an action for which we can create a command which executes on button click or context menu click.

Thus, Silverlight used with MVVM gives the business an edge over other technologies. Though Silverlight is still a young technology, Microsoft has been giving great support and has a very promising plan for its future versions. Considering these factors, it would be in the interest of any software solution provider who would like to cater its client base with Silverlight married with MVVM and we are not an exception :)

How a Dedicated Developer Hired in India Can Help You Grow Your Business

Wednesday, May 5th, 2010

As an IT Services Provider or a Software Product Development Company, when you consider outsourcing, Offshore-software-outsourcing is one of the most effective ways to grow your business.

It is at it best when done repeatedly and that’s where full time dedicated time and material engagement model works well. In this model, you hire a dedicated developer from an outsourcing service provider company and make the best use of his or her capabilities in your projects.

Here’s how such a dedicated developer can help you take your business to the next level.

  1. Saves dollars: You do not need to invest in hiring, training and maintaining talents at your end. You can obtain them for a reasonably low cost in the countries like India. This would allow you to invest your saved dollars from outsourcing in making your customer experience better.
  2. You get up-to-date skills: You can select right developer from the pool of available developers. Most offshore software provider companies invest good chunk of their earnings in training and retaining outstanding software engineering talents and that’s where an opportunity rests for you to use latest technologies and standards for your next software project.
  3. No hardware, software or office infrastructure cost: You just pay for the hours spent by the developer and that’s it. As a part of providing better services and taking their business to the next heights, outsourcing providers invests heavily in good hardware, software and infrastructures.
  4. Complete intellectual property protection: Key success factor of offshore service provider’s business is continuous engagement. Hence, they are interested in continuously serving you well. The most common provision in the Dedicated Developer Contracts is that you reserve intellectual property rights.
  5. Assures good quality work: The team of dedicated developers coupled with a Quality Assurance person works best for the business. QA professionals play the role of devil’s advocate and work directly with you and make sure that the project meets its quality expectations.

There are many other pros and cons when you outsource your next software project. However, most of the cons can be handled by good communication and continuous engagements and this is what you should look at while outsourcing your next project.