Saturday, January 25, 2014

What is Scalability

What is Scalability  Ability of a system, network or a process to handle growing amount of work in a capable manner. Scalability is important to make sure heavy loads that comes to the servers are handled without minimum or no downtime.  Types of scalability Horizontal scaling (Scale out) Adding more nodes to a system.  Scaling out with Azure SQL Database using Elastic Database.  Vertical...

Model Binding in ASP.NET MVC

ASP.NET MVC Model Binding simplifies controller actions by automatically populating controller action parameters, taking care of property mapping and type conversion.  Model binding consists of collecting values from the request and populating models with those values. These steps are accomplished by value providers and model binders.  Value Providers ASP.NET MVC includes value provider...

Wednesday, January 8, 2014

All about HTML5

Creating the document structure with HTML5 elements Media controls in HTML5 Using Canvas and SVG Styling HTML5 elements Using HTML5 APIs (Storage APIs, AppCache API and Geolocation API) Scopes in JavaScript this in JavaScript DOM Events Exception Handling in JavaScript WebSockets in HTML5 Web Workers in HTML5 ...

Monday, January 6, 2014

All about ASP.NET MVC

Today I thought of categorizing the articles I'm going to write regarding ASP.NET MVC. Wrote them down on my whiteboard so I can see clearly what are they. Here are links to already written articles. Introduction MVC Framework and Application structure Essential features Global.asax All about Context Security Identity Systems in ASP.NET...

Wednesday, January 1, 2014

Overloading, Overriding and hiding in C#

Overloading and overriding are concepts in polymorphism. Overloading Use overloading when multiple methods has same purpose but there is more than one way to do. Overloaded methods have different parameters. E.g: void ReadXml(string fileName) {  } void ReadXml(Stream strm) {  } An alternative to method overloading is to use optional parameters. public void Foo(int x = 1) Also use named...

Strategy Pattern

Allows behavior of an algorithm to be selected at run time. The strategy pattern,  defines family of algorithms, encapsulate each algorithm and makes algorithms interchangeable Following is an example of a implementing strategy pattern. Therefore the host class (The class that uses strategy, below the Context) class...

Using IComparer, Comparer and IComparer in C#

IComparer IComparer interface exposes a method to compare two objects. This interface comes under System.Collections namespace. You can use this with Array.Sort() method. To use with Generic classes you must use IComparer<T> interface. You can check the example in MSDN documentation to see how to use IComparer with an Array. IComparer<T> This interface comes under System.Collections.Generic...

Using IComparable in C#

In case you want to compare 2 objects for sorting purpose you can use this interface. IComparable defines a type specific comparison method. Value types and classes can implement this interface.  Lets say you have a list of people and you want to sort it by age. You'll use Sort method comes with the list. Usually the Sort() method will use default comparer for the...

SQL Overview

Table, Fields and Rows Table is a collection of data. It consists of fields. Field is a column in a table that contains data of the table. Record or row is individual entries containing data of a table.  SQL Constraints Constraints are rules enforced on columns or tables. The idea is to increase accuracy and reliability of data.  Not null Default Unique Primary Key Foreign...

Unit Testing

What is Unit Testing? Testing smallest testable parts of an application. Unit testing only consider about the unit under test. Later you can do integration testing to verify other parts of the application. Unit testing can be very time consuming thing and you need to understand not all flows might not get covered here. Unit testing can be done manually as well as can be automated.  Using...

Factory Pattern

Factory pattern is a creational design pattern. It allows creation of objects without exposing internal logic to client. It allows subclasses to decide which class to instantiate.  Let's look at how we can implement factory pattern. This file contains bidirectional Unicode text that may be interpreted or compiled...

Event Handlers in jQuery

.on() Attach event handler function to one or more events for the selected elements. Go through the Documentation for more information and some examples. Before on(), there were few alternative functions in use such as bind(), live() and delegate(). See the comparison to get more info about when to use what. ...

