Linking C# desktop app with Rails web app [closed] - c#

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I have a Windows desktop application (developed with C# using .NET 2.0 framework) that I would like to connect to a rails web app. The scenario would ideally work as follows:
User runs the Windows desktop app and generates some results. The desktop application then uploads the results to a database that the Rails web app can manipulate and do interesting this with (for instance, make pretty graphs).
My experience with .NET is limited but I have a fairly strong background in RoR. I am currently tripped up on which type of database to use as well as how to make the two applications manipulate the same database. Any suggestions?

You can use any database that's available to you. .NET or ROR will not limit your options.
You can have the rails app poll the database for said data (Not so good). OR you could develop a web service and have the desktop application call it to trigger the data manipulation.
Web services on rails.
How to consume webservices in C# winforms
More on consuming web services in C# winforms

"I am currently tripped up on which type of database to use"
Name your poison! :) You can talk to practically every database on the planet from both .NET and Ruby/RoR, including:
Relational databases like SQL Server, DB2, Oracle, MySql, ProgreSQL, etc.
Document-databases like MongoDB, CouchDB, RavenDB, etc.
Other NOSQL key value stores including Cassandra, Dynamo, Riak, Redis, Memcache, Azure Table Storage, etc.
Pick one that meets your needs and go for it.
"how to allow communication between the two applications"
I am not quite sure what you mean by this, but I'll assume that you mean that at some point, after uploading its data, your app should open a web page displaying a nice graph of the data? If so, this is trivial and requires no direct integration between your .NET app and your RoR site other than your .NET app spawning an instance of a web browser, and asking it to open a given web page:
var process = new Process();
process.StartInfo.FileName = "iexplore";
process.StartInfo.Arguments = #"http:\\myreportgenerator.com?customerid=1234";
process.Start();
If you want your .NET app to be able to ask your RoR site to do specific things, then consider adding a REST web services API to your RoR site.
Go one step further and you could actually eliminate all DB code from your .NET app and just have it ask for and send data to your RoR site via REST (JSON/XML over HTTP) calls, performing all DB IO internally.

The database can be anything you want that both .NET and RoR can communicate with. I'm not a RoR expert, but .NET can talk to just about any db you want.
The communication between the apps happens via the database. You insert / manipulate the data via the C# app, then read the data and process it with the RoR app. There really should be no direct (app to app) communication between the two apps.

Related

when to use wcf and asp.net? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I want to do an application that use a database and can show the information in datagrids, execute commands with buttons and so on. I want to do it inside the lan and outside the lan.
I think that i have two options. Create a desktop application that use wcf to connect with the service to access to the database. The second option is create an aso application, so I can access to the database with any browser through internet.
Are the two options a good solution? What are the pros and cons of wcf and pros and cons of asp.net?
When to use asp.net and when wcf?
When you only have one client and your only need is to access it via LAN and internet then developing an ASP.NET application is less overhead. This because you don’t need to setup an extra service that you need to configure and secure. On the other hand creating a good UI for an ASP.NET application can be much harder than just a WinForm of WPF application (depending on your UI-needs).
But…. What if you’re planning new clients in the future? Maybe a (native) mobile app or another (windows/web) client for a different group of users with different needs? Then a web service give you some advantages…
For example you want to make a new Windows Phone application (in addiction to your web application) for some CRUD operations.
When you write all the database logic and business rules in you web application you can’t use it directly in you Windows Phone. Okay you can maybe you can use the assembly if it is compatible with that .NET framework profile. But what if you want to create an Android application without using Xamarin or something similar. Than you can’t use the assembly’s from you web application and you need to rewrite your logic again… When you had a web service (for example a REST web service) you can call the service for all the database and (shared) business logic. And you don’t need to care about if its working the correct way. As you probably can see maintainability can also be an advantage of a web service because all the logic is centralized in the service.

