Abstract

In today’s software development world; we are solving complex business scenarios and developing large business applications. Hence, proper designing is the major factor which contributes to the scalability and performance of any .NET application.

Efficient Resource Management

Resources are very critical for the existence and survival of any application. Examples of resources include objects, files, connections, handles, streams etc. Hence proper handling and cleanup of such resources is critical for the better performance of system.

Here are points to consider:

  • Should properly handle the object creation and cleanup if needed.
  • In .NET some objects offer a Close() method to do proper handling of resources. Some of those are db connection, Streams etc.
  • .NET provides proper structured blocks which can be used in your code to enforce the cleanup if situation arises. For example, finally blocks or using statements can be used to ensure that resources are closed or released properly and in a timely fashion.

Considerations for Crossings the Application Boundary

Applications live and run in their own territory which is defined by the Machine, Process or Application Domains they are hosted in or deployed on. I.e. if two applications communicate with each other across machine, process r app domain there is significant impact on performance of the application.

  • Cross application domain. Since in .NET a process is optimized to have multiple application domains which can then host application inside those app domains. This is the most efficient boundary to cross because it is within the context of a single process.
  • Cross process. Crossing a process boundary significantly impacts performance. You should do so only when absolutely necessary. For example, you might determine that an Enterprise Services server application is required for security and fault tolerance reasons.
  • Cross machine. Crossing a machine boundary is the most expensive boundary to cross, due to network latency and marshaling overhead. Before introducing a remote server into your design, you need to consider the relative tradeoffs including performance, security, and administration.

Single Large Assemblies or Multiple Smaller Assemblies

In .NET assembly is the unit of deployment; an application comes to an existence in the form of an assembly only. Any application you have built after compilation produces an assembly only. All the .dlls your project refers to are .NET Assemblies only.

When working on designing and architecting a solution it is critical to consider that different functionalities, classes and interfaces etc. should be part of one single chunky assembly or should be divided across multiple smaller assemblies.

Here are points to consider

  • To help reduce your application’s working set (in simple terms set of memory pages required to host the application in the process) , you should prefer single larger assemblies rather than multiple smaller assemblies. If you have several assemblies that are always loaded together, you should combine them and create a single assembly.
  • Reasons to avoid multiple smaller assemblies:
    • Since you have multiple assemblies consider the cost required in loading metadata for multiple smaller assemblies.
    • JIT compile time will be much more as per count of assemblies.
    • Security checks needed for multiple assemblies.

Continue Reading…

Choosing Right Type of WCF Project

September 20th, 2014 | Posted by Vidya Vrat in .NET | C# - (0 Comments)

Abstract
Before you begin coding, it very important to understand what type of output and behavior is expected. These questions can be answered by reviewing your Deployment and Test needs as well. In this article I will talk about guidelines for choosing right type of WCF project templates while creating WCF Service(s).

Introduction
Any application’s life begins with choosing a Project Template. Right type of Project Template has big impact on how your application will shape up, output type etc.

WCF Services Projects are no different than other applications except being biggest player in SOA world.

Different Templates for WCF
Most commonly used type in industry is either WCF Service Library or WCF Service Application, as shown in the image below.

WCFTemplates

 

 

 

 

 

 

 

The difference between two depends on your Test and Deployment needs.

Continue Reading Full Article…

Creating & Consuming a DLL in C#

September 10th, 2014 | Posted by Vidya Vrat in .NET | C# | Video Tutorial - (0 Comments)

1st Actual Computer Bug

September 9th, 2014 | Posted by Vidya Vrat in Technology Awareness - (0 Comments)

1st actual computer bug found, September 9, 1947

In 1947, a team of engineers working on the Mark II Aiken Relay Calculator at Harvard University had a problem in one of the circuits of the long glass-enclosed computer. A member of the programming team, Grace Hopper, recorded the story in her log book:  “It was over in another building, and the windows had no screens on them and we were working on it at night, of course, and all the bugs in the world came in. And one night she (Mark II) conked out and we went to look for the bug and found an actual large moth, about four inches in wing span, in one of the relays beaten to death, and we took it out and put it in the log book and pasted Scotch tape over it.”

1stComputerBug

 

 

 

 

 

 

According to Hopper, from then on, when anything went wrong with a computer, they said it had bugs in it. The term “bug” had been used by engineers to describe flaws in machines, but Hopper popularized “bug” and “debug” as early computer-programmer language. She was an originator of electronic computer automatic programming and a computer pioneer while working for the Navy, where she was a Rear Admiral. As a lecturer, she often told the story of the computer bug. The Mark II was an electromechanical computer built at Harvard and financed by the US Navy.

 

