MVP Taligent Programming Model for .Net - model-view-controller

Has anyone created a .NET control architecture using the taligent programming model as follows?
http://www.wildcrest.com/Potel/Portfolio/mvp.pdf
As stated by IBM -
MVP will enable IBM to deliver a unified conceptual programming model across all its major object-oriented language environments
The question is how do you implement or map the IInteractor concept (Page 9) to a .NET interface? Currently the guess is to use the IInputElement interface as a the event source for all UI input controls.
If anyone has already implemented the taligent pattern in .NET, I would like to know if it is applies to both Silverlight and WPF. If so, does it apply to the union of their interfaces?
Finally this represents the unified abstract architecture and can displace PresentationFramework.dll. If you see this applies as a control architecture, please comment.

That depends on what you mean by ".net". The term covers many kinds of applications. Web apps, Web Services, Windows Forms apps, WPF apps, etc...
MVP is used a lot in ASP.NET Web apps. See:
http://msdn.microsoft.com/en-us/magazine/cc188690.aspx

The article How to: Implement the Model-View-Presenter Pattern of the MSDN patterns & practices section seams to be what you are looking for...

We have created a complete MVP framework for .NET, based on the Taligent ideas. It took us some time to get right but now we can create applications by writing business classes, creating a new form and drag-dropping the properties of a class onto the form.
The framework is very sophisticated and allows for the customisation of forms at runtime, as well as automatically hooking up validation in the business classes to edits on the form.
We also wrote an OPF (Object Persistence Framework) to complement it, so avoiding the need to manage database code as well.

Related

Can the Model View Presenter be used in a native desktop application?

I'm just starting out on GWT, and I came across the MVP (was actually trying to get ahead of myself..get a little motivation). I already have a desktop application that I want to modify, can a desktop application use the MVP? and if the answer is no, what components and or classes can be used to simulate having a model view presenter?
You cannot compare GWT and MVP: they are totally different things.
GWT is a toolkit that allows you to write desktop-like web applications in java.
Some years ago, Ray Ryan from google gave a talk at the Google IO where he presented an effective pattern to code web applications using GWT. This pattern is MVP. It was not invented by google, it was already there. It's just fit for purpose when you come to write desktop like web applications. At least, this is what Ray Ryan proposed in his talk.
As far as I know there are 2 most famous implementations of the MVP in GWT: Acticivties and Places (Google) and GWTP (Arcbees). You can also create one yourself as exercise, it is not too complex. The main concept is having the view as dumb as possible and put all the business logic in the presenter. The View and the presenter collaborate through an interface. Ok, easier said than done, I'll give you that. But you can google for more.
So yes, you can write a desktop application using MVP.

Model-View-Controller for GWT

I know that most GWT based application now is being implemented using the MVP pattern, however I still want to know which MVC framework is the most mature and can be used for production-grade web application built with GWT.
Searching the web I can't seem to find a MVC framework anything comparable to Mvp4gwt and GwtPlatform in the MVP frameworks, in terms of user base and activities in the code.
If you must shoot yourself in the foot, these are the only two MVC frameworks for GWT that I've heard of:
http://code.google.com/p/gwt-mvc/
http://code.google.com/p/gwittir/
Neither of these have had a release in over two years. Probably due to lack of community interest, and because MVP is better in every conceivable way. Using MVC with GWT is like installing square tires on a Ferrari.
You could use JetPad-Mappers, a minimalistic MVC framework developed at JetBrains and used in several (currently unreleased) products.
https://github.com/JetBrains/jetpad-mapper
Disclaimer, I am involved in development of this framework.

MVP vs MVC design patterns for web and mobile?

