|
-
Feb 6th, 2014, 11:43 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] [VS 2012] Framework 4.0 C# Ideas (Winform Webform combi)
Hello all,
Not entirely sure if this is the right section to post to but can anyone point me into the right direction for the following scenario please?
Say I have a windows form application with FSW (FileSystemWatchers). Each having a status: GREEN - Working okay, ORANGE - Working but with warnings and RED for failures.
I want to reflect this status on a web page (ASP.NET C#) and my initial idea was to have the status' stored in a database and have it accessed through the webform and reflect the appropriate colours for it. However, it got me thinking and correct me if I'm wrong, will MVC be a better option for me? or my current idea is good enough? or is there a better way to do this?
Second question is, is there an easier way for the web app to talk to the winform aside from this way?
Hopefully this all makes sense and any help is greatly appreciated!
Thanks,
Please go to the Thread Tools menu and click Mark Thread Resolved when your post is answered 
If someone helped you today then please consider rating their post.
-
Feb 6th, 2014, 09:39 PM
#2
Re: [VS 2012] Framework 4.0 C# Ideas (Winform Webform combi)
I would think , either have a JS timer that will engage a web service,WCF or WEB API that in it's turn will call the database and give back data to the web page, so client JS,Jquery can manipulate, or you can try looking at SignalR.
Maybe MVC will work but i haven't really have a look at it.I tried to do an example and you have to use 3 different layers in order to put a Hello world to the web page. Or it was just me, hating MVC and being forced to use it and then hating it more and dropped the whole thing until i am asked again to MVC something.
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
-
Feb 7th, 2014, 02:04 AM
#3
Re: [VS 2012] Framework 4.0 C# Ideas (Winform Webform combi)
Are you saying that you want the user to view your status indicators in a browser or that you want them to view them in a Windows app with the actual status being delivered over the web? If it's the former then an ASP.NET web application making an asynchronous call based on a timer sounds like the way to go. If it's the latter then do away with the web application altogether and create a web service as suggested above.
Creating a web service removes the choice but, with regards to choosing between Web Forms and MVC for web application, it depends exactly what you want. sapator is quite right that MVC enforces a great deal of overhead for a simple Hello World application but of course it is not intended to be used for such simple things. Web Forms makes certain things easier, especially for beginners, because it tries to emulate WinForms as much as possible, providing a familiar event-driven model. The web is a very different place though, so trying to make it work like Windows presents many problems and these show through when you try to use Web Forms for complex applications.
MVC is based on a paradigm that better suits the nature of the web. Separation of concerns is built into the pattern and it is inherently more testable. I was a Windows developer for many years before I began web development and I always hated Web Forms. It tried to be Windows Forms for the web but such a goal is impossible to achieve and it felt extremely kludgy as a result. Once I started using MVC I started to genuinely enjoy web development because it felt natural. It's something new to learn and takes time and there will be frustration, as there is with any new technology. If you're like me though, you'll be glad that you made the investment.
It's worth noting that many people use MVC or patterns like it (MVP, MVVM) in Windows applications too, to enjoy some of the same benefits that MVC provides in ASP.NET development. MVVM is pretty much taught as though it's part of WPF/Silverlight rather than just a design pattern that can be used when implementing applications in those technologies. Such design patterns that encourage separation of concerns are something that any serious developer should be considering. The smaller your app, the less benefit they provide. They are all but essential at the enterprise level though, where teams of developers need to work on various parts of an application at the same time. Learning how to use them on small applications that don't really need them is much easier than waiting until you have to use them on something big. Anyone serious about ASP.NET development should invest in MVC because that is where Microsoft's focus is truly at in terms of web applications.
Last edited by jmcilhinney; Feb 7th, 2014 at 02:10 AM.
-
Feb 7th, 2014, 06:15 AM
#4
Thread Starter
Hyperactive Member
Re: [VS 2012] Framework 4.0 C# Ideas (Winform Webform combi)
Many thanks for your thoughts and input sapator & jmcilhinney.
I think I will go with the web service idea as I want the user(s) be able to view the status of app (FSW) and get it delivered live onto the web. As for using MVC, like sapator, I tried to create a basic static web page and didn't like it and avoided it since. But I guess I can't always run away from it as more and more clients these days are asking for MVC. Better read up on it!
Please go to the Thread Tools menu and click Mark Thread Resolved when your post is answered 
If someone helped you today then please consider rating their post.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|