Abstract

SOA is a well-known term today, when we think of SOA; WCF comes in mind. Whereas WCF is a Microsoft technology to build SOA based software solutions. This article will help you understand what exactly “SOA” is as per real architectural way, why architects suggest SOA based application architecture and how SOA can be implemented etc.

What is SOA

SOA (Service Oriented Architecture) is an Architectural Design Pattern / Approach, under which distributed and decoupled applications can interact with each other. SOA is NOT a Technology or a Language.

SOA provides the infrastructure to the idea of how two different business entities communicate and work together. E.g. your bank offering Stock services, a travel site with feature to book a flight, a hotel, a car or even a holiday package etc., weather updates and currency rates etc. All such activities take place due to B2B integration; and SOA is the oxygen for such type of business activities.

Before a service can be consumed, a request message needs to be sent to the service (the provider, or callee) by its client (the consumer, or caller). A request message contains information about the operation the service is being asked to perform, and any additional data that the specific operation needs to have before executing. For example, a service that shows you a currency exchange rate needs to have two currency types and how much money you want to convert. E.g. 100 USD to INR

Why SOA

In today’s world we heavily rely on software systems for example a bank’s system communicates to various other software & database systems.

This usually cause Software applications to face following challenges:

  • Applications are becoming more and more distributed.
  • Business needs are changing very often.
  • Collaboration with other systems is becoming key to success of application. E.g. B2B scenario.
  • Operation costs need to be reduced.
  • Scalable, secure and reliable systems are needed by business.

SOA resolves these challenges by defining standards for interaction between decoupled systems and technologies based on policies and contracts.

SOA Objectives

SOA is intended to provide loosely coupled interaction between applications. Benefits offered by SOA are as follows:

  • Agility. Enables your business to adapt changes quickly.
  • Productivity. Can implement complex applications using SOA more easily than with other architectural styles.
  • Reusability. Able to reuse your services across systems instead of rewriting the same modules again and again in every system or specific to an individual system.
  • Reduced cost. Software Architects think of Build vs. Buy vs. Reuse, SOA based approach allows to either buy or reuse this feature/functionality; hence in most of the cases cost is saved by reusing the existing services, a lot of commonly used services are available for free.

Communicating with SOA based Service

SOA based services communicate with outside world via EndPoint(s). Hence, EndPoint is required to communicate with a Service.

  • An EndPoint is the access point to the service.
  • Accessing internal assets can be done only through the EndPoint.
  • The EndPoint controls who can access the service, what operations they can perform, etc.
  • Services may expose multiple EndPoint for various reasons (technology, topology, etc.).

Properties of SOA Architecture

Service-Oriented Architecture is based on four tenets:

Services handle data, not objects

Objects are known to have direct dependency on a particular technology, while XML data is not technology-specific. Hence, services communicate by exchanging data as long as they use the same standards by which the service operates.

Services are autonomous

In order to utilize a Service, client does not need to know the implementation technology and various other internal/implementation details. What all a client requires is the service’s address (I.e. EndPoint) and the information to send the data to.

Services have explicit boundaries

The service is responsible for exposing its information. Everything inside the service’s boundary is only accessible through the service EndPoint. The service’s boundaries are explicit, meaning that the service specifies precisely which messages it can receive and what the messages need to contain; messages that are not compliant with these specifications will be rejected with an error message.

Services expose contract and policy

The contract of the service defines the data which client needs to use when calling a service. Service contract also define the response that the service sends back to the client as result of call made to service.
The service’s policy defines additional information about the data that is being sent. For example, a policy can state that the data needs to be encrypted etc.

SOA Benefits

Productivity

  • Services are autonomous. Services have explicit boundaries. Services can always be moved to some other location.
  • Services depend on data. There is no dependency on the technology that creates the data.
  • Service autonomy simplifies testing
  • All major development frameworks (Microsoft.NET, Java) embraced SOA.
  • Development tools like Microsoft Visual Studio provide an excellent environment for building SOA applications using WCF, ASP .NET WebAPI or ASP .NET WebServices.

Agility

Continue Reading

Microsoft released the CTP2 of Visual Studio 2014 today July 8th 2014.

In my previous News item I mentioned that biggest challenge in trying Visual Studio 2014 was Side-by-Side installation. This issue is claimed to be resolved in this new CTP2 release which can be downloaded from here , whereas I would suggest that you try it with your own responsibility and things might break.

What is CTP anyways?

