Retired Content Model View Presenter on MSDN - winforms

I am learning to develop windows forms application with Entity Framework using Model View Presenter pattern, since it is the suggested design pattern for windows forms development on stackoverflow. On the other hand, there is a 'retired content' note on every article about MVP, on MSDN.
This is quite confusing, as I don't whether I should continue learning about MVP and try to implement it in windows forms development or there is another better design pattern that I should follow.
Any suggestion?
links:
http://msdn.microsoft.com/en-us/library/ff647543.aspx
http://msdn.microsoft.com/en-us/library/ff649820.aspx

For WinForms you should stick with MVP (Supervising Controller).
The reason you are seeing retired content is because Microsoft is heavily invested in the new Windows 8, Metro Style applications. WinRT built using C++, C# and WPF, or HTML5 + JavaScript are going to be what you will build applications in going forward, so it makes sense to learn at least one of those.
WinForms isn't officially deprecated, but don't expect it to get a lot of love from MS. I would spend some time learning XAML, and the MVVM pattern. That being said, the concepts for all UI design patterns (MVC, MVP, MVVM) are all very similar, so learning one will help you understand the others.

Related

WPF Desktop application and design patterns

I have to develop a desktop application and the back end will be SQL Express.
I am new to wpf.
Any design patterns i can use? any sample application for wpf with db?
Please help me.
Prism 4 is by Microsoft Patterns and Practices team and it advocates MVVM, Dependency Injection, and modular application development. The book (which I bought and read) is now free online. The book covers several design practices and should be a fairly good start to everything you would need to know to write maintainable, testable, flexible applications in WPF. Prism is also a framework which aids in modular app development and MVVM. It is also fairly popular.
Prism 4.1
^ Seriously, read this book. It takes 2 days max.
As per my suggestion MVVM pattern would be nice if you use in your application. Because it has many ways to reuse your code.
You can find tutorial on the same at below links:
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
http://www.codeproject.com/Articles/126249/MVVM-Pattern-in-WPF-A-Simple-Tutorial-for-Absolute
http://wpftutorial.net/MVVM.html
Let me know if you need more help.
You can use MVVM design pattern, It will help you to Reuse of code, Flexibility and Customization, Separation of the UI design and development , Testing ...
Refer these article to understand the MVVM pattern and also for sample WPF application..
http://www.codeproject.com/Articles/278901/MVVM-Pattern-Made-Simple
http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
http://msdn.microsoft.com/en-us/library/gg405484%28v=pandp.40%29.aspx

3-Tier application with WPF and C#

I have recently read about the 3 tier architecture, and i would like to know how to apply it in developing Desktop Applications using WPF and C#.
any reference to external articles or resources is appreciated.
"3-tier architecture in WPF" instantly makes me answer you "MVVM - Model View View-Model"
This quick start tutorial can help you getting started with it.
I highly recommend working in MVVM with WPF anyway. I'd even say that, using WPF without working in MVVM does not make a lot of sense imho
You also have a more strict framework named PRISM, google it if you want
Anyway, for MVVM, a lot more anwers are listed in:
this thread

MVC or MVP architecture for winform applications using Entity Framework as ORM

I am going to develop a winform project of considerable size. I am planning to use Entity Framework as ORM tool. Now I am searching for an architecture(MVC/MVP/MVVM etc..) to implement all these. Firstly there are few choices for n-layered architecture for windows forms and most those I get are written prior to EF came into market. I got a framework called Rocket Framework from codeplex(http://rocketframework.codeplex.com)
I have looked around it but am skeptical that it will accommodate a wide range of requirements. If anyone has already discovered the wheel already, please guide me through.
Also if the existing architectures prior EF4 can accommodate it than also I can give it a try.
Ideas please!
Well your choices is influenced by the technology you're using. Some technologies make a certain pattern natural to do and thus if you (and every developer) don't explicitely design and care about this you'll end up with what feels most natural. On WinForms the most natural pattern is MVP. You have your view that you can layout in the designer and your code-behind file becomes the presenter, essentially combining view and presenter in one class (it's a 1:1 relationship anyway). For web applications on the other hand MVC is a natural pattern since your web server already acts as a controller. Finally MVVM is supported very well in WPF, although you could fall towards MVP there as well if you start using the code behind file a lot. But relying on DataBinding instead can make you forget to use the code behind file. A good article I read about this is here. Of course you can realize MVVM with WinForms, read this link for a good example.
From the point of testability MVVM is perceived as the best pattern since your view model (and therefor the behavior of your view) can be tested without an actual GUI. MVP however is easy to understand and realize, doesn't require complex bindings and gives you most control over what is happening (e.g. event suppression).
WinForms applications are mostly developed with MVP pattern. The original MVC is not used very much - only its Model-2 variant (for example ASP.NET MVC) for web applications. MVVM is used primarily with WPF and Silverlight.
Neither of these patterns affects how you use Entity framework - they are not data access related patterns.
After a lot of R&D and extensive study I finally settled here:
https://github.com/geersch/ModelViewPresenter
It is an MVP architecture written by Christophe Geers. It supports all I needed- Architecture for winform, web portability support, Entity Framework. Really nice and easy to use.
Additional reading:
http://www.cerquit.com/blogs/post/MVP-Part-I-e28093-Building-it-from-Scratch.aspx

