Skip to main content

Posts

Showing posts with the label Simplicity

Clean app startup (WPF)

Simple easy to read code is the building blocks for complex applications, and to this end, the is how I now start all desktop apps (written in XAML / WPF). This is nothing new (and not original) but it's been refined & destilled down to a point of simpliclity :) Single line written once and forgotten about... Need to add Exception handling - write it in a Module... Need to add Heartbeat monitoring - write it in a Module... Using DI - do it in a Module... Startup XAML - guess what, done in a Module... Want only one instance of the app - do it in a Module... So lifting from my updated Simple.Wpf.Template on gitHub , I have the following set of Modules defined - this forms the basis for all apps I'm asked to develop for clients: The complexity is hidden away in the ModuleLoader class, simple put this scans & loads any type with the ModuleConfigurationAttribute, orders the Modules according to the properties of the Attribute and dynamically invokes the Modules. Check out th...