Windows Identity Foundation

http://dotnetcodr.com/tag/claims/page/2/ How to create a Claim       Claim claim1 = new Claim("Name", "User1"); You can also use enumeration ClaimTypes offered by WIF to give name for the claim (This is not actually a enum. It is a static class with const fields).      Claim claim2 = new Claim(ClaimTypes.Country, "Sri Lanka"); You can create IIdentity object using...

Relationships in Entity Framework

In Entity Framework, an entity can be related to other entities through an association (relationship). The relationship may be governed by a referential constraint, which describes which end in the relationship is a principal role and which is a dependent role. Navigation properties provide a way to navigate an association between two entity types. Every object can have a navigation property...

Overview of .NET Framework

Above diagram shows a high level overview of .NET framework Managed code vs Un-managed code Managed code : code that is executed directly by the CLR.  Un-managed code : Code that is directly executed by the operating system. Covariance and contra-variance http://www.indiabix.com/technical/dotnet/dot-net-framework/5  https://www.google.lk/search?q=covariance%20and%20contravariance Resources http://msdn.microsoft.com/en-us/library/vstudio/zw4w595w%28v=vs.110%29.aspx Image...

SignalR Performance and Scalability

ASP.NET Core SignalR is a library by Microsoft (now opensource) which allows server to communicate with client side web apps asynchronously. Performance and scalabality is a major consideration developers needs to consider when developing applications. Performance tips Reduce SignalR message size You can reduce this by reducing size of your...

Command Pattern

In command pattern an object is used to represent and encapsulate (hide information) all the information needed to call a method at a later time.  We are not directly interact with the event receiver. Instead we use Command Objects to interact Receiver : Has operations to be executed Invoker : Calls command to carryout operations....

Common Stored Procedures in SQL Server

sp_executesql (link) Executes a T-SQL statement or batch. This can contain embedded parameters Difference between exec and sp_executesql  sp_getapplock (link) Locking tables or stored procedure at the same time MSSQL Tips - Prevent Multiple users from running same SQL Server Stored Procedure at the same time. Also look at Transactions.  There are many other database engine...

NoSQL databases

NoSQL provides an alternative way for storage and retrieval of data for relational databases.  NoSQL has, a massive write performance compared to relational DBs faster Key-value access Due to its lack of structure, flexible schema and data types Can use right data model for right problem with different data models and many.  Usually...

Data Compression

Data compression is the process of reducing size of a data file. Compression can be either lossy or lossless. In lossless the bits are reduced by identifying and eliminating statistical redundancy. Lossy compression removes unnecessary information.  HTTP compression (wiki) HTTP data is compressed before it is sent from the server: compliant browsers will announce what methods are supported...

How MVC, MVP and MVVM patterns are related

MVC MVC pattern stands for Model, View and Controller. This pattern is used to separate concerns of the application in to different layers MVP MVP pattern stands for Model, View and Presenter. It's a derivative of MVC. It is commonly used for user interfaces.  MVVM MVVM pattern stands for Model, View and ViewModel. MVVM is also...

ASP.NET Performance

Profiling You can profile server side using Glimpse. Check the tutorial on ASP.NET website. Other than Glimpse  there are profilers like MiniProfiler. See Hanselman article about Glimpse. Using Asynchronous Methods .NET framework maintains a pool of threads that are used to service ASP.NET requests. When a request arrives, a thread from the pool is dispatched to serve the request. If...

Concepts in Windows Identity Foundation

WIF involves lot of related concepts. IIdentity Usually represents the user. This interface is implemented by GenericIdentity and WindowsIdentity classes. Identity Objects encapsulates information about the user or the entity. It basically contains a name and an authentication type. The name can be user's name or Windows account. .All...
Powered by Blogger.


Software Architect at Surge Global/ Certified Scrum Master

Experienced in Product Design, Software Engineering, Team management and Practicing Agile methodologies.

Search This Blog

Facebook