Sunday, June 17, 2018

Architecture Patterns


  • Architecture Patterns are broader, and can be used from the Solution phase on
  • Architectural patterns are high-level strategies that concerns large-scale components
  • Design patterns are solutions to software design problems

  • Example: MVC, MVVM, Layered Architecture (UI, BL, DAL etc)

Tuesday, March 13, 2018

Getting started with Entity Framework 6


  • Entity Framework is ORM from Microsoft
  • ORM - Object Relation Mapper
  • Entity Framework introduced in 2008
  • It was ADO and ADO.NET prior to EF
  • Domain classes
  • Code first, database first
  • Visual designer (edmx)
  • POCO - Plain Old CLR Object
  • Entity Framework 6 is backward compatible
  • Enti
  • Entity Framework 7 is NOT backward compatible
  • Entity Framework support non relational data


Tuesday, November 22, 2016

Angular JS

What is Angular JS?


  • Angular JS is client side open source JavaScript framework.
  • Model-View-Whatever (MV*)
  • Angular reduce the amount of JavaScript needed to make web application functional
  • Version evaluated : 1.5.8
  • Angular JS developed & maintained by google
  • SPA (single page application)

Reference: 
  • https://angularjs.org/
  • https://cdnjs.com/libraries/angular.js/

Tuesday, September 16, 2014

Singleton in ASP.NET web application

Question: One part of the web application is designed using singleton pattern. So across all users this object will be one. Is it correct?

Answer: Yes. There will be only one instance.

Each request to an asp.net site comes in and is processed on it's own thread. But each of those threads belong to the same application. That means anything you mark as static is shared across all requests, and therefore also all sessions and users.


Tuesday, August 12, 2014

Static Class

  1. Cannot derive from Static Class
  2. Cannot create instance of Static class using new keyword
  3. Static class can be public or internal
  4. Static class can NOT be private or protected or protected internal
  5. Static class can NOT have non-static members

1) 
static class ThisClassIsStatic
{
    static string comment;
    static int count = 0;
}
class ThisIsDervied : ThisClassIsStatic   //NOT POSSIBLE
{
}

2)
ThisClassIsStatic obj = new ThisClassIsStatic(); //NOT POSSIBLE

3) 
public static class ThisClassIsStatic  //POSSIBLE
{
}

4)
private static class ThisClassIsStatic  //NOT POSSIBLE

5)
    static class ThisClassIsStatic
    {
        static string comment;
        static int count = 0;
        int index = 0; //NOT POSSIBLE

    }

C# Base

    class Program
    {
        static void Main(string[] args)
        {
            B b = new B();
            Console.Read();
        }
    }

    class A
    {
        internal int x = 10;
        public int MyProperty { get; set; }
        public A()
        {          
            Console.WriteLine("A Constructor");
        }
    }

    class B:A
    {
        public B(): base()
        {                
            Console.WriteLine("B Constructor ");
        }
    }

What's the output of the above program?

Note: base keyword can be used ONLY from derived class's constructor to access base class members (non-private members)