Pages

I've migrated my blog

Thanks for visiting my blog. I am no longer maintaining this and I've migrated the blog to my personal domain . If you would like to follow my blog kindly use my new RSS feed

Friday, June 1, 2012

A hybrid application using ASP.NET MVC3 and Node.js

Each and every technology has its pros and cons and there is no silver bullet!

If you would ask me what you have learnt in your profession so far, I would say the above line as the first one. One technology / platform / language is good at solving one kind of problems and bad at solving other kind of problems. The key is leveraging existing platforms with languages targeted at specific problems and applications to solve the business problems in hand.

Three months ago I have come across an excellent presentation from Neil Ford “10 ways to improve your code”. As a 8th way he talks about “Polyglot Programming”. Its about picking the right tool to do the right job. I am inspired by this presentation and started exploring the “right tools”.

In the pursuit of “Right tools”, I’ve come across the young awesome framework node.js which is really cool and perfect for real-time applications. On the other hand frameworks like ASP.NET MVC3 is not meant for creating real-time applications and they address different set of other problems.

In this blog post, I going to share my recent exploration on leveraging node.js in an ASP.NET MVC3 application using a “Chat” feature. Though we can achieve it using SignalR, I’ve preferred node.js as it is a right tool for the chat feature IMO also I wanted to get my hands dirty in creating a hybrid application.


The Node.js Part

image

The chat server that we are going to use in the MVC3 application has been created using socket.io which makes web-socket programming insanely easy!
Its listen for three events
  • join – It will be triggered when a new user joined the chat and it broadcast the user name to all the connected users
  • message – It willed be triggered when an user send a message in the chat application and broadcast it to the other users
  • disconnect – It willed be triggered when an user closes the chat or closes the browser
That’s it bang!


The ASP.NET MVC3 side

image

The controller side of Chat just renders the “Index view”. The index view has the following javascript code, and it completes the client side part of the chat application

image


Chat feature in Action

imageimage
image
image
image
image


Summary

The objective behind this blog post is just to share the knowledge that I’ve gained in my recent exploration and its just a proof of concept of how to leverage node.js in an MVC3 application. The bottom-line is “Identify and pick the right tool to do the right job”. If you want to play with the source code, don’t forget to clone the repository in my git-hub page.  

