Model Viewer Presenter. Take 2

by Marius Gheorghe 20. April 2007 18:54
If you search for a practic MVP implementation on the Internet there are VERY high chances to find a sample implementation in which the Presenter and the Viewer are ""tied"" together using a interface. Personally i don't agree with this and I think that the interface doesn't serve any useful purpose. It's just dead code to drag along.

The view ""describes"" how the UI was supposed to work. You can instantiate the presenter from the viewer and ... just use it. There is not a single practical reason for which you'd want to ""tie"" the Presenter and Viewer with a interface.

Model Viewer Presenter. Take 1

by Marius Gheorghe 13. April 2007 19:14
I have decided to write some posts on Model Viewer Presenter. If you don't know, Model Viewer Presenter ( MVP from now one for the sake of my fingers) is a pattern which , among other things, "dictates" how to separate logic from UI. You can think of it as a way to "implement" separation of concerns. Here are the MVP pieces:

- Model : this is you business object.
- View : this is the UI object (Windows/Web form, PocketPC window etc)
- Presenter (or "the glue") : this is the object which gets the data from the model, modifies it and passes it to the view.

One of the things for which MVP is touted is "presenter reusability". Write you presenters correctly, they say, (without referencing the View from the Presenter) and , when you port the application from other platforms, you just need to rewrite the view. Personally i think that's wrong ( in the sense that you won't need this). Web applications are different from desktop applications which are different from mobile applications. If you "port" a application from a platform to another this "presenter reusability" thingie won't hold.

Here is an example : Shopkeeper is a MVP web application.



Also here is the "port" to the desktop platform (a smart client application)



The web application has 10 views/presenters. The desktop application has....3 views/presenters. Yeap...that's right. That functionality was encapsulated, in the case of the desktop application, in just 3 views/presenters.
Conclusions :
- platforms are different (suprise heh ?!)
- use MVP for what it really is. The best way to enforce separation of concerns.

Tags:

general

Best reader for PocketPC

by Marius Gheorghe 11. April 2007 21:27
Without a single doubt Mobipocket. It's head and shoulders above MS Reader. Text layout, different fonts, margin settings, full screen reading......this little baby has them all. As an avid PocketPC reader i simply cannot recommend MobiPocket Reader enough.

Great piece of software

Tags:

general

Farseer trilogy review

by Marius Gheorghe 4. April 2007 11:52
         



Without the slightest doubt one of the best trilogy i have ever read. Simply not just good fantasy but also good literature. I realllly felt sorry for Fitz Chivalry when i have finished reading the books.Also the ending of Royal Assasin was top notch. The only other book that kept me in "don't put the book down" mode was the ending the of the "Two Towers". And that should say something......

Recommanded

Tags:

books

First Shopkeeper smart client in the wild

by Marius Gheorghe 2. April 2007 13:39
Here is it

Smart clients are cool. Very small (the Shopkeeper smart client is only 250 kb),with slick UIs they allow you to dodge the slow and clunky HTML interfaces and simply allow you to do your job faster and easier.

Shopkeeper has a smart client because i wanted to give my customer the choice to choose their tools. Some people have no problem with web applications but others simply want more. After being spoiled with great desktop applications is hard for some people to go back to web apps. And this is where the smart client comes into place. It allowed me to build a compelling shopping experience for every type of customer. And after all that is what really matters in the end : a compelling experience for your customers.


marius gheorghe

developer, dad, gamer

Contact me

My Resume

Favourite Tools