Friday, June 27, 2014

JavaScript Engine : V8

A JavaScript engine is process virtual machine which interprets and executes JavaScript. Although there are several uses for a JavaScript engine, it is most commonly used in web browsers. Web browsers typically use the public application programming interface (API) to create "host objects" responsible for reflecting the Document Object Model (DOM) into JavaScript.
The web server is another common application of the engine. A JavaScript web server exposes host objects representing an HTTP request and response objects, which a JavaScript program then manipulates to dynamically generate web pages.

V8:

The V8 JavaScript Engine is an open source JavaScript engine developed by Google for the Google Chrome web browser. V8 compiles JavaScript to native machine code (IA-32, x86-64, ARM, or MIPS ISAs) before executing it, instead of more traditional techniques such as interpreting bytecode or compiling the whole program to machine code and executing it from a filesystem. The compiled code is additionally optimized (and re-optimized) dynamically at runtime, based on heuristics of the code's execution profile. Optimization techniques used include inlining, elision of expensive runtime properties, and inline caching, among many others.
V8 is a new JavaScript engine specifically designed for fast execution of large JavaScript applications. It handles memory allocation for objects, and garbage collects objects it no longer needs. V8's stop-the-world, generational, accurate garbage collector is one of the keys to V8's performance.
There are three key areas to V8's performance:
  • Fast Property Access
  • Dynamic Machine Code Generation
  • Efficient Garbage Collection
Some Facts about V8:
  • V8 is Google's open source JavaScript engine. 
  • V8 is written in C++ and is used in Google Chrome, the open source browser from Google. 
  • V8 can run standalone, or can be embedded into any C++ application. 
  • The garbage collector of V8 is a generational incremental collector.
  • V8 assembler is based on the Strongtalk assembler.
  • V8 is intended to be used both in a browser and as a standalone high-performance engine that can be integrated into independent projects, for example server-side JavaScript in Node.js, or client side JavaScript in .NET/Mono using V8.NET.

Wednesday, May 21, 2014

Message-oriented middleware - RabbitMQ

RabbitMQ is open source message broker software (sometimes called message-oriented middleware) that implements the Advanced Message Queuing Protocol (AMQP). The RabbitMQ server is written in the Erlang programming language and is built on the Open Telecom Platform framework for clustering and failover. Client libraries to interface with the broker are available for all major programming languages.

Message-oriented middleware (MOM) is software or hardware infrastructure supporting sending and receiving messages between distributed systems. MOM allows application modules to be distributed over heterogeneous platforms and reduces the complexity of developing applications that span multiple operating systems and network protocols. The middleware creates a distributed communications layer that insulates the application developer from the details of the various operating systems and network interfaces. APIs that extend across diverse platforms and networks are typically provided by MOM.

The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented middleware. The defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-subscribe), reliability and security. AMQP mandates the behavior of the messaging provider and client to the extent that implementations from different vendors are truly interoperable, in the same way as SMTP, HTTP, FTP, etc. have created interoperable systems. Previous attempts to standardize middleware have happened at the API level (e.g. JMS) and thus did not ensure interoperability. Unlike JMS, which merely defines an API, AMQP is a wire-level protocol. A wire-level protocol is a description of the format of the data that is sent across the network as a stream of octets. Consequently any tool that can create and interpret messages that conform to this data format can interoperate with any other compliant tool irrespective of implementation language.
RabbitMQ
  • Robust messaging for applications
  • Easy to use
  • Runs on all major operating systems
  • Supports a huge number of developer platforms
  • Open source
Messaging enables software applications to connect and scale. Applications can connect to each other, as components of a larger application, or to user devices and data. Messaging is asynchronous, decoupling applications by separating sending and receiving data.

Tuesday, April 22, 2014

Service Virtualization

Definition:
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.
Characteristics:
  • 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.
Links:
http://www.jslint.com/
http://visualstudiogallery.msdn.microsoft.com/1a417c37-4d6f-43ca-b753-6ea6eb5041fd
http://jsonlint.com/

JSLint.NET
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,
HAPPY NEW YEAR