Beruflich Dokumente
Kultur Dokumente
Modular W indows desktop applications need a well -defined architecture. Modularity has to be
supported throughout the whole application and its architecture. This implies a modular UI and
the separation of the application into several modules providing diff erent functionality. These
modules contain logic as well as UIs shown inside the applications main UI. Engineering
systems like the fdtCONTAINER application from M&M Software GmbH are typical examples.
Figure 1 shows the fdtCONTAINER application screen.
The UI is based on state-of-the art elements like the ribbon, known from Microsoft Office 2013. It
presents the available commands to the user. The first button of the ribbon opens the so called
backstage view. It provides basic functionality such as creating a new file or project, open, save,
file info, application info and so forth. Content specific ribbon tabs are added depending on the
context of the active document window.
Document and tool windows are shown in the area below the ribbon. Their content is usually
provided by the modules. This is typical for this particular kind of applications and therefore
addressed by the architecture.
Reference Architecture
How does the M&M Platform for WPF architecture look like? Figure 2 gives an overview of the
reference architecture. The platform is based on the mainstream technologies of the .NET
1 / 6
WHITEPAPER
M&M Application Platform for WPF
framework. This make it possible to provide long term support. Microsoft Extensibility Framework
(MEF) supporting loose coupling and Windows Presentation Foundation (WPF) for the UI are two
important parts of the .NET framework to mention at this point.
On top of the technology part the framework is located. It is a mix of open source and
commercial components building up the basic framework. These components are used to build
up the applications frame which manages and integrates the modules.
The application specific modules are based on this framework as illustrated w ith gray boxes.
These modules comprise the application specific parts like e.g. the device management. The
Shell View - Bootstrapper is a required module. It defines the applications UI frame and is
responsible for the application startup.
Shell View
log4net
Module 1 Module 2 Module n
Bootstrapper
2 / 6
WHITEPAPER
M&M Application Platform for WPF
product line may consist of several specific modules combined with a selection of common
modules.
UI with WPF
In this architecture the UI is built up using W PF which allows to create UIs with a good user
experience. Using the styling mechanisms of WPF it is possible to customize the UI according to
the companys corporate identity and the defined UI style guide. For example, the blue parts of
the window shown in Figure 1 could be colored using the company colors.
WPF also clearly distinguishes between UI and logic. To support this the Model View View -Model
patterns is used (see Figure 3). It separates the UI (View) from the complex business logic
(Model). UI logic is located in the View-Model. The views are connected to the view models by
using the data binding mechanisms provided by WPF.
Testability
The modular approach and the MVVM pattern provides a solid basis for more effective unit and
integration tests. This guarantees the product quality and ensures a good maintainability of the
developed software solution.
3 / 6
WHITEPAPER
M&M Application Platform for WPF
Loose coupling is also an important topic when dealing with view models. MEFedMVVM is a
library that helps to develop MVVM applications and keep the view mode l loose coupled from the
view. Internally MEFedMVVM uses MEF to achieve this. The view model is registered with a
name and the view resolves the view model by the view model name. Hence the view and the
view model do not have any dependency beside this nam e. Data from the view model is
displayed in the view using W PFs original data binding mechanism.
Localization
Most of the applications are shipped internationally. Hence localization is an important topic. In
many applications, users shall be able to swit ch the language without restarting the application.
In our architecture the WPF Localization Extension component is used. This component is very
flexible. It provides an interface to add own localization providers. Hence its possible to get the
resource strings from a custom database, if required. Resx files, usually used in .net, are
supported by default.
Centralized Logging
The centralized application logging is accomplished using log4net, which is a very powerful
logging component. It provides a nice API and good configuration options. Hence its possible to
fully customize logging according to the project needs.
Log4net also provides so called appenders. They define, how the log entries are handled, e.g.
persist to file or database.
Conclusion
This reference architecture defines a foundation for modular applications with Microsoft Office
2013 style. It has successfully been used by fdtCONTAINER application, dtmINSPECTOR and an
engineering tool developed for one of our customers. Summary:
Microsoft Patterns & Practices Prism is good to build loosely coupled applications.
Modular design and the usage of MVVM ensures a good maintainability and unit testing
basis.
Product lines can be built based on the modular design.
Prism, ActiPro, Cinch, Localization Extension and log4net, together provide a solid
reference architecture for modular Microsoft Office 20013 style applications.
Specific application architectures are built by adding application specific building blocks
like e.g. Device Management.
Although reuse of object oriented code may fail frequently, reusing reference
architectures saves time and effort while increasing quality.
4 / 6
WHITEPAPER
M&M Application Platform for WPF
Boxes
Used Technologies
Technology / Component Source
Microsoft Patterns & Practices http://compositewpf.codeplex.com/
Prism
ActiPro Ribbon and Docking http://www.actiprosoftware.com/products/
controls/wpf/ribbon
http://www.actiprosoftware.com/products/
controls/wpf/docking
Cinch https://cinch.codeplex.com/
MEFedMVVM http://mefedmvvm.codeplex.com/
WPF Localization Extension https://wpflocalizeextension.codeplex.com/
Log4net http://logging.apache.org/log4net/
Suitable for
Engineering Systems
Configuration Tools
5 / 6
WHITEPAPER
Company Profile M&M
M&M Software stands for innovation, competency and quality. Being more than 25 years in
business, M&M has gained the reputation as a reliable partner for many renowned customers
worldwide. Our vast industry know-how is reflected in a wide range of innovative and unique
software solutions that we have developed for and together with our customers in the factory -
and process automation, maritime technology, mechanical engineering, building automation and
energy technology.
M&M is the competent service provider for all matters concerning software products in the
industrial automation. Our service portfolio includes Management & Technology Consulting,
Software Development, Quality Assurance, IT Operations & Services and Software Mainte nance
& Support. We mainly focus on solutions for Human Machine Interfaces (HMI), device
integration, engineering systems and web applications.
The companys headquarter is in St. Georgen in Germanys Black Forest region. Our subsidiary
in Suzhou near Shanghai/China was established in 2005. There we do not only serve the
upcoming markets in Asia, but also offer offshore development services to our customers in
Europe and America in proven M&M quality to significant price advantages.
At the end of 2012 M&M established its subsidiary in Hanover. This location enables us to serve
our customers in the north of Germany even better .
6 / 6
Registered Office: St.Georgen, Germany Registry Court: Freiburg HRB 602021 Directors: Erwin Mueller, Klaus Huebschle, Andreas Boerngen