Is WPF a good technology for software engineers to learn?

So I'm seeing a lot of C# software engineer job ads asking for lots of experience with WPF lately. I have not worked with WPF before, but it seems like it would be more of a designer oriented technology, not necessarily something that a programmer would need to know in depth. Now, I know there are a lot of cross-cutting skills (what programmer doesn't know HTML) but I'm wondering how much emphasis, if any, I should dedicate to learning WPF.
I know this is a little subjective, but I'd like to get people's thoughts on the importance of WPF from a developer's perspective.
If you want to create Windows UIs, you should learn WPF. It has nothing to do with designers, it's a UI framework, just like Winforms (only way better).
WPF is important if you are writing any new UIs for Windows in .NET. It is newer than windows forms and actually less people have the skill, and it is just reaching the point where companies that are currently using Windows Forms are switching to WPF or Silverlight, so the demand for WPF developers is increasing.
Paul Betts was a little off when he said: "It has nothing to do with designers.."
It has a lot to do with designers. WPF was architected with the designer heavily in mind. However, that doesn't mean a developer doesn't need to know WPF.
Sure you can just use WPF as a UI framework just like Windows Forms but you are losing out on the main benefit.
WPF was architected in a way so that the designer and the developer can both use the UI framework for what they do: designers design, developers develop.
A designer can jump into Expression Blend and make a really slick application design and even design a lot of application "movement". The designer can do quite a lot and quite quickly.
The developer can create business logic and provide data and integrate the business logic with the WPF. You can manipulate WPF using binding, which means no code-behind and design patterns such as MVVM are based on this, but you can still use code behind to manipulate WPF elements.
Self training sites:
http://windowsclient.net/learn/videos_wpf.aspx
(The next two sites are both "in
progress" training courses, meaning
they aren't finished)
http://www.wpfsharp.com/learning/wpf-self-training-course-for-developers/
http://www.wpftutorial.net/LearnWPFin14Days.html

What exactly is WPF?

I have seen lots of questions recently about WPF...
What is it?
What does it stand for?
How can I begin programming WPF?
WPF is a new technology that will supersede Windows Forms.
WPF stands for Windows Presentation Foundation
Here are some useful topics on SO:
What WPF books would you recommend
What real world WPF applications are out there
From my practice I can say that WPF is a truly amazing technology however it takes some time to get used to because it's totally different from the WinForms.
I would recommend you to take a look at this demo.
WPF is the next frontier with Windows UIs.
Built on top of DirectX, it opens up hardware acceleration support for
your .Net 3.0+ user-interfaces.
Emphasis on Vector Graphics - UIs scale and render better
Composable UIs. You could nest animated buttons in combo boxes.. the world's your oyster.
Is a rewrite with only minimal core components written in unmanaged code VS GDI-User Dll based Winforms approach which is a thin managed layer over largely unmanaged code.
Declarative approach to UI programming, User Interfaces are largely specified in a XML variant called XAML (eXtensible Application markup language) pronounced Zammel. This opens up WPF to designer folks who can specialized tools to craft UIs that the developers can then code up. No translation losses between wireframes to final product.
MS 'allegedly' will not provide any future updates to Winforms. Heavily invested in WPF as the way forward
Oh yeah, before I forget. Works best on Vista :)
You can get either Adam Nathan's WPF Unleashed Book or Chris Sells Programming WPF .. those seem to be the way to go. I just read the first chapter of Adam's (Lead for WPF at MS) book. Hence the WPF praise fountains :)
Take a look here http://windowsclient.net/ and here Windows Presentation Foundation (WPF)
Basically WPF is created to make windows form easier to design because of the use of XAML, designers can work on the design and programmers on the underlying code
WPF is the Windows Presentation Foundation. It is Microsoft's newest API for building applications with User Interfaces (UIs), working for both standalone and web-based applications.
Unsurprisingly, there is a very detailed but not all that helpful Windows Presentation Foundation page at Wikipedia.
The WPF Getting Started Page at the Microsoft MSDN site is probably a better place to start.
Is the new Windows Gui system. I don't believe its aim is to make development easier per se but more to address fundamental issues with WinForm, such as transparency and scaling, neither of which WinForm can effectively address. Furthermore it seeks to address the "one resolution only" paradigm of WinForm by mapping sizes to real-pixel sizes and making flow layout easier and more fundamental.
It's also based on an XML derivative making it easier to change the UI and forcing a separation of the UI and the core code (although technically you can still badly hack it together in this manner).
This separation also drives a desire to be able to divide the work into two camps, the designers taking charge of the XAML and layout and the programmers taking care of developing the objects used in the XAML.
Check out Eric Sink's Twelve days of WPF 3D.
Windows Presentation Foundation. It's basically Microsoft's latest attempt to make development easier, and provide a whole heap of nice functionality out of the box. I'm not sure where to start, but googling "WPF 101" should throw up a few useful links.
WPF is part of the .net 3.0 stack. Its microsoft's next generation Graphical User Interface system. All the information you need can be found on wikipedia and msdn's wpf site
To Get Started programming I guess check out the essential downloads on windows client

Resources