Very simple web service: take inputs, email results [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I work at a small startup as a Data Scientist, and I'm looking for ways to make my analysis a bit more visible/useful to the organization. I'd like to be able to put up a simple web service which allows internal users to run my scripts remotely. They should be able to input a few parameters via a very simple UI, and they should have the option to have the results appear in the browser window (after a possibly long wait), or have them emailed. Results may be a few pdf figures, and they may be Excel spreadsheets (maybe more exotic in the future, but this is it for now).
The scripts are going to be all in Python, which will handle the analysis.
So, I'd like to know what the pros and cons are of using C#/WCF vs. something like Django or Python. I have significant experience in C# working in the Client-side code base here, but I have much less experience with WCF. All of my analysis work is done in Python (and R, to a lesser extent). The main goal is to not take all of my time building a fancy web service/UI---the front end just has to be friendly enough to not intimidate the marketing people. I don't have to worry about encryption, the server will be behind our firewall. I'm pretty platform agnostic, but I think the servers are all Windows based, if this helps.
Thanks in advance.
For extra credit, how does your answer change if some of my scripts are in F#?
You might consider using the Django web framework. You could set up a small app with your python scripts as different views. https://www.djangoproject.com/
And if you don't want to put that much effort into creating a friendly UI you could use twitter bootstrap. http://twitter.github.com/bootstrap/
Then just run the app internally to gather and display data either via HTTP GETs or via e-mail.
edit: I'm sorry I did not read carefully "pros and cons are of using C#/WCF vs. something like Django". I recently made a Django app and it was fairly straight forward.

Three-tiered application in .net [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm currently studying MCPD at a local college facility and I have formed the bases that my lecturer knows little about his/her subject.
Here's the project we got from another lecturer in the area.
(It's in VS 2010 and via C#)
Create a 3 tier application for facilitators to handle students/
1 (Create a DB) <---- This Is easy enough and actually made sense. Did this without a sweat
2 - Create a DataLayer - This must be a DataService
2.1 Add an .edmx model to your DataService that is generated from the database that you have created in step 1
2.2 Add the following Queryable service Operators:
2.2.1 GetStudent() - Lists all students from the Database
<<<<-- AND 5 MORE Queries here-->>>>
2.3 - Give all Your clients Read rights only to all your entities.
2.4 - Give all your clients read/writes(Yep I quoted from the page) rights to all your service operations and student Entity.
2.5 - Configure your Service1.svc file to work with the System.Data.Services.DataServiceHostFactory
3 - Create a Wpf Application
3.1 Enable the Users to view Students, Qualifications and so forth based on their login.
3.2 Create functionality to allow facilitators to ad new Students using an xml file.
3.3 Must create an Add using xml or Add using text files window.
Now, my disclaimer : I'm absolutely no specialist or anything good. I have 4 years experience in WinForms with databases. So that's some very limited knowledge.
BUT: the limited knowledge I have.. tell me that nr 2. wants a web service or something of the latter and then not use it and rather use a WPF app to communicate to the DB.
Now as I am willing to insult the thought that has gone into this poorly thought out project, I am also willing to accept the fact, should I be wrong or not have understood correctly.
So now, can anyone please explain to me if this project is even feasible or savvy?
If so, I shall gladly accept reasoning and admit my failure.
The description is totally confusing, but my assumption is you're supposed to create a model using EF, then wrap that in a WCF service then have the WPF app communicate with the Web Service.
I don't really see what is wrong here.
Basically you:
create a Database (meh)
create a DataLayer, i.e. a standalone class library containing objects describing every entity in your database (you can possibly use NHibernate/EntityFramework if you want to look cool, or you can simply create objects and define the database queries in separate methods, which just read in Database and returns the objects you defined in your DataLayer, but with details inside)
Create a WPF app which will use this DataLayer as a model, and show a GUI to allow users to browse students (ie. query Database for students, add/edit/delete their details...).
Again, this seems all very basic to me, unless I didn't understand it

When building a multi-tier web application from scratch, should I use WCF for data access? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm about to build a fairly complex web application from the bottom up, and I want to do it the right way with appropriate design patterns (which I haven't always used in the past) and the latest .Net technologies.
My ambition is to start out with a web application, but make it possible for future mobile apps, and third-party application development and plug-ins.
This leads me to my main conundrum: For the web site (which I'm going to build using the MVC pattern) should I use WCF to expose my data model as an API, or should I simply reference my data through a dll (or a separate project in the web application solution)?
Let me back it up and give you some of my other design thoughts, so you know what I'm trying to do, and please come with input and suggestions if any of this seem like the wrong approach:
I want to build my data model using EF and the code-first approach, using design patterns such as Unit of work and Repositories.
I want to expose my data model (1) through an API using WCF.
I want to build a web application using TDD and MVC, where I get my data from my data model (1).
So, given the above, it seems like an additional hassle to have the web application use the WCF API when I can easily access the data model elsewise, simply by referencing it in my web application. In addition, the latter seems easier since I would have immediate access to all the objects in my data model. I can't see how that would be possible using web services? The reason I would want to use a WCF API is that I've heard so much praise for the idea of only exposing your data through an API, no exceptions, in order to truly be able to develop for multiple platforms. What other reasons are there? Can I use anything but Http messages for the WCF? Can I expose objects, and, if so, how?
I feel like a lot of the answers I'm seeking can be found on-line, but I've spent a lot of time looking at the separate pieces of the puzzle and still have a hard time connecting them all to fit together. I hope you guys can help, and that this is a question that can benefit others as well.
As I said, I want to do this the right way, so your input (at any stage of the design phase) is very appreciated.
Thanks!
I'd say build a data API using the new WebAPI framework. That way, anything that can consume a RESTful interface via HTTP can connect to it: http://www.asp.net/web-api
Also, you can set up your project so your Data Model is referenced from a separate project so you don't necessarily have to go over the network in your main web application. The WebAPI project can be separate, but use the common model to make sure things are consistent
Take a look at WCF Data Services (DataService) and WCF RIA Services (DomainService)....which can expose your Entity Model as a service.
http://jack.ukleja.com/wcf-data-services-vs-wcf-ria-services/
This guide can help you decide on how to architect your tiers/layers.
http://apparchguide.codeplex.com/

Which Windows GUI frameworks are currently worth learning? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm planning to write a Windows app to help myself with some exploratory testing tasks (note taking, data generation, defect logging) and I've got stuck at the early stage of choosing a framework/language. My sole experience is with web development and from what I can see, WinForms, WPF, Silverlight, Swing etc are all simultaneously obsolete and thriving depending on who you ask.
While my main aim is to create the app, obviously I'd like to learn something useful while doing so rather than picking up skills with something that's never going to be seen on a project at work. Which Java or C# frameworks would people recommend learning?
Note: consider when this answer was posted (2012). Since then, things have changed a bit, for example Silverlight has been deprecated.
Native Applications
For employment:
Well, nowadays most companies (at least most companies from Oman and the UAE, where I live) are slowly migrating to the cloud. However there are still some opportunities for native app development. The most demanding framework nowadays, is, ( no.. not WPF ), it's Windows Forms!
Why plain old Windows Forms instead of the awesome WPF? One reason, legacy apps. Nowadays most companies only start small scale GUI Application projects, mainly Business applications. For that, WPF will be very expensive since they already have a work-force experienced in Windows Forms, and a lot of legacy code, however for WPF they will have to create a new code-base, and that's pretty risky. So the best thing to keep you employed is Windows Forms.
For new projects: However, if by 'worth learning', you mean, new, ambitious and glamorous. Then WPF may be the best choice for you. It depends on what your requirements are, really.
The Cloud
Now, for the cloud. Java FX and Silverlight are both currently head to head. However Java FX may have an edge since it supports a greater number of platforms. But then again, Silverlight has all the power and resources of Microsoft behind it, and it's ideal for Windows Phone development.
Comparison
For a comparison, here's what you get by each toolkit:
Windows Presentation Foundation:
The power and resources of Microsoft
Ideal for creating new Desktop Applications
Eye candy
Awesome API
XAML, best way to separate design from logic
Create Apps for the Cloud (but they only work on Windows with .NET though)
Windows Phone can run a subset of WPF
Windows Forms:
Used to possess the power and resources of Microsoft, now WPF has that
Ideal for maintaining legacy applications
A well-trained workforce, if you're an entrepreneur
Pretty mature API
Supports more platforms than WPF (through Mono)
Java FX:
Create Apps for the Cloud
Backed by Oracle
Pretty nice API
Cross-platform, runs on most PCs, smart phones are a problem.
Silverlight:
Create Apps for the Cloud
Backed by Microsoft
Pretty awesome API
XAML
Cross-platform, runs on Mac and PC, runs on Windows Phone.
GTK#:
Cross-platform, runs on most PCs, runs on no smart phone.
Backed by the Open-Source world
Endorsed by Mono
Ideal for creating Apps for Gnome.
Swing:
Cross-platforms, runs on most PCs, smart phones are a problem.
Pretty mature
Ideal for creating 2D games, using Java2D
Conclusion
As you say:
While my main aim is to create the app, obviously I'd like to learn something useful while doing so rather than picking up skills with something that's never going to be seen on a project at work.
Well, the frameworks you are most likely to see at work (if you don't for mainstream companies like Microsoft, Oracle, Google etc. ) are Windows Forms and WPF. At least that's what most companies use here. So those are what I recommend. JavaFX and Silverlight also look like they have potential and may be used in the near future.
WPF. Best support for Windows. BTW, it's not obsolete.
One option for you might be to create your application as HTML+Javascript and run it in your desktop application by embedding a browser engine (IE or something else). If you need native APIs, there are mechanisms to make these available to browser's Javascript code.
Java FX 2.0 seems very promising and is now live if swing looks obsolete to you. Note that it has little in common with previous versions. See for example this short comparison with swing. And oracle said they plan to open the source.
Now it is fairly new so unlikely to be used in existing applications.

Categories