Tuesday, April 22, 2014

Service Virtualization

Service Virtualization is a method to emulate the behavior of specific components in heterogeneous component-based applications such as API-driven applications, cloud-based applications and service-oriented architectures. Service virtualization emulates the behavior of software components to remove dependency constraints on development and testing teams which enable end-to-end testing of the application as a whole. 
Test environments can use virtual services in lieu of the production services to conduct integration testing earlier in the development process. Service virtualization can be useful for anyone involved in developing and delivering software applications. Integration testing of these applications is often delayed because some of the components the application depends on aren’t available. Service virtualization enables earlier and more frequent integration testing by emulating the unavailable component dependencies.
  • Application emulation: Virtual components can simulate the behavior of an entire application or a specific component.
  • Multiple test environments: Developers and quality professionals may create test environments by using virtual components configured for their needs.
  • Same testing tools: Developers and quality professionals can use the same testing tools that they have used in the past — the tools can’t tell the difference between a real system and a virtual service. 
Benefits :
  • Reducing costs: Test lab infrastructure costs can be pricey. Instead of provisioning large servers or mainframes, a virtual test environment can run on low-cost commodity hardware. The environment can easily be reconfigured for different testing needs or projects.
  • Improving productivity: With service virtualization you don’t have restraints in the way you do testing or development. Virtual components are available 24/7. This means that productivity can be greatly increased, and resources can be freed up for other value add activities or additional testing process improvements like the inclusion of exploratory testing.
  • Reducing risk: Service virtualization can also help reduce risk. You can test software earlier in the process, which means defects can be addressed earlier, producing fewer surprises toward the end of the schedule. The final product may be put into production earlier and with fewer errors.
  • Increasing quality: Service virtualization can improve the overall quality of the application because it increases the efficiency of any testing being performed. As a result, teams are able to do a more thorough job of testing their applications and get higher quality software to market faster.

Sunday, March 23, 2014

JQuery: Deferred Object

The Deferred object, introduced in jQuery 1.5, is a chainable utility object created by calling the jQuery.Deferred() method. It can register multiple callbacks into callback queues, invoke callback queues, and relay the success or failure state of any synchronous or asynchronous function.
In computer science, future, promise, and delay refer to constructs used for synchronizing in some concurrent programming languages. They describe an object that acts as a proxy for a result that is initially unknown, usually because the computation of its value is yet incomplete. A deferred is an object representing work that is not yet done and a promise is an object representing a value that is not yet known. In other words, promises / deferreds allow us to represent ‘simple’ tasks and can be easily combined to represent complex tasks and their flows, allowing for fine-grained control over sequencing. This means we can write asynchronous JavaScript parallel to how we write synchronous code. Additionally, promises make it relatively simple to abstract small pieces of functionality shared across multiple asynchronous tasks.
Similar to jQuery object, Deferred object is also chainable. $.Deferred() / jQuery.Deferred() is a constructor that creates a new deferred object. A Deferred object starts in the pending state. Any callbacks added to the object with deferred.then(), deferred.always(), deferred.done(), or deferred.fail() are queued to be executed later. Calling deferred.resolve() or deferred.resolveWith() transitions the Deferred into the resolved state and immediately executes any doneCallbacks that are set. Calling deferred.reject() or deferred.rejectWith() transitions the Deferred into the rejected state and immediately executes any failCallbacks that are set. Once the object has entered the resolved or rejected state, it stays in that state. Callbacks can still be added to the resolved or rejected Deferred — they will execute immediately.
Key Points:
  • deferred.always(), deferred.done(), deferred.fail() return the deferred object.
  • deferred.then(), deferred.when(), .promise() return a promise.
  • $.ajax() and $.get() return promise objects
  • instead of using .resolveWith() and .rejectWith(), you can call resolve with the context you want it to inherit
  • pass the deferred.promise() around instead of the deferred itself as the deferred object itself cannot be resolved or rejected through it.

Friday, February 28, 2014

