Bower VS NPM

If you are confused between Bower and NPM then this is definitely for you. In short Npm and Bower are both Project dependency management tools. Below are some basic differences between these two-

  • Used for-
    • NPM is most commonly used for managing Node.JS modules, but it works for the front-end too when combined with Browserify etc..
    • Bower is front-end Package Manager and used for managing front end components jQuery, Bootstrap and so on.
  • Dependency-
    • NPM does nested dependency tree means packages we added in our project can also be dependent on other dependencies and those can further have more dependencies and so on. So, NPM installs dependencies for each package separately, and as a result makes a big package dependency tree(node_modules\babel-core\node_modules\…) where there could be several version of the same package.  For client-side JavaScript this is unacceptable: you can’t add two different version for jQuery or any other library to a page.The reason many projects use both is that they use Bower for front-end packages and npm for developer tools like Yeoman, Grunt, Gulp, JSHint, CoffeeScript, etc.
    • Bower requires a flat dependency tree No nested versioning of packages. With Bower each package is installed once (jQuery will always be in the bower_components/jquery folder, regardless of how many packages depend on it) and in the case of a dependency conflict, Bower simply won’t install the package incompatible with one that’s already installed.

 

Programming is Easy…

 

Advertisements

What and Why WPF?

WPF stands for Windows Representational Foundation. It’s a graphical system to create Windows application.

Why WPF as we already have win forms graphical system? There are lot of benefits of WPF over win form some are below-

  1. A- Anywhere execution(XAML). Since internal representational of WPF is XAML which is internally XML. So it can be execute as win form and in wpf browser application.
  2. B- Binding. This is also important feature of WPF. We can communicate between controls or object by just doing some property bindings instead of writing code. Ex. If there are two textbox and want the behavior like if we change the value of one textbox then second textbox value should change then it can be achieved by just setting text properties.
  3. C- Common look and feel(Styles). We can create and apply the styles like web application CSS to the wpf controls for common look and feel instead of writing same styles for defferent controls.
  4. D- Directive Programming. This is that instead of writing code we can change the behavior by just setting properties in the XAML code and rest wpf system will handle itself. Like Binding.
  5. E- Expression Blend and animation. As Wpf uses the DirectX which is a animation tool so implementing the animation is much easy in wpf application.
  6. F- Faster Execution (Hardware Rendering). As win forms rendering is done via GDI which uses the CPU for rendering( also called software rendering), as CPU also responsible for other stuff like memory management, processing etc.. os some time it become slower. But WPF rendering is done via DirectX which uses the GPU (Graphical Processing Unit) for rendering( also called hardware rendering) because this meant for only rendering so wpf rendering is faster then win forms. If GPU is not found then it uses the CPU. DirectX also responsible to identify what part of rendering should be done via CPU and what via GPU. DirectX performs this action into tiers.
  7. G- Graphic Independency(DIP). Since win forms application internally uses the device pixecles to render control so it becomes developer responsibility to handle this scenario to run application in all type of screen resolution which is itself a big task. But WPF uses the DIP(DEVICE INDEPENDENT PIXCEL) which makes the developer life easy to run application independently screen resolution.

WCF Vs ASMX Web Services

First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.
Simple and basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc).
ASMX is simple but limited in many ways as compared to WCF.

1.ASMX web services can be hosted only in IIS while WCF service has all the following hosting options:
a. IIS
b. WAS (Windows Process Activation Services)
c. Console Application
d. Windows NT Services
e. WCF provided Host

2.ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.

3.ASMX Security is limited. Normally authentication and authorization is done using IIS and ASP.NET security configuration and transport layer security.For message layer security, WSE can be used.
WCF provides a consistent security programming model for any protocol and it supports many of the same capabilities as IIS and WS-* security protocols, additionally, it provides support for claim-based authorization that provides finer-grained control over resources than role-based security.WCF security is consistent regardless of the host that is used to implement WCF service.

4.Another major difference is that ASMX web services uses XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.
Key Issues with XmlSerializer in serializing .NET types to xml are:
a. Only public fields or properties of the .NET types can be translated to Xml.
b. Only the classes that implement IEnumerable can be translated.
c. Classes that implement IDictionary, such as Hashtable cannot be serialized.
Hopefully, this WCF Tutorial will be helpful in understanding the difference between WCF and ASP.NET Web Services.

5. Web services provides simplex communication and there is no way to have half duplex or full duplex communication.

WCF Vs ASMX Web Services

First of all, it needs to understand that WCF Service provides all the capabilities of .NET web servies and further extends it.
Simple and basic difference is that ASMX web service is designed to send and receive messages using SOAP over HTTP only. While WCF service can exchange messages using any format (SOAP is default) over any transport protocol (HTTP, TCP/IP, MSMQ, NamedPipes etc).
ASMX is simple but limited in many ways as compared to WCF.

1.ASMX web services can be hosted only in IIS while WCF service has all the following hosting options:
a. IIS
b. WAS (Windows Process Activation Services)
c. Console Application
d. Windows NT Services
e. WCF provided Host

2.ASMX web services support is limited to HTTP while WCF supports HTTP, TCP, MSMQ, NamedPipes.

3.ASMX Security is limited. Normally authentication and authorization is done using IIS and ASP.NET security configuration and transport layer security.For message layer security, WSE can be used.
WCF provides a consistent security programming model for any protocol and it supports many of the same capabilities as IIS and WS-* security protocols, additionally, it provides support for claim-based authorization that provides finer-grained control over resources than role-based security.WCF security is consistent regardless of the host that is used to implement WCF service.

4.Another major difference is that ASMX web services uses XmlSerializer for serialization while WCF uses DataContractSerializer which is far better in performance than XmlSerializer.
Key Issues with XmlSerializer in serializing .NET types to xml are:
a. Only public fields or properties of the .NET types can be translated to Xml.
b. Only the classes that implement IEnumerable can be translated.
c. Classes that implement IDictionary, such as Hashtable cannot be serialized.
Hopefully, this WCF Tutorial will be helpful in understanding the difference between WCF and ASP.NET Web Services.