Ramani Sandeep's Blog

DotNetting – Fast , Easy Way of Developing Applications

Single Page CRUD Application (SPA) using ASP.NET Web API, MVC and Angular.js

Posted by Ramani Sandeep on November 23, 2014

A Single Page Application (SPA) is a web application that fits on a single web page. In this type of application, the server provides static HTML views, CSS and JavaScript and the application then loads data by making Ajax calls to the server. All subsequent views and navigation occurs without a postback to the server. This architecture provides a more fluid user experience just like a desktop application.

In this article, we will create a SPA using ASP.NET MVC, WEB API and Angular.js. Angular.js is a Model-View-* JavaScript based framework for developing SPA applications. Similarly ASP.NET Web API is a good fit for providing data for these type of applications.

More: http://www.dotnetcurry.com/showarticle.aspx?ID=1054

Happy Programming !!!
Jay Ganesh

About these ads

Posted in AngularJS, ASP.NET MVC, ASP.NET WEB API | Tagged: , , , , | Leave a Comment »

Difference between DataContractSerializer and XMLSerializer

Posted by Ramani Sandeep on November 19, 2014

DataContractSerializer

1. WCF uses DataContractSerializer attribute.

2. A practical benefit of the design of the DataContractSerializer is better performance over Xmlserializer. This is because DataContratSerializer explicitly shows the which fields or properties are serialized into XML. DataContractSerializer uses the opts-in approach i.e, selecting the members that needs to be serialized.

3. The DataContractSerializer can translate the HashTable into XML.

4. DataContractSerializer serializes private members.

5. DataContractSerializer can serialize both private and public types.

6. DataContractSerializer does not need any default constructor before serializing any type.

7. DataContractSerializer does not give more control over the generated xml structure compared to the XmlSerializer.

8. DataContractSerializer can able to serialize types that implements Idictionary.

XMLSerializer

1. Webservice uses XMLSerializer attribute

2. XMLSerializer does not provide better performance when compare with DataContratSerializer because XMLSerializer does not indicate which fields or properties of the type are serialized into XML. XmlSerializer uses opts-out approach i.e., marking the members do not need to be serialized.

3. XMLSerializer cannot translate the HashTable into XML.

4. XmlSerializer cannot serialize private members.

5. XmlSerializer can serialize only public types. If we are trying to serialize a class that is marked private, InvalidOperation Exception will be thrown by the serializer.

6. For any types that needs to be serialized by XmlSerializer must have a default constructor.

7. XmlSerializer gives more control over the generated xml structure compared to the DataContractSerializer.For ex, if a field should come as an attribute or element.

8. XmlSerializer cannot able to serialize types that implements IDictionary, for ex. Dictionary type cannot be serialized.

Happy Programming !!!

Jay Ganesh

Posted in Interview Questions, WCF & Web Services | Tagged: , , , , , , , | Leave a Comment »

AngularJS vs KnockoutJS

Posted by Ramani Sandeep on November 18, 2014

Eli Weinstock-Herman has created serie of articles to explain difference of AngularJS and KnockoutJS.

The thing is, Knockout and AngularJS are attempting to solve two different problems. One is simply an MVVM binding framework, the other is a SPA-in-a-box solution. So instead of trying to directly compare the two frameworks.

Here are the capabilities discussed:

Data binding – bind HTML elements to JavaScript data models
Validation – validation of raw inputs by applying rules for fields or model properties
Serialization – easy method for serializing models to POST to server-side APIs
Templating – define HTML templates for re-usable complex collections of HTML
Modules + DI – keep my javascript files separate, help me order them properly, manage dependencies for me
Automated Testing – Exploring unit testing and possibilities for higher level testing
SPA Routing/History – make it easy for me to route between views in a single page app, with history/deep linking

Read Full Articles: http://blogs.lessthandot.com/index.php/WebDev/UIDevelopment/angularjs-vs-knockout-introduction-1/

Happy Programming !!!

Jay Ganesh

Posted in AngularJS, JavaScript, JQuery, KnockoutJS | Tagged: , , , , | Leave a Comment »

Difference between PUT and POST using WCF REST

Posted by Ramani Sandeep on November 11, 2014

POST verb is used when are you creating a new resource and repeated operations would create multiple resources on the server. This verb would make sense if uploading a file with the same name multiple times creates multiple files on the server.

PUT verb is used when you are updating an existing resource or creating a new resource with a predefined id. Multiple operations would recreate or update the same resource on the server. This verb would make sense if uploading a file with the same name for the second, third… time would overwrite the previously uploaded file.

Happy Programming !!!

Jay Ganesh

Posted in Interview Questions, WCF & Web Services | Tagged: , , | Leave a Comment »

Abstract Factory vs. Factory Method

Posted by Ramani Sandeep on November 11, 2014

With the Factory pattern, you produce implementations (Apple, Banana, Cherry, etc.) of a particular interface — say, IFruit.

With the Abstract Factory pattern, you produce implementations of a particular Factory interface — e.g., IFruitFactory. Each of those knows how to create different kinds of fruit.

For Example: http://www.codeproject.com/Articles/28309/Design-pattern-FAQ-Part-Training

Happy Programming !!!

Jay Ganesh

 

Posted in Interview Questions | Tagged: , , , | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 480 other followers