How to use 3 tier architecture using WPF forms? - wpf

I am just starting with a new project. I have some forms which stores data and some reports. I have decided to use WPF for the purpose. I am new to WPF, so needs help. I need some sample application of WPF which stores the data in database using 3 tier architecture.
I need guidance on following points:
How to use 3 tier architecture
using WPF?
Do i need to use WCF alongwith WPF? Advantages and disadvantages??

The usual way to do something like 3-tier architecture in WPF is called Model-View-ViewModel, you should check that out.
You don't need to use WCF with WPF. I think that unless the benefits of having application tier on a different computer are significant, you should keep it on the same computer and use it as a library directly from your presentation code.

Looks like that you are talking about enterprise application architecture which contains 3 tiers (UI, BL, DB)
And WPF is a UI (frontend) technology.
So if you want to make some nice application, for UI you can choose WPF, for server communication(if you need it) use WCF services and DA layer should be at server side.
Possibly if your application is highly dependend on server, you can choose silverlight, or event ASP.NET application(there are many nice report controls).

Related

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.

Move Desktop application to .NET web application - Silverlight or Telerik controls

Our client has a Desktop application (VBA and Access) that they are using for the past 10 years and it is buggy and they want to upgrade it. I want to use the latest MS technologies and plan to make this a web application using .NET 4.0, C#, SQL server and MVC running on the Intranet.
Since the application has many visual components (about 10 different tabs on top and each tab has atleast 10 different controls on it), I was wondering what is the best way to implement the UI layer a .NET web application. The 2 candidates are Silverlight and Telerik controls (we have license for this).
Some issues to consider :
Silverlight Plug-in : Since this new application will only be used internally on the intranet, I dont think installing a Silverlight plug-in will be an issue. Also, since its on the intranet, hopefully download speed should not be an issue for SL apps.
Telerik-MVC : It is really rich in functionality, however, I played around with it (.NET version not MVC) using some of the controls and if there is anything out of the recommended way to use a control, its a pain to get it working.
Skill-set : Do I want to learn how to use a tool (Telerik) or would I be better off learing a technology (Silverlight) in terms of future projects.
I would like to hear any feedback/ issues to help me decide which way to go.
If you are replacing a desktop application then going with Silverlight may be the best approach.
With Silverlight you are writing an application that happens to be delivered across the internet (well intranet in this case). This can be as stateful as you need to be. You have good access (no pun intended) to the database via the WCF RIA Services.
There's also the Prism MVVM model you can develop on top of.
However, I'd double check with the client as to what they are expecting.
Telerik also do a set of Silverlight controls.
If the project time permits, go for Silverlight. Also, if needed, it's possible to create a desktop version (WPF) out of the Silverlight project.
Issues with Telerik control set(or any control set), if you need a control that doesn't exist in the current set, you'll have to either buy from Telerik, or create your own. In the latter case, the whole UI aesthetics might break because it's not easy to create a control matches the tool set.

Silverlight, WPF or Windows Forms?

I need to create a desktop application for Windows and I'm in doubt about which technology to choose. Fact is that the application must do interaction with local resources:
Communication with SQL (need support for SQLite and MSSQL - local and remote, and would love to use NHibernate; maybe even with Castle's ActiveRecord)
Interaction with equipment connected via Bluetooth, Ethernet, USB and Serial (COM) port. I need to read a byte stream from sensors that connect via different protocols.
Preferably I'd go for Silverlight 4, and allow the application to run on the desktop with Full Trust. But I foresee problems with regards to these two requirements. Is there any solution for SL4, and if not, what alternative should I choose? I'm not limited to WPF or WinForms, but since it should run on .NET, I'm more or less limited to these 3 options (or am I?)
With a Silverlight app, you won't be able to connect to a SQL source without creating a service + you won't easily (or at all?) have access to the local resources such as COM port. If your app is intranet based, I'd go for WPF and click once deployment.
After you understand how to use WPF/Sliverlight controls, templates and data binding you will never want to touch WinForms again - it's not only that WPF/SL gives you a richer UI possibilities they just make it easier and less error prone to create applications (especially data-binding).
And it looks like you need relatively low level hardware access, even if it's possible with SL it will be easier with full .net
So, I would choose WPF
Just remember WPF/SL have a learning curve, if you never built a WPF project budget some time to learn the platform.
WPF would be your weapon of choice.
API-wise, WPF basically is a superset of Silverlight. Moreover you are in full control and have complete access to local resources.
If you are into .NET 4.0, you would probably enjoy Entity Framework, as an alternative to NHibernate. Not that it exceeds NHibernate in any way, but it integrates beautifully and comes with the package.
But, as Nir also stated, there's a learning curve for WPF.

Which is the most suitable method for Data Access in Silverlight 3?

We are planning to move to Silverlight 3 for application development because we want to take advantage of more flexible UIs and easier deployment. We have previously used Winforms with ADO.Net and SQL Server for data driven applications.
I've briefly looked at some of the options for data access with silverlight such as Entity Framework and Linq to SQL etc. But due to the pace of Silverlight development by Microsoft I do not know which method is the 'correct' method, and feel slightly overwhelmed by the options.
Can you suggest the best method for data access that I should pursue further reading on? Which methods should be avoided or are obselete?
If possible point me in the direction of a good comparison which I can't seem to find.
The technology that best suits you would be WCF RIA Services around Entity Framework.
Why Silverlight 3? VS2010 + Silverlight 4 is a much more mature platform for this type of Line-of-Business application.
That said, the biggest leap facing you is going from WinForms to Xaml based Silverlight UI.

Can Silverlight 4 run SSIS packages, SSRS reports... etc?

Can Silverlight 4 run SSIS packages & SSRS reports directly? What about interacting with Office object models? I am wondering if Silverlight 4 can be used to create full blown Line of Business Apps and for me to skip learning WPF and using RIA services. I know SL is a subset of WCF. I don't know either and want to save time and concentrate on learning SL4 if it does LOB apps?
As I recall, SSIS and SSRS expose a COM interface (though I could be wrong on that). If they do, then, yes, it would be possible to call SSIS packages through the out-of-browser option in Silverlight 4. See, for starters, this video.
However, this isn't really what Silverlight was designed for. If your LOB app is just a standard data access/updating thing, then, yeah, Silverlight is a reasonable candidate. But if you're having to interact with your enterprise infrastructure in any significant way that can't easily be wrapped in a WCF web service, I'd probably stick with WinForms or WPF. I suspect you'll probably find yourself chasing fewer dead ends.

Resources