Skip to main content

Posts

Virtual machines vs. Containers

One of the questions that often comes up to anybody who's in the cloud space is, what are the differences between virtual machines and container? When should use one versus the other? Unfortunately the answer is not so simple clear-cut. We can't say you should always use containers or always use virtual machines. But, there are some things to keep in mind. There are certain kinds of applications which benefit from running in containers or using micro services in general. Microservices means taking an application and decomposing it into smaller parts. This is really good if you need to build a web scale application and you need to have the ability to turn up different dials of performance somewhat independent of each other. For example, take the middleware piece or the front end or the database piece and you need to scale them individually. The other benefit of containers is a consistency between the development environment and the production environment where you can take thing...

Javascript - Unanswered questions - Part 1

What is Event delegation? Event delegation is Javascript as it relates to the DOM. It basically means that if you attach an event listener to a DOM element that listener is not only firing on that DOM element. It's actually firing on every children in that. So, for instance if you have a navigation and so you've got an unordered list you've got list items and then you've got anchor tags inside that navigation what you have. If you add an event listener to the ul element in essence you're actually adding event listener to all of the children as well. In short, JS event listeners fir not only on a single DOM element but on all its descendants. What is Event Bubbling? It's actually inverse of Event delegation. Also known as propagation, events on an DOM element will bubble up and also fire on all parents.  What's the difference between "target" and "currentTarget"? target is the actual element that triggered the event for example clicked, wh...

Microservices vs. APIs

It still surprises me just how many times I come across misconceptions around Micro Services and APIs. Often hearing phrases like micro services are fine grained web services or API is themselves are equivalent to micro services. These all sort of show fundamental misconceptions under the covers. So, I've written this just to really break that out and explain about what the key differences are in those two concepts. What is an API? An API, fundamentally Application Programming Interface, that is an interface. It's a way of making requests into a component. So it's the route that you go in to make those requests. In modern use that typically means a REST API, that's a call made using HTTP protocol using JSON data as the payload. What are Micro Services? So let's ensure we also have a clear crisp definition on what a micro service architecture really is. Micro-Services architecture is about breaking down large silo applications into smalle...

Microservices vs. SOA

What is a micro service? Small, individually, independently deployable application components that are self-contained and exposed through lightweight http based APIs. Here the independence of the of those components is really important because it has lot of ramifications in terms of how manage large-scale deployments of this architecture. Some people may say micros services are contrary to service oriented architecture. Actually, that's not true, Micro services are extension or evolution of service oriented architecture. The same principles still hold true but then it fixes lots of problems that were there in the service oriented architecture like large ESBs (Enterprise service bus), unwieldy configurations and scalability issues. It breaks that down into small reusable components that now you can scale individually or you can manage individually, so it gives lot more flexibility. Why IT industry has moving towards Micro Services? Well, obviously Agile and Scrum are big factor in t...

Node.js for Everything

Lots of web applications using Javascript for front end for a long time. Javascript enabling people to build really really interactive great products, we can use Javascript on the front end and on the back end. So, what do we do on the back end? Node.js is the answer. Here we'll see some of the npm packages that'll help us to enable Javascript in back end as well. Load balancing is the main one when you plan to host your application server environment. Node offers pm2 package to easy your job. It's modern CLI process manager for Node apps with a builtin load-balancer. npm install pm2@latest -g pm2 start app.js Next thing is running applications continuously. Yeah, we've a node package named forever. It's a simple CLI tool for ensuring that a given node script runs continuously. npm install forever -g forever start app.js Enabling debugging in Javascript client applications are easy. Debugging a node application is sometimes a black box sometimes not, but one of the ...

Your connection is not private