245 comments:

  1. Replies
    1. Sure! By the way this is just my exploration on creating a hybrid app by combining two different technologies.

      Delete
    2. Rails is basically a web application framework, which is consist of everything needs to create database baked web application. It helps the developers to create websites and applications by providing structures for all codes written by them. Moreover, common repetitive tasks are simplified with the help of this technology.
      ruby on rails software house
      Popular rails gems and APIs
      Websites made with ruby
      Best ruby gems 2019
      React native and React Js
      Node Js and React Js

      Delete
  2. I don't see how you used MVC in this, you're just rendering a view, which you can do in normal HTML...

    ReplyDelete
    Replies
    1. Good catch Rami. To keep the blogpost simple, I didn't focus much on MVC side of the app and it could be any app. The intention of this blog post is how to make use of node.js from an MVC application.

      Delete
  3. The exploration on hybrid application using ASP.NET MVC3 and Node.js in two different Technology using with normal HTML is very useful..

    ASP.Net Development India

    ReplyDelete
  4. i dont know how to execute this application ...please can u explain step by step procedure....

    ReplyDelete
  5. Node.js framework framework allow web developers in writing the server side scripting code in JS and it seems like Microsoft has helped the developers in number of ways as they have kept all the essentials in one place so that developers can get everything at one place. The team member at Microsoft Web Platform team support states the thought behind the invention as "Not re-ding the things that has been done at once and doing well"

    ReplyDelete
  6. Thank you for benefiting from time to focus on this kind of, I feel firmly about it and also really like comprehending far more with this particular subject matter. In case doable, when you get know-how, is it possible to thoughts modernizing your site together with far more details? It’s extremely useful to me.
    python training in annanagar
    python training in chennai
    python training in chennai
    python training in Bangalore

    ReplyDelete
  7. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.
    Devops Training in Chennai

    Devops training in sholinganallur

    ReplyDelete
  8. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
    Blueprism training in tambaram

    Blueprism training in annanagar

    Blueprism training in velachery

    ReplyDelete
  9. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.
    angularjs Training in bangalore

    angularjs Training in btm

    angularjs Training in electronic-city

    angularjs online Training

    angularjs Training in marathahalli

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. It is a great post. Keep sharing such kind of useful information.

    Article submission sites
    Technology

    ReplyDelete
  12. Great informative bog. Thanks for sharing such a valuable information with us.

    Article submission sites
    Education

    ReplyDelete
  13. Nice blog..Really informative and useful more..Thanks for sharing..Keep update php training in chennai

    ReplyDelete
  14. Thank you for sharing your article. Great efforts put it to find the list of articles which is very useful to know, Definitely will share the same to other forums.

    best openstack training in chennai | openstack course fees in chennai | openstack certification in chennai | redhat openstack training in chennai

    ReplyDelete
  15. Hey, Wow all the posts are very informative for the people who visit this site. Good work! We also have a Website. Please feel free to visit our site. Thank you for sharing. AngularJS Training in Chennai | Best AngularJS Training Institute in Chennai | AngularJS Training in Velachery |Angular4 Training Institute in Chennai

    ReplyDelete
  16. Very nice post here thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    best training insitute for machine learning
    best machine learning institutes in chennai
    top institutes for machine learning in chennai
    Android training in velachery
    PMP training in chennai

    ReplyDelete
  17. This comment has been removed by the author.

    ReplyDelete
  18. This is Very Useful blog, Thank you to Share this.
    Social Media Marketing Chennai

    ReplyDelete
  19. This information is impressive; I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic.
    oppo service center chennai
    oppo service center in chennai
    oppo service centre chennai

    ReplyDelete
  20. I am obliged to you for sharing this piece of information here and updating us with your resourceful guidance. Hope this might benefit many learners. Keep sharing this gainful articles and continue updating us.
    mobile service centre
    mobile service center in chennai
    mobile service center chennai

    ReplyDelete
  21. Nice Article…
    Really appreciate your work
    Motivational Status

    ReplyDelete
  22. Just seen your Article, it amazed me and surpised me with god thoughts that eveyone will benefit from it. It is really a very informative post for all those budding entreprenuers planning to take advantage of post for business expansions. You always share such a wonderful articlewhich helps us to gain knowledge .Thanks for sharing such a wonderful article, It will be deinitely helpful and fruitful article.
    Thanks
    DedicatedHosting4u.com


    ReplyDelete
  23. This comment has been removed by the author.

    ReplyDelete
  24. Thanks for the Valuable information.Really useful information. Thank you so much for sharing.It will help everyone.Keep Post. Find Some Indian Memes. Interesting News Viral News Some Life hacks tipsLife hacks Entertainment News Find Some Viral News Here.Viral News

    ReplyDelete
  25. Rails is basically a web application framework, which is consist of everything needs to create database baked web application. It helps the developers to create websites and applications by providing structures for all codes written by them. Moreover, common repetitive tasks are simplified with the help of this technology.
    ruby on rails software house
    Popular rails gems and APIs
    Websites made with ruby
    Best ruby gems 2019
    React native and React Js
    Node Js and React Js

    ReplyDelete
  26. Rails is basically a web application framework, which is consist of everything needs to create database baked web application. It helps the developers to create websites and applications by providing structures for all codes written by them. Moreover, common repetitive tasks are simplified with the help of this technology.
    ruby on rails software house
    Popular rails gems and APIs
    Websites made with ruby
    Best ruby gems 2019
    React native and React Js
    Node Js and React Js

    ReplyDelete
  27. nice and well defined article, click for more entertainment news

    ReplyDelete
  28. I liked your article very much, you continued to share posts of this type.
    Visit our website for Nation, Internation, Sports Hollywood, Bollywood News.
    Raghnews

    ReplyDelete
  29. Thanks for sharing such an awesome Information with us

    I Got Job in my dream company with decent 12 Lacks Per Annum salary, I have learned this world most demanding course out there in the current IT Market from the Hadoop course in Bangalore Providers who helped me a lot to achieve my dreams comes true. Really worth trying.

    ReplyDelete
  30. Nice post
    Coding is used in every website
    Python is used in leadmirror
    To know your blog rank visit leadmirror

    ReplyDelete
  31. good..I would like to thank you for sharing this valuable information
    big data training in chennai

    ReplyDelete
  32. Very Informative blog...Glad to find your blog...Keep Sharing...
    Testing & Training on Selenium

    ReplyDelete
  33. Thank you for sharing valuable information. Thanks for provide great informatic blog, really nice required information & the things i never imagined. Thanks you once agian Download Poweramp Pro Apk

    ReplyDelete
  34. NICE...
    "https://www.kaashivinfotech.com/internship-for-bsc-students/"
    "https://www.kaashivinfotech.com/best-final-year-project-in-information-technology/"
    "https://www.kaashivinfotech.com/ccna-training-in-chennai/"
    "https://www.kaashivinfotech.com/robotics-training-in-chennai/"
    "https://www.kaashivinfotech.com/internship-for-ece-students/"
    "https://www.kaashivinfotech.com/ccna-training-in-chennai/"
    "https://www.kaashivinfotech.com/python-internship/"
    "https://www.kaashivinfotech.com/industrial-visit/"
    "https://www.kaashivinfotech.com/industrial-visit/"
    "https://www.kaashivinfotech.com/industrial-visit/"

    ReplyDelete
  35. Thank you for such a nice article keep posting, I am a Regular Visitor of your website.
    lucent gk pdf

    ReplyDelete
  36. Wow What A Nice And Great Article, Thank You So Much for Giving Us Such a Nice & Helpful Information, please keep writing and publishing these types of helpful articles, I visit your website regularly.
    Lucent GK

    ReplyDelete
  37. Thank you for your good information
    I will always support you to do your best in everything.
    I hope to have a good exchange in the future
    먹튀검증사이트


    ReplyDelete
  38. This comment has been removed by the author.

    ReplyDelete
  39. This comment has been removed by the author.

    ReplyDelete
  40. This comment has been removed by the author.

    ReplyDelete
  41. This comment has been removed by the author.

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. This comment has been removed by the author.

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. This comment has been removed by the author.

    ReplyDelete
  46. This comment has been removed by the author.

    ReplyDelete
  47. Wow What A Nice And Great Article, Thank You So Much for Giving Us Such a Nice & Helpful Information, please keep writing and publishing these types of helpful articles, I visit your website regularly.
    easy diy room decor ideas

    ReplyDelete
  48. I Check your site your site is very good site thank you so much share amazing article 먹튀검증

    ReplyDelete
  49. Nice information, you write very nice articles, I visit your website for regular updates.
    student database management system

    ReplyDelete
  50. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched.
    Visit Giant Brand Solutions
    wordpress bundle
    wordpress themes and plugins
    premium wordpress themes and plugins
    wp starter pack
    wordpress theme update
    wordpress update plugins
    wordpress website themes
    worpdress theme sites
    wordpressbundle
    wpstarterpack

    ReplyDelete
  51. I must appreciate you for providing such a valuable content for us. This is one amazing piece of article. Helped a lot in increasing my knowledge.

    oracle training in bangalore

    sql server dba training in bangalore

    web designing training in bangalore

    digital marketing training in bangalore

    java training in bangalore

    ReplyDelete
  52. Nice blog,
    Thanks for sharing the information. Please visit respicare for treatment of respiratory problems. Link:https://respicareindia.com/asthma/

    ReplyDelete
  53. waooo helpfull article i love it
    https://www.mediamitra.in/

    ReplyDelete
  54. nice.....
    https://www.kaashivinfotech.com/internship-in-pune-for-computer-engineering-students
    https://www.kaashivinfotech.com/summer-training-for-3rd-yr-electronics-and-communication-engineering-students
    https://www.kaashivinfotech.com/internship-for-cse-students
    https://www.kaashivinfotech.com/internship-in-indore-for-computer-science-students
    https://www.kaashivinfotech.com/internship-for-automobile-engineering-students
    https://www.kaashivinfotech.com/internship-for-eee-students-in-bangalore
    https://www.kaashivinfotech.com/internship-for-civil-students
    https://www.kaashivinfotech.com/internship-for-automobile-engineering-students
    https://www.kaashivinfotech.com/robotics-training-in-chennai
    https://www.kaashivinfotech.com/best-final-year-project-in-information-technology

    ReplyDelete

  55. Class College Education training Beauty teaching university academy lesson  teacher master student  spa manager  skin care learn eyelash extensions tattoo spray


    ReplyDelete
  56. Techsquad - Dubai based laptop repair company

    Techsquad provide laptop repair service across Dubai,
    if you have any kind of laptop or desktop,
    We repair all of them, we repair laptop like gaming, macbook,
    Our certified engineers can provide you satisfactory service,
    Our Laptop & Desktop Repair Service in Dubai is famous for our great service experience.
    This service is available for all over dubai, our 24x7 service is ready to help you all the time,
    Our price is also affordable,
    We can provide laptop fix service at your doorstep.

    laptop fix

    ReplyDelete
  57. As stated by Stanford Medical, It is really the SINGLE reason this country's women live 10 years more and weigh 42 lbs less than we do.

    (And really, it is not related to genetics or some secret exercise and EVERYTHING to around "how" they eat.)

    BTW, What I said is "HOW", and not "WHAT"...

    CLICK this link to reveal if this quick questionnaire can help you find out your true weight loss possibility

    ReplyDelete
  58. Nice and superb article. Good luck.
    Please Check this out.
    Crufts 2020 Live Stream and TV Coverage Schedule
    I hope you will provide this type of post again.

    ReplyDelete
  59. Nice and superb article. Good luck.
    Please Check this out.
    Crufts 2020 Live Stream and TV Coverage Schedule
    I hope you will provide this type of post again.

    ReplyDelete
  60. very nice Thank you a lot for providing individuals with a very spectacular possibility to read critical reviews from this site 카지노사이트.

    ReplyDelete
  61. Thank you for your good information
    I will always support you to do your best in everything.
    I hope to have a good exchange in the future
    Spot News 18
    Ravi Shastri

    ReplyDelete
  62. This comment has been removed by the author.

    ReplyDelete
  63. Very good post, keep sending us such informative articles I visit your website on a regular basis.
    play with advanced maths by abhinay sharma pdf

    ReplyDelete
  64. Pretty article! I found some useful information in your blog....

    so here we provide,

    We provide you with flexible services and complete hybrid network solutions. It can provide your organisation with exceptional data speeds, advanced external security protection, and high-resilience by leveraging the latest SD-WAN and networking technologies to monitor, manage and strengthening your organisation’s existing network devices.

    https://www.quadsel.in/networking/>
    https://twitter.com/quadsel/
    https://www.linkedin.com/company/quadsel-systems-private-limited/
    https://www.facebook.com/quadselsystems/

    #quadsel #network #security #technologies #managedservices #Infrastructure #Networking #OnsiteResources #ServiceDeskSupport #StorageServices #WarrantyAMCServices #datacentersolutions #DataCenterBuild #EWaste #InfraConsolidation #DisasterRecovery #NetworkingServices #ImagingServices #MPS #Consulting #WANOptimisation #enduserservices

    ReplyDelete
  65. Nice information, you write very nice articles, I visit your website for regular updates.
    hindi grammar pdf

    ReplyDelete
  66. such a nice post thanks for sharing this with us really so impressible and attractive post
    are you searching for a caterers service provider in Delhi or near you then contact us and get all info and also get best offers and off on pre booking.thanks a lot.
    Ai & Artificial Intelligence Course in Chennai
    PHP Training in Chennai
    Ethical Hacking Course in Chennai Blue Prism Training in Chennai
    UiPath Training in Chennai

    ReplyDelete
  67. Thank you for such a nice article keep posting, I am a RegularVisitor of your website.
    north goa

    ReplyDelete
  68. Nice information, you write very nice articles, I visit your website for regular updates.
    south delhi

    ReplyDelete
  69. Hey Nice Blog!!
    Thanks For Sharing!!! Nice blog & Wonderfull post. Its really helpful for me, waiting for a more new post. Keep on posting!


    web development
    website development company
    web development company

    ReplyDelete
  70. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information,this is useful to me.

    Teradata Online Training

    Teradata Classes Online

    Teradata Training Online

    Online Teradata Course

    Teradata Course Online

    ReplyDelete
  71. I'm a long-serving digital marketing professional and full-service as a social media marketing manager. I'm offering services at a competitively low cost. I have experience in keyword research, Article writing or Rewriting, Guest posting, B2B Lead Generation , Data Entry ,link building, web 2.0 backlink ,
    . I have 5 years of experience in the field and are assured of delivering High Quality and manual work. I have my own site name as AbidhTech. My Blog site also here. This is a Bangla deshi Science club site .

    ReplyDelete
  72. I'm a long-serving digital marketing professional and full-service as a social media marketing manager. I'm offering services at a competitively low cost. I have experience in keyword research, Article writing or Rewriting, Guest posting, B2B Lead Generation , Data Entry ,link building, web 2.0 backlink ,
    . I have 5 years of experience in the field and are assured of delivering High Quality and manual work. I have my own site name as AbidhTech. My Blog site also here. This is a Bangla deshi Science club site .

    ReplyDelete
  73. https://www.magnificentincense.com/

    ReplyDelete