Advanced MVVM

There is a book for WPF and Silverlight developers looking to take their Model-View-ViewModel skills to the next level.

Advanced MVVM reviews, in 52 pages, how the MVVM design pattern was used to create an addictive and elegant game called BubbleBurst. Read this e-book to gain insights from Josh Smith, an industry recognized expert in WPF, Silverlight, and MVVM, on how to properly design complex View and ViewModel architectures.

The book is available in the following formats:

Hard copy (paperback) $19.99 – for those who prefer reading a real, physical book

Like this:

96 Responses to Advanced MVVM

I really wanted to buy a copy of your book – right topic, right price… but is there a way to buy a physical copy or in PDF format? I’ve been burned with Adobe Digital Editions books bought from Amazon, which they stopped supporting. There is no way I’m buying anything in that format.

Hey everybody. I have made ‘Advanced MVVM’ available for purchase as a hard copy, for those who prefer reading a book on paper. It’s more expensive than the digital version due to production costs, but it’s worth it if you don’t want to read the book from a computer screen. I cannot enable printing without losing my DRM protection, so this is the only viable alternative I could find.

Hey Josh, I’m excited about reading this, and the content looks great, but I have to say I’m disappointed with your distribution choice. You certainly deserve compensation, but I’m not a fan of DRM, especially on my books, and I think you’re likely doing yourself a disservice by using it.

As it stands, I won’t be buying this today because I’m up to my ears in other things already, but if I could download it free and queue it up for later I’d be more likely to read it and loop back to pay you based on the value I extracted. I’d also be much more likely to point everyone interested in MVVM to this book as a first resource. As it is, I’m not downloading it now and wouldn’t be able to read it on my preferred reader even if I did.

Take it from Cory Doctorow, who makes his living as a writer and releases everything under creative commons:
“Why am I doing this? Because my problem isn’t piracy, it’s obscurity (thanks, @timoreilly for this awesome aphorism). Because free ebooks sell print books. Because I copied my ass off when I was 17 and grew up to spend practically every discretionary cent I have on books when I became an adult. Because I can’t stop you from sharing it (zeroes and ones aren’t ever going to get harder to copy); and because readers have shared the books they loved forever; so I might as well enlist you to the cause.”

Still though, thanks for creating this and I really do hope to come back and check it out.

@Ben – I see your point. Thanks for your input on this. I have received quite a few requests for paperback and Kindle versions of the book. I have already made the hard copy available, and the Kindle version is pending approval from Amazon.

Louis: as the code can be downloaded from codeplex, I think that copying code should not be a problem.

The point is, DRM is bad. I read one cannot print it, and everyone knows those ebooks, audio files, programs that become unusable because of a bug, a version change, a drm server stop… If I pay for a file, I want to be able to use it the way I want (since I do nothing illegal of course).

Thank you much Josh. I’m 3 weeks into learning Prism as well as MVVM to put together a proof of concept WPF app for my employer. You are so right about the honeymoon ending as soon as you try and do anything “real world”. It led me to purchase community software and start working on http://www.compositedevpatterns.com (www.mvvmpatterns.com) also points to it.

FYI. I’m trying to figure out how to configure it and set it up to where it’s a central place to gather, share info and have a group of developers interested in these patterns be able to communicate and share ideas.

I’ve emailed or contacted most of the people who’s work I’ve read. (I know you don’t know me or my intentions so if this comes across as a shameless plug, please feel free to remove it, no hard feelings. I don’t have your email to contact you directly so I’m using this avenue.)

The main motiviation for the site is Composite apps using Prism with MVVM mixed in. But I hope it expands to other areas such as asp.net MVC.

Again, thank you for this book. I’ve just purchased it and can’t wait till I get a chance to read it!!

I know I’ve been giving you a bit of flack regarding Lulu requiring registration when purchasing the eBook-version of your Advanced MVVM book. So to cheer you up, I thought I’d let you know (for what it’s worth) that I have bought a copy 🙂

You’re doing such a great job, so I couldn’t pass on the opportunity to learn more from one of the MVVM masters 🙂