Almost all web developers facing this issue without knowing the path of the problem. When we try to access the secure web sites, I mean https, Google Chrome browser says "Your connection is not private". What we do usually, just click ADVANCED link and Proceed to (unsafe).  At times, we will not see Proceed to (unsafe) link after clicking ADVANCED. We see the below screen instead which says "You cannot visit right now because the website uses HSTS. Network errors and attacks are usually temporary, so this page will probably work later."  If you see the above screen don't get upset. Type chrome://net-internals/#hsts in address bar and hit Enter. In Delete domain enter your domain name and do delete. You can verify you domain's status in Query domain. Once you done the specified steps then you can see Proceed to (unsafe) link.  Enjoy!

What are the HTTP methods supported by REST?

REST supports the following HTTP methods: GET: It requests a resource at the request URL. It should not contain a request body as it will be discarded. May be it can be cached locally or on the server. It can have request headers. POST: It submits information to the service for processing; it should typically return the modified or new resource. It can have both request body and request headers. PUT: At the request URL it update the resource. It can have both request body and request headers. DELETE: At the request URL it removes the resource. It can have both request body and request headers. OPTIONS: It indicates which techniques are supported. HEAD: It returns meta information about the request URL.

Is NPM INSTALL a valid command?

Yeah, It looks like a weird. Did you try anytime this command? NPM INSTALL is not a valid command. All the NPM commands should be in lower case. 

What's Virtual DOM?

There’s no big difference between the regular DOM and the virtual DOM. It’s better to think of the virtual DOM as React’s local and simplified copy of the HTML DOM. It allows React to do its computations within this abstract world and skip the real DOM operations, often slow and browser-specific. Real DOM operations are really really expensive. The Virtual DOM is an abstraction of the HTML DOM. It is lightweight and detached from the browser-specific implementation details.  One thing you should remember that the DOM itself was already an abstraction. So, Virtual DOM is an abstraction of an abstraction. :)

Why Web Developers interested in React Js?

The amount of JavaScript tools is steadily increasing, turning the selection of appropriate technology into a challenge. But why developers are most interested in React js among those libraries. Nowadays all the web applications are in SPAs. It means the DOM trees are huge nowadays, in turn we need to modify the DOM tree incessantly and a lot. This is a real performance and development pain. Consider a DOM made of thousands of divs. We have lots of methods that handle events - clicks, submits. What can do by the library like jQuery? jQuery will find every node interested on an event and update it if necessary It has two problems: It’s hard to manage and it’s inefficient. The solution to problem 1 is declarativeness. Instead of low-level techniques like traversing the DOM tree manually, you simple declare how a component should look like. But this doesn’t solve the performance issue. This is exactly where the Virtual DOM comes into action. First of all - the Virtual DOM was not invented...

What is SPA?

Single-Page Applications (SPA) are Web apps that load a single HTML page and dynamically update that page as the user interacts with the app. SPAs use Javascript libraries and HTML5 to create fluid and responsive Web apps, without constant page reloads. However, this means much of the work happens on the client side, in JavaScript.

What is Machine config?

 Machine.config file contains settings that apply to an entire computer. Machine.config contains configuration settings for machine-wide assembly binding, built-in remoting channels and ASP.NET. Machine.config would be the primary configuration lookup file. I mean, the configuration system first looks in the machine configuration file for the appSettings element and other configuration sections. It then looks in the application configuration file. So, How can we use Machine.config efficiently? To keep the machine configuration file manageable, it is best to put these settings in the application configuration file. However, putting the settings in the machine configuration file can make your system more maintainable. For example, if you have a third-party component that both your client and server application uses, it is easier to put the settings for that component in one place. In this case, the machine configuration file is the appropriate place for the settings, so you don't hav...

Unity vs MEF in Prism

Prism offering two injection containers named Unity and MEF. Both the containers have their own capabilities. Before choosing the container decide your environment needs. Some of the capabilities provided by both ( Unity & MEF ) containers include the following: Both register types with the container. Both register instances with the container. Both imperatively create instances of registered types. Both inject instances of registered types into constructors. Both inject instances of registered types into properties. Both have declarative attributes for marking types and dependencies that need to be managed. Both resolve dependencies in an object graph. Unity provides several capabilities that MEF does not: Unity resolves concrete types without registration. Unity resolves open generics. Unity uses interception to capture calls to objects and add additional functionality to the target object. MEF provides several capabilities that Unity does not: MEF discovers assemblies in a dir...

