Angular 2 Cross Modules Communication: EventAggregator Overview

Angular modules are becoming pivotal building blocks in Angular 2 architecture. With Angular 2-RC5 the NgModule is the decorator that defines an Angular module class. Modularity enables us to developed loosely coupled and extensible applications that are built to last and to change. A module encompasses components, templates, services, directives, etc.. into a cohesive block of functionality. Each angular…

Insights on .NET Concurrency: Asynchronous Programming

Table of Contents IntroMotivationsWorkflow of async/awaitCancellationException HandlingEtiquette of async/awaitMixing Parallel & AsynchronousHandling ReentrancyFurther InsightsGetting Started Intro In this post of the concurrency series we will provide insights on asynchronous programming. So what is asynchrony? Succinctly, is about not blocking the thread that initiates an operation. The key difference between synchronous and asynchronous is that the latter can start a new operation…

Prism: Why Service Locator Matters with Multiple Shells

Scenario You are working on a WPF composite application built with Prism bootstrapped with UnityBoostrapper, and you try to launch a second isolated/standalone WPF Prism composite app also bootstrapped with UnityBoostrapper, so the two windows are open at the same time. At this stage the second window is behaving properly i.e. views get navigated to the appropriate regions. So…

The Janus Task Class

Intro The msdn API reference defines the Task class as a representation of an asynchronous operation. However, as soon as you start writing Task based code for asynchronous/parallel programming, or simply offloading work to a thread pool thread, it becomes obvious that Task has more than one face based on the use case.

Task Faces Active…

Insights on .NET Concurrency: Parallel Programming

Table of Contents IntroConceptsParallel ChecklistRules of the GameParallel PatternsMap PatternJoin/Fork PatternReduce PatternException HandlingDesign Mindset Intro Parallel programming is the next post from the Insights on .NET Concurrency series. Parallelism is about making more than one thing happen at the same time, with the main objective being improve the performance of CPU bound operations. Parallel programming model tries to overcome single core limitations.…

Insights on Composition over Inheritance

Problem Statement ‘a subclass inherits inappropriate operations from a superclass’ Background The prime motivation for inheritance and composition in object oriented is code reuse [3]. With inheritance, modifications on the superclass would lead to modifications of the subclass because of the implicit self-recursive re-entrant invocations [1]. Such invocations can hinder the evolution of the model.…

Insights on Passing by Reference in C#

Setting the Scene By looking at the following two methods, arguably they seem to do the same thing. But they must be doing something different, hence there existence. So let’s find out.

What is passing by reference? In C# method arguments are either passed by value or by reference. By value means passing a…