Skip to main content

Posts

Showing posts from 2011

My Notes on Cloud

  I have been asked to meet up with someone who is looking for cloud based solutions. So before I head to meet them I decided to brush up a bit on Cloud stuff and also decided to write up my little notes on Cloud. Defining Cloud – The association of retail technology standards (ARTS) defined cloud as “Cloud computing is an emerging computing model by which massively scalable IT-enabled computing capabilities and resources (servers, storage, networks, applications and services) are delivered as service to external consumers using Internet Technologies. The Microsoft perspective of the Cloud – On-demand – Resources are virtualized and made available as and when you need them. Broad Network access – Resources are available anytime, anywhere via internet. Resource Pooling – Most of the resources are shared. Rapid elasticity – demand driven consumption and provisioning of resources based o...

Notes on Castle MonoRail

  Sometime back I was doing a small POC on Castle MonoRail. So here are my quick notes on this. MonoRail is an MVC Framework from Castle inspired by ActionPack. MonoRail enforces separation of concerns with Controller handling application flow, models representing data and View taking care of the presentation logic. To work with MonoRail you need Castle Assemblies. It also utilizes nHibernate You can use Castle MonoRail Project Wizard or create the project manually. Project structure – Content Css Images Controllers HomeController.cs Models Views Home \ index.vm Layouts \ Default.vm ...

Notes on C#–Part - I

1. Covariant and Contravariant? a. Covariant is converting from wider (double) to narrower (float) b. Contravariant is converting from narrower (float) to wider (double) c. Invariant is not able to convert. 2. Immutable Objects are objects whose state cannot be altered externally or internally. 3. In C# 4.0 you can now do the following – If Manager inherits from Employee then IEnumerable<Manager> mgrs = GetManagers(); IEnumerable<Employee> emps = mgrs; This is because CLR now supports defining IEnumerable<out T> This is called Covariance. Next in-case of IComparable IComparable<Employee> empComparer = GetEmployeeComparer(); IComparable<Manager> mgrComparer = empComparer This is because CLR now supports defining IComparable<in T> This is called Contravariant. 4. C# 4.0 now has dynamic built in type. This is not resolved by the compiler but it left for resolution until run time. So C# now supports dynamic late binding. T...

Notes on Multi-Threading

1. System.Threading namespace provides classes and interfaces that enable multithreaded programming. 2. How to initiate new Thread?     a. Create an object of a Thread class        i. Argument should not be null        ii. Should have permission to create thread.        b. Its constructor takes an instance of a ThreadStart Class     c. ThreadStart Class requires the method that needs to be run on new thread.     d. Call the Start method of the thread class to initiate execution on this new thread. 3. Important points on Threading –     a. Thread function can be static or non-static     b. You can have multiple threads with same thread function.     c. You should always assign a name to the thread using its Name property. (This was pointed out to me by Kalyan Krishna. He said it invaluable...

New Features in WCF 4

1. New features in WCF4 a. Simplified configuration b. Discovery c. Routing Service d. WCF WebHttp Services e. Workflow Services f. Advanced Features 2. WCF 3.x required at least one endpoint to be defined. WCF 4 comes with a default endpoint for each address/contract. 3. The moment you configure even a single endpoint for your service all the default endpoint will disappear. 4. You could also further add default endpoints in code after configuring your custom endpoints using AddDefaultEndpoints(). 5. To modify default behaviors simply add a behavior and do not give any name to it. 6. We no longer need .svc files and instead use the configuration as follows a. System.serviceModel/serviceHostingEnvironment/serviceActivations/Add <add relativeAddress=”Greeting.svc” Service=”GreetingService” /> 7. There are two types of Service Discovery a. Adhoc – within local subnet (LAN) using UDP b. Managed – outside but managed network us...

A few things on Session you should know

I got to read a good article explaining the nuances of cookie less sessions which prompted me to note down a few important things. Here is the link to post that started me on this. To simply enable cookie less session do this - <sessionState cookieless="true" /> What this will do is that your URL’s start looking like - http://mysite.com/ (22b5c4zyybphaw2mt3hjni2n) /Home.aspx This is obviously not secure. However what I want to note here is that even just having cookie based sessions (which is the default setting in .net web applications) is also not secure enough. So did a bit of binging and found out fairly quickly that best thing to do is obviously setup the whole web site on an SSL. (pretty obvious that one). However what if there are some pages that are outside the ssl. There is one confusing or very near and related setting in the forms element of the authentication tag that might fool someone which says setup forms element for authentication with ...