In my opinion, WinForms is still a viable option for companies that don’t have, or have the capacity to gain, WPF skills. I haven’t seen any news about WinForms enhancements online, and doubt that it will be supported by MSFT for as long as WPF.

The future of WPF and Silverlight is an interesting topic. MSFT is really pushing the “convergence” idea hard, so we can expect the platforms to maintain parity. Whether or not they will merge into just one platform is yet to be determined, but I doubt it. Time will tell…

First of all, thanks for all your hard work, it’s been a great help for me, and many of us, I’m sure.

As a first step in “Advanced MVVM”, I have started to study the source code of your application. I’m really pleased with it and I am seriously considering buying the book to get a more in-depth knowledge.
Yet, from reading the source code, a question came to me. Did you use Expression Blend for the UI? If yes, is it covered in the book?

@Damien – I did not build the UI in Blend, and the book does not discuss using Blend. The focus of the book is not on how the UI was built, but on how the application was designed and how difficult problems in the app were solved.

@Alan – The application is all C#. I have already had a few VB guys tell me that they got a lot of value from the book, so I don’t think that the syntax flavor should make much of a difference. After all, it’s .NET code at the end of the day. 🙂

@Josh – Thank you for your answer. I understand the focus of the book and it sounds all good to me! 🙂
Yet, as this is not adressed in the book, I hope you can give me a (short) opinion here.
I am in the middle of writing an MVVM application (based on Cinch). The MVVM part is very limited yet and I plan on extending it (more advanced views and scenarios, animations) so your book could not come at a better time for me! The question is: should I use Blend for it? As far as I understand, you only used VS for BubbleBurst, can you tell us why?

@Damien – You should use Blend if it helps you be productive and create better software. I didn’t use Blend simply because I didn’t find a need for it while working on BubbleBurst. It’s probably to my detriment that I don’t use Blend much. It’s a great tool!

Thanks for stopping by. Sorry, but I have no intention of selling an unprotected digital copy of the book. I might be making it difficult for you to give me your money, but I’d rather make it difficult for others to not give me theirs.

By the way, you can also purchase a hard copy (paperback) version of the book. That one is 100% DRM free! 🙂

Hi Josh, thanks for that, I’ve gone with the Kindle for PC version – still a pain to install another app however 🙂

I’d argue that the people who aren’t interested in paying, aren’t going to pay regardless (and your book is likely already in the pirate circles, with the drm removed) but I digress….

Frosty, a previous commenter posted “You are so right about the honeymoon ending as soon as you try and do anything “real world”.” – This has been exactly my experience of “hitting the wall” with MVVM, so I’m really interested to get stuck into your book.

With regards to the pirated copies of my book (which already are on the Web)…I’ve read too many horror stories of people downloading pirated copies of things and ending up with a nasty virus on their machine. If someone wants to avoid paying a few bucks for my book, but is willing to risk having a keylogger send their credit card number to another thief, that’s their problem.

I’m just getting my feet wet on WVVM. The title of your book sounds like it’s advanced stuff. Will a novice like me benefit from it, or should I first brush up on ‘getting started’ stuff? Also, browing the comments here, I noted ‘Prism’. Is pre-understanding Prism needed to learn MVVM from your book?

Hey Josh, I just finished reading your book and all I have to say is “Wow… Talk about a paradigm shift.” Very eye opening on the use of code behind and how it all interacts with each other. Good Work! I do have one question with regards to the Model aspect of MVVM. You didn’t use it? I would have thought creating a BubblesMatrixModel that had a collection of BubbleModels would have been the MVVM approach, where each BubbleModel would have had a BubbleLocationManager and all the business logic. So my question is when would it be appropriate to ignore the Model layer and merge it with the ViewModel ?
I’m currently working on a LOB application where I have a model for each business object, and a view model for each of those business objects. I mainly use the business object view models as a value converter (Wonder where I learned that one? ;)) and for my tree views. One place where I run into problems is some of my models contain collections of other models and in order to expose those in my view models I had to create a collection wrapper that creates a view model for each model object in my collection. I don’t think this is really best practice at all, but it’s what I ended up doing because I have my Model and View Model layers. So I was wondering when it would be appropriate to merge the two as you have done in your book?