Principles of Software Architecture

Key Design Principles
When getting started with application design, keep in mind the key principles that will help to create an architecture that adheres to proven principles, minimizes costs and maintenance requirements, and promotes usability and extendability. The key principles are:
  • Separation of concerns. Divide application into distinct features with as little overlap in functionality as possible. The important factor is minimization of interaction points to achieve high cohesion and low coupling. However, separating functionality at the wrong boundaries can result in high coupling and complexity between features even though the contained functionality within a feature does not significantly overlap.
  • Single Responsibility principle. Each component or module should be responsible for only a specific feature or functionality, or aggregation of cohesive functionality.
  • Principle of Least Knowledge (also known as the Law of Demeter or LoD). A component or object should not know about internal details of other components or objects.
  • Don’t repeat yourself (DRY). In terms of application design, specific functionality should be implemented in only one component; the functionality should not be duplicated in any other component.
  • Minimize upfront design. Only design what is necessary. In some cases, it might require upfront comprehensive design and testing if the cost of development or a failure in the design is very high. In other cases, especially for agile development, big design upfront (BDUF) can be avoid. If  application requirements are unclear, or if there is a possibility of the design evolving over time, avoid making a large design effort prematurely. This principle is sometimes known as YAGNI ("You ain’t gonna need it").
Key Design Considerations
The major design considerration listed as follow:
  • Determine the Application Type
  • Determine the Deployment Strategy
  • Determine the Appropriate Technologies
  • Determine the Quality Attributes
  • Determine the Crosscutting Concerns
Below figure illustrates common application architecture with components grouped by different areas of concern.

Thursday, January 9, 2014

JSLint : Static program analysis tool

JSLint is a static program analysis tool. It was developed by Douglas Crockford. Static program analysis is the interpretation of computer software that is performed with actually executing. JSLint is used for checking if JavaScript source code complies with coding rules.It can be referred as code quality tool.
JavaScript is a young-for-its-age language. It was originally intended to do small tasks in webpages, tasks for which Java was too heavy and clumsy. But JavaScript is a surprisingly capable language, and it is now being used in larger projects. Many of the features that were intended to make the language easy to use are troublesome when projects become complicated. A lint for JavaScript is needed: JSLint, a JavaScript syntax checker and validator.
JSLint takes a JavaScript source and scans it. If it finds a problem, it returns a message describing the problem and an approximate location within the source. The problem is not necessarily a syntax error, although it often is. JSLint looks at some style conventions as well as structural problems. It does not prove that your program is correct. It just provides another set of eyes to help spot problems.
JSLint is provided primarily as an online tool, but there are also command-line adaptations. JSLint.VS2012 extension also available for Microsoft Visual Studio 2012.
Also, JSONLint is the JSON validator availabe for online use.

JSLint.NET is a wrapper for Douglas Crockford's JSLint, the JavaScript code quality tool. It can validate JavaScript anywhere .NET runs.
At it's core, the JSLint.NET project aims to provide:
  • a complete, accurate and up-to-date wrapper for JSLint
  • an interface that's natural for .NET developers while staying true-to-source
  • a suite of valuable tools that assist JavaScript developers working on Microsoft platforms

Tuesday, December 31, 2013

Happy New Year 2014

I wish u to have a
Sweetest Sunday,
Marvelous Monday,
Tasty Tuesday,
Wonderful Wednesday,
Thankful Thursday,
Friendly Friday,
Successful Saturday,
Have a great Year,


What is Web API?
Web API is a new web application runtime that builds on the lessons and patterns proven in ASP.NET MVC. Using a simple controller paradigm, Web API enables a developer to create simple HTTP web services with very little code and configuration. WebAPI is an ideal platform for building pure HTTP based services where the request and response happens with HTTP protocol. The client can make a GET, PUT, POST, and DELETE request and get the WebAPI response appropriately.
ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
WebAPI is
  • An HTTP Service
  • Designed for broad reach
  • Uses HTTP as an Application protocol, not a transport protocol
