I build web apps using ASP MVC and I am looking at using ReactJS. I have seen a few examples of React integrated into an ASP.NET MVC project and I don't really see the value over SignalR, which is what I use now for all real-time updates and communications.
I am hoping someone can go over the benefits of using React vs SignalR or even why I should be using React. Its popularity makes me think there is more to it that I'm just not seeing and I would hate to fall behind if it is more powerful and can help me do more.
Thank you for your responses!
React is used to build a single page apps or SPA, this will give you a desktop like UI, if you want it to be more interactive, then you can use it with SignalR to receive real time updates from the back end.
Facebook site alone is the idea of React, ex: responsive, no page refresh.
Integrating it with something like SignalR, adds the real time notifications about comments and posts
You should'nt compare apples and oranges.
React is a JS Library for building User Interfaces and SignalR is an abstraction, which will help you to send messages from server to client (also the other side).
Related
We have a ASP.NET MVC website built that's optimized for the Mobile and Tablet devices using Responsive design.
We would like to reuse/package these views into a Phonegap application for creating iOS/Android/Windows apps.
Our initial thought was to have skeleton views in the Phonegap project and serve the content (including markup) remotely from the ASP.NET MVC website. However, my understanding is that Apple may not approve an app with such an architecture.
Any thoughts on how to design the Phonegap app is really appreciated.
As you hint at, Apple generally discourages websites masquerading as native apps via thin shells. See this SO for some discussion:
Does Apple reject "mobile web shell" applications?
For the current app I am working on, I do all my development by serving through Apache and testing in Chrome. I test on device by wrapping the same set of html/cs/js files with Cordova build process and pushing to device. The only reason that wouldn't work for you to is you must have a bunch of server side logic and conditional rendering of your views.
So either you:
1) Just go for it and try to submit a simple native wrapped website and very well may get approved no problem
OR
2) My recommendation is to do a little reworking of your view designs/interactions such as including a native-mobile-app style navbar, etc. so that the experience is more similar to an app than a web site. Then with your new client/app Views, swap out the server side Controller/Model interactions with a Rest/JSON api.
For example, currently you have something like this:
//Server side
class mainController
{
void fooAction()
{
string bar = getModelThatIncludesBar().bar;
...
renderView($bar, 'fooView');
}
}
Instead, more like this:
// Client side, poor mans MVC
bar = useAjaxToGetModelThatIncludesBar().bar; // pretend this is synchronous :)
...
fooViewElementThatNeedsBarData.innerHtml = bar
Edit: I have drastically simplified things here to try to distill it down to the basic two choices I see. Message me or whatever if you want to chat about it.
My suggestion is you need to separate your client and server side language. Then convert your server side language into web service either SOAP or REST so your client side can send and receive data from your server. Phonegap is allowed client side language only.
To resume, I am developing a web application with Jquery mobile and I have a list of people from the same enterprise. I was asked if by one click on a person, the application could launch a chat via lync.
I did some research and I found that : https://ucwa.lync.com/documentation/what-is-lync-ucwa-api.
That API allow use to use Lync by adding C# code into the application, but my problem is that I have only HTML / CSS / JS for this project.
I think the only way for me would be to launch chat on the mobile or webversion of Lync from my application, do you know if it possible ? I can find an answer.
Thanks for your futur advice !
if you only need IM and presence (i.e. no audio/video) then UCWA is ideal. It's a rest-based API, so there's no dependency on clients using C# to call it. As I remember, the documentation on the UCWA site is pretty good
I know it's late but, i've an experimental java api which can communicate with Lync 2013 UCWA. Here is the github page
You are welcome to fork it.
I have an MVC web app that uses a jquery web request to generate the users notifications in a perceived async way. The notifications are built on request by each user on the site.
However I have been asked to make the notifications readily available as the happen.
This I would traditionally do using a windows service that called the same web method over http. I was thinking that this might be a good candidate functionality for using node.js
Is the any example code to call a http method in a loop and would that scale well ?
found this package and seems to do what i needed
https://npmjs.org/package/node-cron-jobs
I also came across "forever" to run node as a child process that can be re-spawned if there are errors
If you're already running on ASP.NET MVC take a look at SignalR. This was written by Microsoft, is supported by them and provides functionality similar to the Socket.IO, node.js stack.
I'm working on a web application that uses django.
I would like to create a native application of the site for ios / android using phone gap.
Is this possible? As I understand native devices cannot interpret python code.
It is early in the project and if it proves too difficult I may go with a different framework I.e backbone.js.
Any thoughts / experiences?
That's right, you cannot run python code on iOS or Android using PhoneGap, but there is no need to do that. Yes, you can build a native mobile application of your site using PhoneGap.
I'll try to explain a bit how these technologies compare to each other:
Django is a python web framework running on a web server
PhoneGap is a framework for building native mobile applications using web technologies (HTML5+CSS+Javascript), the application will run on a mobile device
One common approach is to build the mobile UI with i.e. jQuery Mobile and use the Django web application to provide a RESTful API to get data to the application.
Take a look at this another question for more details.
Edit: Answer the question in the first comment
Yes, it's possible to build a fast and well working application with these frameworks. The performance with today's smartphones is more dependent on the quality of the implementation than i.e. jQuery mobile and Django in themselves.
Basically with PhoneGap there are three different ways for showing the content to the user:
server side generated pages
pages generated on the client side with Javascript usin data from the server, transferred in a predefined format using for example JSON
a combination of the previous two
This answer clarifies server-client communication and page rendering quite well.
You could use PhoneGap a bit like a constrained web browser, and basically show content directly from your server as you would when the user accesses the site with a normal web browser. But I don't recommend this, though. This approach has many downsides to it (i.e. what happens when the user opens a link from your website leading to another website?)
To be accurate, at least in my opinion, UI written with Javascript and running inside an app built with PhoneGap is not native. Comparing native applications and PhoneGap applications is another thing, here is one take on explaining the differences.
I don't know what kind of service you are building, but in general I'd suggest evaluating the different approaches before starting to build an application. Would a responsive mobile optimized web site do or is there real need for what an app can provide?
If you decide to build an app with PhoneGap, I'd suggest that you do it with client side Javascript and fetch the data from the Django backend with XHR requests in JSON format. There are lots of examples available in the internet.
General question:
If I wanted to develop a web site, say ASP.NET MVC (the only web framework I am familiar with), is it generic enough so I can use it to have later apps for iOS, Android, obviously Windows Phone?
I mean I will need to connect somehow to SQL server that is the backend of the ASP.NET MVC web site etc. What are technical difficulties & considerations I need to take into account so that app is generic enough.
Note that I am planning it to be multilingual and will use ASP.NET resources to support that.
Or should I learn completely different framework to have it generic over multiple platforms?
Thanks in advance!
ASP.Net is generic enough. You can expose REST endpoints (although WebAPI is probably better to do that, but you can run that alongside, and consume from, MVC), create full user interfaces, etc.
However, if you are planning a write-once, run-anywhere application to avoid having to develop native device apps (e.g. Android and IOS), make sure to take the time to read this excellent (but long) article.
The MVC framework can definitely be used for mobile devices (when you say apps, I am assuming you mean websites that function as apps), and MVC 4 introduced significantly more support for mobile development, including things like templates (http://www.asp.net/whitepapers/mvc4-release-notes#_Toc303253809).
MVC is a move to a less heavy handed framework than, for example, Webforms, and it should give you the flexibility to develop for any device. However, it does also open you up to coding yourself into some problems if you approach it in the wrong way, so make sure you are familiar with the framework before trying to develop some super next-gen responsive web app.
You can expose your ASP.NET MVC controllers to other platforms, like web services or Web API, so the client, IOS, Android or anything else can call your services.