[…] that came up in the WPF Disciples group recently. Justin Angel posted an review of Josh Smith’s Advanced MVVM book. In his review he talked about how MVVM was “essentially about these 3 things:” 1) Data […]

@E Johnson – I’ve heard of others having that problem. I think the answer is to adjust your firewall to let the Adobe app to get through. Sorry, wish I knew how to help you more.

@Raul – Thanks! I am definitely *not* promoting the idea that Models are unnecessary. Sometimes they are absolutely necessary, such as when you want to have business logic in them, etc. In my app, I didn’t need a Model layer, so I didn’t create one. I wanted to focus on the interactions between View & VM.

Composite isn’t a replacement for MVVM, to me it’s an additional way to modularize your apps. Prism is about using Modules and Regions to architect your app.

I think there is some confusion with naming. In Prism, they use the terms Presntation but also say they mention the “Presentation Model” which I believe was defined by Martin Fowler.

There are some that would say that MVVM and “Presentation Model” are synonomous.

To me that’s one of the frustrating things in trying to get started with with these patterns. Most have their own ways of thinking and terminology and it can become confusing.

I think when you research you’ll find most of the frameworks out there are based on the MVVM concept.

However, I found I liked the concept of creating Modules and using regions to display my views. Plus I like it because it’s something from an Industry leader like Microsoft and probably a better chance of becoming a standard way of doing things.

The MVVM frameworks usually have some workspace plumbing.

It’s because of this frustration, I’m trying to get a community up for these types of discussions and sharing of info in a central place.

Right now I’m working on lessons which create a LOB app from scratch and use Prism combined with MVVM patterns. I happen to use the Cinch framework as I like it best of any I’ve had time to go through. However, it was written for WPF and isn’t fully compatible with SL.

Great read so far, Josh! I’ve learned a ton from your online articles, so naturally I wanted to buy your ebook. I kind of wish I had gone with the Kindle version, though, because this Lulu format is for the birds (from a Kindle owner’s standpoint). Anyhow, I am really looking forward to finishing this tonight, and then reading it over and over again (and working through the sample code) until I get it. 🙂

Just out of curiosity, how come your ebook comes up in the Adobe Digital Reader as “Author unknown”? That’s a bummer.

Pradeep – You can buy it for Amazon Kindle, which has a better experience than the DRM-protected version on Lulu.com. You do not need to have a Kindle device, just download the free Kindle for PC program from Amazon, and then you can read the book without a hassle on your PC, iPhone, iPad, or Kindle.

Predeep….don’t let that stop you. It is not inconvenient at all. The adobe download was painless and it is a good book reader. The book is worth the price and the little bit of extra effort required for DRM…or as Josh mentions, just get the kindle version for your PC. Make it work and enjoy the book.

I once bought a DRM-ed PDF from Amazon (Adam Nathan’s .NET and COM Interoperability book) for about $50. Later Amazon stopped selling the book and I formatted my machine and now I cannot open the book anymore. $50 down the drain. So I will never again buy a DRM-ed book.

downloading the DRM book is certainly not as convenient as getting the kindle book, since you have to have a Lulu account just to buy it.

I’m mostly annoyed because I can only read it on my computer, whereas if I had known (at the time I bought the DRM version) that there was a Kindle version, I would have just bought that instead, and been able to read it on pretty much every device I own.

It’s too bad that the page I read to find out about the book only mentioned the hardback and DRM version. Oh well.

I was reading your article in MSDN magazine (the one about the MVVM pattern with the source code) and I was wondering where I should put the command for saving the data back to a database. Should that go into the repository or the viewmodel?

Hi Josh,
In regards to your MSDN mag article( the MVVM customer app).
I have been using that pattern for a app I have been working on.
I have added a number of tabs and I would like to have the tabs go across the display rather than creating a 2nd row.
How can I make it do that?
Have not been able to find a property that does that.
Thanks
Jeff