Advantages of Prism

Reusability : Prism allows building component in one framework (WPF) and reusing it in other platforms (Silverlight, Windows Phone). Project architecture should design in such a way. Modularity : As everything is break down into modules, Prism supports modularity due to this PRISM is flexible, extensible . Extensibility : Due to Prism design patterns nature new functionality that is to be added is easily extensible for future purpose. Maintainability : The large scale complex applications developed using Prism are maintenance friendly. Flexibility : Prism is flexible to develop large complex applications. Team Collaboration : Simultaneous module development is possible and Multiple teams can work on different modules simultaneously. Fault Tolerance : It allows components to be thoroughly and completely tested thus results in error free application development of better quality.  

What is Prism?

Prism is a framework or the set of guidelines which is used to develop  Composite or Complex applications specific to WPF , Silverlight or Windows Phone .   It's a kind of Design Pattern to develop XAML based applications.  Prism mainly helps to design the Loosely Coupled components which can be easily integrated with other components of the application. It uses modularity and allows to break application into pieces can be called as Modules.   Prism uses design patterns like MVVM , Command Pattern , Dependency Injection (DI) and Inversion of Control (IoC) and Separation of Concerns to achieve Loosely Coupling. Prism has the following advantages over other frameworks. Reusability, Extensibility, Flexibility, Team Collaboration, Fault Tolerance, Maintainability and Modularity. Prism has 5 main components: 1) Shell: Template that Defines structure of the UI. Shell can contains several regions. 2) Regions: Regions are used to specify specific portion of shell as ...

How can we identify partial classes in C#?

The class declaration with the keyword partial is denoting that the class is a partial class. Physically the partial classes can be available in different files/locations. The C# compiler treat them as a single class at the time of compilation.           public partial class PartialClassExample         {             public void MethodOne( int input)             {                 /// Do something .             }         }         public partial class PartialClassExample         {             public string MethodTwo( string input)             {                 return string .Format( "Hello, {0}" , input);             } ...

Face to Face Interview for 5+ years experienced .Net Developers

Interviewer: Hi Loganathan, Good morning. How are you? Me: Great, How are you? Interviewer: I'm good. Can brief about yourself? Me: Well, I started my career with .Net framework 2.0 then worked on 3.5 and 4.0 frameworks as well. So, I can work on any frameworks. I've no chance to develop a desktop application. From the begining I'm working as a pure Web developer. Initially started with ASP.Net web applications development and moved to Silverlight applications. I've well experience in C#, SQL Server 2005/2008 and WCF. I used Microsoft Enterprise Library Application blocks and LINQ in my applications. I worked in both Waterfall model and Agile model environments. Currently working as a Senior Developer. My roles and responsibilities are developing controls in Silverlight, writing WCF methods and consuming them in our applications, writing new stored procedures or modifying, doing unit testing and code review. Interviewer: Great, Can you explain about your current project...

Large Volume of Dataset Transfer from WCF to Silverlight

Most of the times the developers, architects have the problem to retrieve large volume of data from WCF Service to Silverlight client applications. It’s a big head ache for developers. But it’s not up to that much problematic one. We can solve this problem by changing some property’s values in Web.config of WCF Service host, Silverlight application’s ServiceReference.clientconfig and Silverlight XAP hosted ASP.Net Applications. Here I’m going to explain the Web.config changes we need to retrieve large volume of data from WCF Service and also uploading large size of files to the Server. Last week, I was trying to figure out why my WCF service call always threw the generic NotFound exception when trying to retrieve large datasets. Even though, I set buffer limits to 2147483647 (int.MaxValue) in the Silverlight ServiceReferences.ClientConfig file and WCF Service configuration Section under web.config the problem was persisting. I tried so many things from Data Access Layer and UI. Finall...