What is the difference between WCF and WPF? - wpf

I am a naive developer and I am building up my concepts, I was asked to create a sample application in wcf, and so I am asking a bit subjective question here.
I want to know the diffrence and functionality of the above two, in which terms we prefer one over other?

WCF = Windows COMMUNICATION Foundation
WPF = Windows PRESENTATION Foundation.
WCF deals with communication (in simple terms - sending and receiving data as well as formatting and serialization involved), WPF deals with presentation (UI)

The quick answer is: Windows Presentation Foundation (WPF) is basically a way of displaying user interface. (see this)
Windows Communication Foundation (WCF) is a framework for creating service oriented applications. (see this)
As for which one you should use, it depends on your requirement. Usually an application written in WPF, ASP.NET..etc called the WCF service to do some processing at the server-side and the service returns the result to the application that called it.

Windows Presentation Foundation (WPF)
Next-Generation User Experiences. The Windows Presentation Foundation, WPF, provides a unified framework for building applications and high-fidelity experiences in Windows Vista that blend application UI, documents, and media content. WPF offers developers 2D and 3D graphics support, hardware-accelerated effects, scalability to different form factors, interactive data visualization, and superior content readability.
Windows Communication Foundation (WCF)
Windows Communication Foundation (WCF) is Microsoft’s unified programming model for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate with existing investments.

WPF is your FrontEnd (presentation: .htm, .xaml & .css, ..)
WCF is your BackEnd app (services that involve server connections to acquire data for you to deliver to the FrontEnd to present). You can write WCF for RESTful model.
WebAPI is for building services of RESTful model for 4.+ frameworks.

Basically, if you are developing a client- server application. You may use WCF -> in order to make connection between client and server, WPF -> as client side to present the data.

WCF = Windows Communication Foundation is used to build service-oriented applications.
WPF = Windows Presentation Foundation is used to write platform-independent applications.

Windows communication Fundation(WCF) is used for connecting different applications and passing the data's between them using endpoints.
Windows Presentation Foundation is used for designing rich internet applications in the format of xaml.

Related

To what extent is a possible to write a web application with WPF and are there any advantages of doing so over using ASP.NET / MVC?

I know that it's possible to use WPF for web development but are there any circumstances in which it would be better to use WPF? Or is it more common practice to ASP.NET Forms/MVC?
I know that it's possible to use WPF for web development
Wrong. WPF is part of the .Net Framework. It is a Windows Client technology that requires the target computer to have the .Net Framework installed in order to run.
Web applications consist of a Web Server delivering Web Content (HTML [+Javascript+CSS]) to a Web Client (Browser).
WPF has nothing to do with that. It does not produce HTML or any other Web content and it is not a Server Side technology.
Bottom line:
Use Web technologies (A server side technology that outputs HTML (such as ASP.Net MVC)) if you need to create a Web Application.
Use WPF if you need to create a rich, highly interactive Windows Desktop application.
Use WinRT XAML (similar to WPF) if you need to create a rich, highly interactive Windows "Metro Style" application.
In addition to what #HighCore said, it's possible to use technology similar to WPF in a web environment. For example, Silverlight uses XAML markup. It's kind of similar to a Java applet if you're familiar with those. Silverlight is particularly handy for doing something that requires a lot of graphics or media in the browser, but it's not as full featured as WPF. In addition, you have to hope that the user has a Silverlight plugin which isn't available on all platforms. For example, Linux and mobile have limited or no Silverlight capability.
You could develop a WPF application and deliver it as a ClickOnce application. You're pretty much limited to Windows targets.
If you're trying to develop a website, then stick to ASP.NET Web Forms or MVC or some other server side technology that serves HTML to browsers, as HighCore said.

Can we share Silverlight application with access Db over LAN