For an upcoming project, I am looking into MVP as an option over MVC. I am highly familiar with and like MVC, and am merely trying to see if I will gain anything using MVP.
What I gather about MVP is that it uses the ASP.Net view engine/MVC# (which I don't particularly like) that uses the ViewState - adding a bunch of extra content to a rendered web page, and not built in routing functionality (can be written in separately into the Global.asax).
MVC/Razor on the other hand, renders very clean HTML.
Certain articles, such as this one seem to lean towards using MVP for multiple views, however in light of MVC3 with jQuery Mobile, there are some fantastic things that can be accomplished with this MVC.
How do these compare to what is currently available with MVP? What are some pros/cons or potential pitfalls of using MVP over MVC?
I am also considering using an existing MVP application to expedite development time.
I know you will cringe at the following, but looking for options:
While this app offers all the required features, if implementing this solution, how difficult is it to tie in additional MVC applications (I know that looks ugly)? If this was something that we had to consider (combining both), would it be best to wrap the application in MVC (routing) and have the MVP app contained inside?
The reason for this is a staggered feature update process, where the requirement is to implement a new feature (which is built using the MVC framework; the rest of the system is not). Future plans are to completely change the current framework to either MVC or MVP.
Thanks.
You seem to be confusing patterns with frameworks here.
Both MVC and MVP are design patterns, ASP.net MVC and MVC# on the other hand are frameworks that implement the MVC/MVP design patterns.
There is a massive confusion and lots of conflicting information on the web about the difference between MVC and MVP patterns and infact Martin Fowler the guy who made MVP popular since "retired" the pattern in favour of 2 new ones. See here
Both patterns are there to aid separation of concerns that is for sure, but other than that there really isnt a lot of difference between them, the only thing I have found is that MVC has a controller per widget on the screen where as MVP is one per screen although even this rule is violated if you have a complex screen. I am still unsure and use the terms interchangeably myself.
The one thing I see over and over is that in MVP the view is responsible for creating the presenter, however this is not part of the original design. It appears to have arisen from the fact that older web frameworks such as asp.net webforms were page centric. You had no way of changing this and so it was the page (view) that created the presenter. Basically the framework is getting in the way of the pattern and so a hack was made to shoe horn it in. Unfortunately this seems to have become the defacto way of describing MVP.
Basically my wall of text above is trying to say that if you want to do MVC properly use a framework designed to do it, ASP.net MVC is a good choice, it is part of the MS stack, well supported (MVC# hasnt been updated since 2008) and if you are already happy with it the loss of productivity trying to learn something else isnt really worth it imo

Sample N-tier ASP.NET MVC3 application with best practices (using EF 4.1)

I am looking for a sample ASP.NET MVC3 N-Tier application that demonstrates best practices (uses Domain Driven Design and Entity Framework 4.1 Code first). I found the following. which one do you recommend out of these (or any other one not in this list)?
http://efmvc.codeplex.com/
http://prodinner.codeplex.com/
http://www.dofactory.com/Framework/Framework.aspx (not free)
I was in the same position not long ago.
The things you linked are OK, but certainly not enough on their own.
I find this topic lacking in the free resources, as it is quite big and needs good organization and breadth. On the other hand, there are good resources if you are willing to pay a little.
These are the resources I used:
PluralSight - training videos. ($30 per month, quite worth it, not affiliated, but a subsciber)
Here are the courses that are great on the topic:
Principles of Object Oriented Design - by Steve Smith, he is a great lector.
Design Patterns Library - over 10 hours of videos on design patterns. Can't compare them to DotFactory, but they are very well done.
Inversion of Control - what the name says, important topic in depth.
There are also lots of stuff on TDD, MVC, EF etc. All worthy topics.
Books on Kindle (I haven't been reading lots of books, but Kindle really revived my passion for written knowledge)
Professional Enterprise .NET
Microsoft® .NET: Architecting Applications for the Enterprise
Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
Have you seen the following projects? They also have the source code that they can have complete documentation.
http://microsoftnlayerapp.codeplex.com/
http://www.nopcommerce.com
Best practices are always subjective. Your application may require DI and as well as Interceptors but sample apps are relatively small and putting anything into there turns out to be ridiculous. Still, I would suggest you to go through MVC Music Store. It has pretty good implementation and a very good sample.
http://mvcmusicstore.codeplex.com/
Although this post is old, But I have had same problem to find a good and modern pattern for a good ntier application. After I goggling for some hour, I Found Onion Architecture By Jeffrey Palermo. It is a must read article. here: jeffreypalermo.com/blog/the-onion-architecture-part-1/
By using this article and using some other researches I Made a template (Example) of this architecture that uses Entity Framework 6.0 and Ninject Dependency Injection 3.2.0
NTierCSharpExample
I this template: Center Layer Is Domain Layer. Then Service Layer that is a bridge between presentation and Data Layer.
For simplicity I used console app for presentation but you can simply remove it out and plug in a new asp.net mvc 5 application or any other presentation app you want.
Funny this kind of question comes up couple of times per week at least recently.
What I can say, only about the layering of the different projects, accordingly to my experience and feedback I've got, is to check question and my answer here:
MVC3 and Entity Framework
RKP this is not answering all and completely to your question, is about layering the architecture and some ideas on why only (see comments under my answer).
I make a good pattern based on EF 4.1 and MVC3:
MVC3 and EF architecture
good luck

MEF vs. PRISM. What is the difference? What will be supported in the future?

What I want to create is a Silverlight app with a few tabs/modules that will all be separate DLLs.
I see PRISM has the Shell/Module concepts that seem directed towards doing UI and I find a nice demo (showing how to search digg/twitter).
But it sounds like MEF will be included in VS2010 so I would like to go with that option.
Can anyone somehow clearly explain the differences? (I am not a advanced programmer)
MEF and Prism serve two very distinct goals.
Prism is basically guidance for designing composite applications - where you have a shell and "regions" that are dynamically assigned, and integrated. It includes an IoC container (Unity) that it uses for it's injection.
MEF is a dependency injection framework - it's main goal is to "fill in" depedencies at runtime for an application. In this respect, it's filling the same goal as Unity does within Prism (and, in fact, you could pretty easily rework Prism to use MEF instead of Unity).
Prism fills a broader scope, in some respects, but is also really limited to GUI applications. MEF is just doing one thing (Dep. Injection), but geared to be more general purpose, for any type of application.
As for the lifetime of these products -there is no answer here, but this is kind of how they're being developed:
Prism was developed by the Patterns and Practices team. The goal isn't to necessarily make software, but to provide guidance. As such, they update (although somewhat infrequently) the Prism library and sample, but Prism isn't a core part of the framework shipped by Microsoft. It's really a third party library (even though MS funds a lot of it, most of the P&P people aren't MS FTE).
MEF, from the blog posts, sounds like it is planned to be integrated into the framework, and be used directly inside of MS projects. As such, it's getting heavy development, directly from Microsoft, and being used in their products.
I, personally, have read through the Prism documentation (and have the book), and have gone through the samples. It is very helpful to understand how to break apart an application, but it really is guidance more than a complete, usable framework. The samples are very good at doing what they're designed to do - educate an architect in how to design a composite application.
If your goal is to just keep a clean separation of concerns in a silverlight application, I'd focus more on learning MVVM than necessarily just using Prism.
If you want to use MEF, there are other good options. For example, the WPF Application Framework is an entire MVVM framework built on top of using MEF, and fairly nice.
Basically, MEF is a general-purpose extensibility framework:
If you are building extensible applications, extensible frameworks and application extensions, then MEF is for you.
whereas Prism is mostly for building GUIs:
The Composite Client Application Guidance is designed to help you more easily build modular Windows Presentation Foundation (WPF) and Silverlight client applications.
So MEF and Unity are basically the same...
Well, not exactly. MEF is more focused on extensions which aren't known at compile time, while IOC containers generally focus on dependencies which are known at compile time. The top answer to this question gives a good explanation of the differences.
Yes. Check these two posts for more:
http://blogs.msdn.com/gblock/archive/2009/12/02/mef-and-prism-to-be-or-not-to-be.aspx
http://blogs.msdn.com/dphill/archive/2009/12/09/prism-and-mef.aspx

Resources