Why Web API?
Today, a web-based application is not enough to reach it's customers. People are very smart, they are using iphone, mobile, tablets etc. devices in its daily life. These devices also have a lot of apps for making the life easy. Actually, we are moving from the web towards apps world.
Web API is the great framework for exposing your data and service to different-different devices. Moreover Web API is open source an ideal platform for building REST-ful services over the .NET Framework. Unlike WCF Rest service, it use the full featues of HTTP (like URIs, request/response headers, caching, versioning, various content formats) and you don't need to define any extra config settings for different devices unlike WCF Rest service.
How Web API is different from WCF
Enables building services that support multiple transport protocols (HTTP, TCP, UDP, and custom transports) and allows switching between them. HTTP only. First-class programming model for HTTP. More suitable for access from various browsers, mobile devices etc enabling wide reach.
Enables building services that support multiple encodings (Text, MTOM, and Binary) of the same message type and allows switching between them. Enables building Web APIs that support wide variety of media types including XML, JSON etc.
Supports building services with WS-* standards like Reliable Messaging, Transactions, Message Security. Uses basic protocol and formats such as HTTP, WebSockets, SSL, JQuery, JSON, and XML. There is no support for higher level protocols such as Reliable Messaging or Transactions.
Supports Request-Reply, One Way, and Duplex message exchange patterns. HTTP is request/response but additional patterns can be supported through SignalRand WebSockets integration.
WCF SOAP services can be described in WSDL allowing automated tools to generate client proxies even for services with complex schemas. There is a variety of ways to describe a Web API ranging from auto-generated HTML help page describing snippets to structured metadata for OData integrated APIs.
Ships with the .NET framework. Ships with .NET framework but is open-source and is also available out-of-band as independent download.
Web API Features
  • It supports convention-based CRUD Actions since it works with HTTP verbs GET, POST, PUT and DELETE.
  • Responses have an Accept header and HTTP status code.
  • Responses are formatted by Web API’s MediaTypeFormatter into JSON, XML or whatever format you want to add as a MediaTypeFormatter.
  • It may accepts and generates the content which may not be object oriented like images, PDF files etc.
  • It has automatic support for OData. Hence by placing the new [Queryable] attribute on a controller method that returns IQueryable, clients can use the method for OData query composition.
  • It can be hosted with in the applicaion or on IIS.
  • It also supports the MVC features such as routing, controllers, action results, filter, model binders, IOC container or dependency injection that makes it more simple and robust.

Friday, December 27, 2013

XBRL : eXtensible Business Reporting Language

XBRL (eXtensible Business Reporting Language) is a freely available and global standard for exchanging business information. XBRL allows the expression of semantic meaning commonly required in business reporting. The goal of XBRL is to standardize the automation of business intelligence (BI).
  • XBRL International is a not-for-profit consortium of approximately 650 companies and agencies worldwide working together to build the XBRL language and promote and support its adoption
  • XBRL is XML-based, it uses the XML syntax and related XML technologies
  • Effort had began in 1998 and has produced a variety of specifications and taxonomies
  • It is language for the electronic communication of business and financial data
  • It is an open standard which supports information modeling and the expression of semantic meaning commonly required in business reporting
  • It provides major benefits in the preparation, analysis and communication of business information.
  • It offers cost savings, greater efficiency and improved accuracy and reliability to all those involved in supplying or using financial data. 
  • XBRL is a standards-based way to communicate business and financial information.
  • These communications are defined by metadata set out in taxonomies.
  • Taxonomies capture the definition of individual reporting concepts as well as the relationships between concepts and other semantic meaning.
  • Provides identifying tag for each individual item of data such that it can be used by name
  • The basis for this technology is a "tagging" process by which each value, item, and descriptor, etc. in the exchanged information can be given a unique set of tags with which to describe it. Using these tags, computer programs can read the data without human intervention.
For more information: http://xbrl.squarespace.com/