I am developing small institute management system as an academic project in my college.
I am going to develop the project in silverlight 4 or 5. In this project I want to provide attendance facility; i.e students will able to log in application from their respective machine which will be connected to LAN. There will be no internet connection available.
Can I develop this application which will not required internet connection once it is installed but can still accessible to different machine which are connected in a network over a LAN
1.How can I achive this?
2. should I use silverlight out of browser app or simple silverlight app
3. Is there any way to achive this using WPF?
After some research I found out the concept called Intranet which should solve my problem of sharing of source code and database.
About what technology should be used:
its better to develop this application in Silverlight as it is nothing but a subset of WPF.
Even better to develop the app in both technology to start with as I can use same XAML for both technology with few or no changes at all.
Connecting to database will be simpler in WPF than in Silverlight, as the later does not connect to the database directly and needs a service to achieve this. This service can be written using WCF or Ria service even in a php.
#Ash,
Silverlight can be desktop oriented, same as WPF. Caveat in some respects is that Silverlight is simplified to utilize Web Services communication, just like Adobe Flash is.
WPF is more oriented to non-Internat (ie Intranet/LAN) connections but pretty much utilizes the same .Net framework as Silverlight.
Although Silverlight is more platform independent than WPF, they operate the same.
You can take a Silverlight application and transition it to WPF with little to no changes (pending on the complexity of your application) to the code-base.
One benefit for WPF over Silverlight is the ability to utilize Click-Once deployment and Version control. Although you can implement a Click-Once styled Silverlight deployment it doesnt work the same as the majority of the Click-Once deployment models out there for the Desktop applications.
I hope this helps you.

Silverlight and n-Tier Development - -How is it done?

I've asked several questions on Silverlight the last day or two (I have no experience with it), and I've had some high-level questions answered. I have another high-level question. How is N-Tier development done with Silverlight? What I am considering is a browser based UI and then a c# back-end containing all the business logic and database code. How would a Silverlight client application communicate with such a back-end sitting on another server? Would it be done via Web service calls, WCF or something else? What is standard practice?
Thanks!
For the projects I've worked on. Typical practice is Silverlight providing a client and then communicating back to the back-end via WCF services.
The business logic is then spread/duplicated across the client and the backend.
You'll want to be looking at the WCF RIA Services for this. In combination with Entity Framework this will approach the sort of thing you need.
The Entity Framework creates model that you can extend and include some business logic.
The Domain Services then allow you to expose access to the model and any other range of operations you need via WCF.
The tooling that RIA Services adds to the Visual Studio will dynamically create in the Silverlight application the client side of this Domain service. There is even a provision for you create C# source that is shared by both by both Silverlight and the server code.
If its Silverlight 3 RIA is a better choice to work with. AnthonyWJones has pointed it right, There is a provision to have a shared Source between Client and Server usually Entities code should be shared in both Client and Server to get full advantage of RIA validation and other stuff.

Silverlight 3.0 out of browser versus WPF/Windows App - Summary of differences?

With the new Silverlight 3.0 feature that allows the components to be hosted outside of the browser, our company is looking for details on the differences between this new feature and WPF Windows applications (since Silverlight is partly a subset of WPF).
Is there a good resource that lists the differences between Silverlight 3 outside of the browser and WPF applications? Areas like permissions, functionality, etc.
If there is no web resources, what are some of the key differences?
Silverlight OOB applications have the exact same capabilities as an in-browser Silverlight application, except they lose their ability to communicate with the DOM (via the System.Windows.Browser API).
Here is a brief list of some common things that you don't have access to with Silverlight that you might be planning on using in a WPF application:
Client File System
Client Windows registry
Client Event Log
Client OLEDB
Client SQL Client
This may seem like a long list but it should look fairly familiar to the no-can-do list for any web application platform (a la ASP.NET, JSP, PHP)
Jaime Rodriguez has a very good post covering the key differences and features of both Silverlight and WPF: Here. It's very high level and meant to differentiate between features that a WPF and Silverlight Out-of-Browser application bring to the table.
markti is correct.
Scott Barnes - Rich Platforms Product Manager - Microsoft.

Incorporating a Windows Mobile, a Silverlight and a Web project under a common DAL (Ria Services)

I am in the beginning of my thesis, and I have to implement a solution about aggregating reports, obtained by a Windows Mobile application, to a central storage. Then, the available data are going to be presented through an Entity Framework model, using RIA services as a data access layer, for the Silverlight project. Can I utilize the RIA services, for the windows mobile communication? How can I persist business objects at the windows mobile application, through the same DAL? Is it possible, or should I simply write explicitly the appropriate methods for the mobile side?
Indeed you can; depending on your DAL, it may or may not be able to serialise to a compatibile format on all devices. Assuming it can't, you can always translate them into 'Portable' objects pretty easily.

Resources