CTPs are previews for the next major release of Visual Studio. These Visual Studio CTPs are intended to promote continuous feedback between early adopters and the Visual Studio development team.

CTPs have Limitations

CTPs are provided for testing and feedback purposes only. CTPs are unsupportedEnglish-only releases. They are not subject to final validation and are not intended for use on production computers, or to create production code.

Some New COOL Features Added in CTP2

  • Save and Apply Custom IDE Layouts. You can now save and apply custom layouts for tool windows in the IDE. The Save Window Layout and Apply Window Layout commands are under the Window Menu and you can also rename, reorder, and delete layouts from Manage Window Layouts.
  • Light Bulb Editor Adornment. How many times have you found yourself stuck in a complex syntax issue or compilation error which doesn’t seem to go away? I have always wished that there was a legitimate way to have some options displayed as solution to the problem. Microsoft Introduced, Light Bulbs which is an extensible editor adornment to identify and help you fix issues in your code. To use them, place the caret on a line with an issue or hover over an issue and you’ll see a light bulb that lists actions you can take to resolve the problem and even a preview of proposed solutions.
  • Editor Touch Support. All the devices these days are supporting touch. Many software receive direct benefit from the support for touch. Visual Studio Code Editor seem to be an exception to be fully benefited with touch, as development required typing. But a Touch support will certainly enables the developers to do some usual things like scrolling, pinch-to-zoom, tap-and-hold for context menus, double-tap for word selection, and line selection by tapping in the margin etc. All such gestures now acknowledged by Visual Studio 2014 code editor. Needless to mention you have to have a Laptop with Touch Support.
  • ALL CAPS. Remember menu names in Capital letters (All CAPS) was kind of hard to read. SO Microsoft has reverted it to be Title Case (Tools, File, View) as it has been used by various Visual Studio releases.  Microsoft Says.. Last week with the RC for Visual Studio 2013 Update 3 we added an option to sentence case menus; in this VS “14” CTP we changed Menu Bar styling to Title Case for everyone to help us get feedback on the change. 

 So Are you Installing?

I wanted to verify few things and so I chose to install and try the CTP2 bits of Visual Studio 2014. My current laptop settings are as follows:

  • Windows 7 Enterprise
  • Visual Studio 2012 Ultimate
  • Visual Studio 2013 Ultimate
  • newly installed Visual Studio 2014 Professional

VS2014

 

 

 

 

 

 

 

 

 

 

Continue Reading….. 

 

Abstract

In this article I will share some real-world problems that appear to be complex, but with usage of Microsoft.VisualBasic.Devices those can be easily done.

Scenario

You are working on an application and you come across any of the following requirements before any action can possibly take place:

  • Verify OS name.
  • Make sure CAPS is ON or NOT (as per your application’s need)
  • Check Network availability before you open a browser or load the site.
  • Does the mouse have a wheel?
  • Ability to Ping a URI or Computer’s IP before your entire business logic starts executing.

Introduction

All of the preceding specified situations are valid and used in many real-world applications, the issue is that none of them appear straightforward to implement, as it involves:

  • Communication with Operating System; to know the OS name
  • Communication with Hardware; to know if CAPS is ON or OFF
  • Communication with Network Adaptor; to check if Computer is connected to Network on not
  • Communication with Hardware pointing device; Mouse has wheel or not
  • Perform some action over the network; Pinging a computer or URL

Solution

Microsoft.VisualBasic.Devices is a namespace that helps in such scenarios. The following code example shows the use of various classes.

In order to use Microsoft.VisualBasic.Devices namespace you must add a reference of it to your project/application.

Continue Reading…

 

A .NET Client Profile is supported by .NET Versions 3.5 and 4.0. It is designed for client applications like Windows Forms. The Client Profile version of .NET Framework is a lightweight subset of the framework. This enables quicker deployment and small installation packages.

Read My Full Article Here..

Introduction to Big Data

June 12th, 2014 | Posted by Vidya Vrat in Database - (1 Comments)

Data is a precious thing because they last longer than systems – Tim Barnes Lee

Introduction

Big Data, as the name implies, is a collection of huge amounts of data. Data has always been important to mankind and society by various means. But in the past few years data has been collected and used for a variety of purposes. The major factor that differs Big Data from normal data in a DBMS or RDBMS is that Big Data is very large volume, it has no defined structure, it includes a lot of data that is being created from various channels like emails or social media like Twitter, Facebook, LinkedIn and so on.

Read My Full Article Here

I presented a Google hangout for Bangalore DotNet (BDotNet) user group on June 4th Wednesday 9pm IST (8:30am PST)