Charteris Community Server

Welcome to the Charteris Community
Welcome to Charteris Community Server Sign in | Join | Help
in Search

Roger Whitehead's blog.

Thoughts and activities on implementing Microsoft web and Windows Mobile technologies. Life is Mobile. Think Mobile.

December 2006 - Posts

  • Fiddling With Factories - Patterns in the Microsoft Mobile Client Software Factory

    As promised in an earlier post, I have finally got around to looking at the Microsoft Mobile Client Software Factory (MCSF) as produced by the Patterns and Practice Group within Microsoft.

    There is a huge amount to install and learn about with this software factory. It requires amongst other things the installation of the Enterprise Library 2.0, Guidance Automation Toolkit and the Composite UI block. You also need a running installation of SQL server 2005 and SQL Server 2005 Mobile (Compact etc). Allow a good 3 to 4 hours for a complete install.

    Installation issues - some of the sample projects didn't compile during the command line phase of the original MSI installation. I did however manage to build them successfully by loading each solution into Visual Studio 2005 however. My guess is some reference or environment path was incomplete at the time of the original build. So far there don't appear to be any side effects.

    The philosophy around the Mobile Client Software Factory is to provide a series of configurable mobile architecture and component design patterns that can be used as a standardised basis for other mobile applications. These are intended to be configured by software architects according within an organisation or those who perform similar roles. Once configured, tailored guidance (using the Guidance Automation Toolkit and Visual Studio 2005) and associated templates can then be generated. This guidance in turn, then forms part of the organisation's enterprise architecture and implementation standards. If implemented correctly it looks like this could save a large amount of time previously spent creating "plumbing" code and provide a great starting point for implementing custom functionality.

    Model View Presenter

    There are too many design patterns in the MCSF to cover each in detail in a single post -  I'll cover more in further posts. Of particular interest to UI developers however, will be the use of the Model View Presenter (MVP) pattern however. Model View Presenter is a critical element of the Mobile Client Software Factory. The MVP is a variant of the Model View Controller (MVC) pattern and is fully documented by Martin Fowler. Further details on the MVP are on Martin Fowlers blog

    Essentially the MVP separates the behavior of a presentation from the view,  and allows the view to receive user originated events. In effect, that Model View Presenter separates the functional behavior of the presentation out into a separate presenter class. User originated events are then forwarded to the presenter class which manipulates the state of the view. As well as separating the functional responsibilities, this separation of presenter and view also allows the behavior to be tested without the UI. In addition, it allows different UI controls to be used with the same basic behavior.

    The Mobile UI Context

    Because it is the View that captures user input, not the Controller, this model fits far better with rich and smart client applications than the MVC pattern. The MVC pattern is really better suited to the transient scenarios of web applications. Since most mobile applications are based on smart clients, running on devices, not mobile Web applications. the MVP pattern lends itself much better to enterprise mobility scenarios. Through separating the presentation logic from the view that holds the relevant GUI controls, it allows support for multiple views with different control layouts, and also supports software testing without the view. This is particularly important with mobile client UIs where multiple screen resolutions and orientations have to be supported. In addition this MVP pattern supports the creation of multiple versions of the client UI: e.g. one for Pocket PC devices, and one for Smartphones with some common functional layers underneath. Finally separating the controller behavior from the view allows a Model View Presenter to concentrate on implementing just the behaviour.

    In further blogs I'll be looking at further elements of the MCSF including the guidance elements and the application blocks. I'll even be trying to get some custom code up and running.

This Blog

Syndication

News