Of course I see the point of authors having to be compensated for there hard work. But people not willing to pay will download one of the pirated copies of your book floating around the web. And people willing to pay like me are annoyed by the crappy DRM stuff. So cant see where you gain anything as an author.

If I buy a file, I want control. I want to read it my my favorite devices, I want be able to print some pages to add handwritten comments and use it as quick reference while working. And first of all: If the DRM server provider decides to stop the service, my files I have PAID FOR are unusable. Been there, done that.

I would pay even more fore a plain PDF of your book if there is no DRM. If you do not trust me, you also will not sell anything to me. Sorry. Hopefully you reconsider your decision to annoy paying and honest customers with DRM. And I will buy a copy.

You actually make it appear really easy along with your presentation however I in finding this topic to be really something which I believe I would never understand. It seems too complicated and very large for me. I’m having a look forward on your next post, I’ll attempt to get the dangle of it!

I’ve started working with MVVM, and have already gone through your earlier article. My questions : this book description indicates Silverlight, with which I have ZERO experience. Is knowledge of Silverlight required to make real use of this text? Are the code samples in the book dependent on Silverlight?

Hi Josh
Just finished reading your book ….Since code behiond is frowned upon except like you said some specifics, how do you suggest handling task like Navigation? From the MVVM model you don’t want the View deciding on the next view? Would you use a unit of work pattern? How and where does that reside in the model? I think I am close to the light bulbs turning on….Help on this Navigation topic would be helpful.
regards

It would be really great, if you would offer your book in a non-DRM pdf. I really like the approach of the pragmatic-programmers. Once you buy an ebook, you get it in three different formats:
– pdf
– epub
– mobi

Each of them contains a footer on visible each page (e.g. this ebook was prepared for Josh Smith) and some invisible information of the owner to prevent file-sharing. But I find it really great to carry my book anywhere I want.

Since I don’t own a kindle, I don’t find the appropriate book in your offering. I have a mac at home, and I’m unsure, if I’d be able to view the book without problems.

I purchased this ebook at Amazon and am playing with source code. I am very interested in figuring out how the starting animation works, but got very frustrated. Could you explain how it works and where the source code is?

MVVM approach is very promising. There are a lot of tools and frameworks that make your life easy when applying MVVM approach. Check out the open source Xomega Framework, for example, which is MVVM on steroids. I used it on several projects with great success. Combined with the Xomega modeling and code generation tools in Visual Studio it hits it right out of the park. Btw, they have released a new version recently for VS2012.

[…] A Game to Learn: BubbleBurst is a fun and addictive game, based on the classic game called BubbleBreaker. It is the subject of Advanced MVVM, a book written by Josh Smith to help MVVM developers take their skills to the next level. The application architecture is based on the Model-View-ViewModel design pattern. Several difficult problems were solved in elegant, reusable ways, as explained in great detail by the book. And if that isn’t enough, the user interface was enhanced by several professional Visual Designers and User Experience gurus!Feel free to download the source code or binaries, even if you don’t buy the book. […]

[…] design whereas the application developer design the code-based ‘ViewModel’ (in the good old MVVM way of working). They do their work in isolation and at a certain point in time they integrate their work smoothly […]

Josh – ‘Advanced MVVM’ is great! Bubble Breaker is easy enough to understand, yet not boring. What differentiates this book is insight into the *design* of MVVM – the pattern and where/why to put code.

I understand you want to preserve your IP and respect that. But ePub sucks! I prefer PDF.

Josh – I recently looked at your article on MSDN and was amazed by the in-depth coverage on MVVM. However I have one query arising out of the sample code provided in the article.

The issue that I faced with is to open the AllCustomersView via a button click and the button is placed on the CreateNewCustomerView. I tried various tricks and the Command is getting invoked but somehow the code:”
….collectionView.MoveCurrentTo(workspace);
doesn’t open the View in question.

[…] Advanced MVVM | Josh Smith on WPF – There is a book for WPF and Silverlight developers looking to take their Model-View-ViewModel skills to the next level. Advanced MVVM reviews, in 52 pages, how the … […]