Click here to Skip to main content
15,886,830 members

Dominic Burford - Professional Profile



Summary

Follow on Twitter LinkedIn      Blog RSS
6,554
Author
2,053
Authority
9,852
Debator
8
Editor
100
Enquirer
212
Organiser
2,954
Participant
I am a professional software engineer and technical architect with over twenty years commercial development experience with a strong focus on the design and development of web and mobile applications.

I have experience of architecting scalable, distributed, high volume web applications that are accessible from multiple devices due to their responsive web design, including architecting enterprise service-oriented solutions. I have also developed enterprise mobile applications using Xamarin and Telerik Platform.

I have extensive experience using .NET, ASP.NET, Windows and Web Services, WCF, SQL Server, LINQ and other Microsoft technologies. I am also familiar with HTML, Bootstrap, Javascript (inc. JQuery and Node.js), CSS, XML, JSON, Apache Cordova, KendoUI and many other web and mobile related technologies.

I am enthusiastic about Continuous Integration, Continuous Delivery and Application Life-cycle Management having configured such environments using CruiseControl.NET, TeamCity and Team Foundation Services. I enjoy working in Agile and Test Driven Development (TDD) environments.

Outside of work I have two beautiful daughters. I am also an avid cyclist who enjoys reading, listening to music and travelling.

 

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
GeneralSending Push Notifications with Azure Notification Hub Pin
Dominic Burford25-Jan-19 4:34
professionalDominic Burford25-Jan-19 4:34 
GeneralUnit testing a Xamarin Forms mobile app Pin
Dominic Burford13-Jan-19 21:59
professionalDominic Burford13-Jan-19 21:59 
GeneralApple development sucks Pin
Dominic Burford8-Jan-19 1:09
professionalDominic Burford8-Jan-19 1:09 
GeneralBut the tech giants are private companies Pin
Dominic Burford19-Dec-18 5:31
professionalDominic Burford19-Dec-18 5:31 
GeneralThe latest version of our app nears completion Pin
Dominic Burford7-Dec-18 2:21
professionalDominic Burford7-Dec-18 2:21 
GeneralIs Silicon Valley a force for good? Pin
Dominic Burford27-Nov-18 21:57
professionalDominic Burford27-Nov-18 21:57 
GeneralUsing Javascript to retrieve values from a Xamarin Forms WebView Pin
Dominic Burford27-Nov-18 5:01
professionalDominic Burford27-Nov-18 5:01 
GeneralUsing the MVVM pattern with a Xamarin Forms mobile app Pin
Dominic Burford21-Nov-18 1:13
professionalDominic Burford21-Nov-18 1:13 
This article assumes that the reader is already familair with the MVVM software design pattern. If you are not familair with this design pattern, then it's worth reading up on that first, before proceeding with this article. There are many descriptions of this article, including this one[^]. It is useful to understand the design pattern from a purely conceptual perspective, before looking at the various technical impementations of it. By understanding the design pattern at a conceptual level, you will far easier comprehend its implementation details.

I have used the MVVM design pattern previously. In fact, I have used the MVVM pattern within our current mobile app. For this, I used Kendo UI controls in conjunction with javascript. This particular implementation uses what is known as an observable. An observable (which is based on the Observer design pattern[^] is an object that maintains a list of dependents (called observers) and notifies them of any changes in state. It is this notification system that provides the two-way notification (or binding) that is essential to the MVVM design pattern.

With our latest incarnation of the mobile app now well underway, we have come to the point where we can start building our data entry forms. I have so far implemented the underpinning infrastructure and architecture which enables the app to consume our services, save data to local storage using SQL Lite and send emails from the app. All of this is now fully implemented and working.

We have several data entry forms within our app that allow the user to submit data to our backend services. These include forms for submitting:

- mileages
- service, repair and MOT bookings
- vehicle inspections

As we have already done so in our previous mobile app, we will be using the MVVM design pattern to implement these data entry forms.

We will impement the data entry forms using XAML and Telerik controls. We could have used the native Xamarin UI controls, but there is a greater selection of Telerik controls, and they provide a consistent API and are easily themable. Although the implementation uses Telerik controls and XAML, the underlying concepts can be applied with any UI technology.

I'll use an example that refers to a simple data entry form that allows a user to enter a message which is sent to the backend service. The message may be to request information for example. This trivial example containing just the one UI control should suffice to demonstrate how the MVVM pattern can be implemented.

I tend to begin the development of a new data entry form from the Model and work backwards from there i.e. Model -> ViewModel -> View.

All Models inherit from the the same base Model class. This base Model class inherits from NotifyPropertyChangedBase which is a Telerik class that supports behaviour similar to INotifyPropertyChanged.
public class BaseFormModel : NotifyPropertyChangedBase
{
}
This ensures that all Models used by the data entry forms will support the ability to raise events when a property on the Model changes. These changes to the Model will be notified to the ViewModel.

Models used by the data entry forms also inherit from the following interface.
public interface IFormData<T>
{
    T CreateDefaultModel();
}
By implementing this interface, the Model must therefore contain the method CreateDefaultModel(). This method is used by the ViewModel to supply a default Model (containing default values) which can be used when the View (the XAML form) is first displayed to the user. It implements generics which therefore allows it to work with any type of Model.

Here's the Model for the "Message Us" data entry form. For the purposes of this simple example I have removed much of the code for clarity.
public class MessageUsModel : BaseFormModel, IFormData<MessageUsModel>
{
    private string _messageToSend;

    [DisplayOptions(Header = MessageUsModelConstants.MessageHeader)]
    [NonEmptyValidator(MessageUsModelConstants.MessageError)]
    public string MessageToSend
    {
        get => _messageToSend;
        set
        {
            if (_messageToSend == value) return;
            _messageToSend = value;
            OnPropertyChanged();
        }
    }

    public MessageUsModel CreateDefaultModel()
    {
        return new MessageUsModel
        {
            _messageToSend = ""
        };
    }
}
The decorations on the public property MessageToSend are Telerik specific and define the validation rules / messages for the property. These rules / messages are then enforced by the View. Using this particular implementation of MVVM, the data rules are therefore defined at the level of the Model (which makes sense). Whenever a new value is set on the MessageToSend property, the OnPropertyChanged() event is raised. This updates the state of the ViewModel that is bound to the Model.

Moving onto the ViewModel, we define the base behaviour for all our ViewModels in our base class.
public abstract class ViewModelBase<T> : NotifyPropertyChangedBase where T : new()
{
    /// <summary>
    /// This is the View-Model's reference to the Model. Use this whenever the view-model needs to reference the model.
    /// </summary>
    public T FormModel = new T();

    /// <summary>
    /// Implement this method in the derived class to define what actions to take when the user
    /// submits data from one of the data-entry forms 
    /// </summary>
    /// <returns></returns>
    public abstract Task PostCompleteTask();
}
I have used an abstract class that inherits from the same Telerik class as the base Model class i.e. NotifyPropertyChangedBase. The public property FormModel is a reference to the Model. This property is used by the ViewModel when it needs to refer to the Model. The method PostCompleteTask() is invoked by the ViewModel when the form is ready to be submitted. As this is an abstract method, it must therefore be implemented by each inheriting subclass. This provides consistency to all of our ViewModels. The actual work performed by each ViewModel will always be defined within this method.

Here's the ViewModel for the "Message Us" class. For the purposes of this simple example I have removed much of the code for clarity.
public class MessageUsViewModel : ViewModelBase<MessageUsModel>
{
    public MessageUsModel MessageUsModel;
        
    public MessageUsViewModel()
    {
        this.MessageUsModel = this.FormModel.CreateDefaultModel();
    }

    public override async Task PostCompleteTask()
    {
        //implement your code here to submit the form data
    }
}
The public property MessageUsModel is the reference to our Model. This is initially populated with a default instance in the class constructor by invoking the method CreateDefaultModel() (which we saw earlier) using the public property FormModel (which we also saw earlier).
this.MessageUsModel = this.FormModel.CreateDefaultModel();
When the user has finished entering their message and is ready to submit the form, clicking on the form's submit button will invoke the PostCompleteTask() method that will perform whatever processing as necessary (in our case all form data is submitted to our backend services using RESTful Web API services).

Finally, here's the XAML for the View and the code-behind.
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class MessageUsView : ContentPage
{
    public MessageUsViewModel Muvm;

    public MessageUsView()
    {
        InitializeComponent();

        //initiate the view-model and bind it to the form
        this.Muvm = new MessageUsViewModel();
        this.BindingContext = this.Muvm;
    }

    private async void DataFormValidationCompleted(object sender, FormValidationCompletedEventArgs e)
    {
        dataForm.FormValidationCompleted -= this.DataFormValidationCompleted;

        if (e.IsValid)
        {
            await this.Muvm.PostCompleteTask();
        }
    }

    private void CommitButtonClicked(object sender, EventArgs e)
    {
        dataForm.FormValidationCompleted += this.DataFormValidationCompleted;
        dataForm.CommitAll();
    }
}
And the XAML code.
<input:RadDataForm x:Name="dataForm" CommitMode="Immediate"  />
<input:RadButton x:Name="CommitButton" Text="Save" Clicked="CommitButtonClicked" IsEnabled="True"/>
The important parts to note are the setting up of the binding between the View and the ViewModel in the constructor. This sets up the two-way binding, such that any changes in the View are reflected in the ViewModel and vice-versa. These changes are also reflected in the underlying Model (if that wasn't already clear).
this.Muvm = new MessageUsViewModel();
this.BindingContext = this.Muvm;
When the user clicks the Submit button, the actions implemented within the ViewModel's PostCompleteTask() method are invoked.

This is a fairly simple example. In a real world use case there would undoubtedly be more complexity, but this should serve as a useful example of using the MVVM design pattern within a Xamarin mobile app. The fact that we are using Telerik UI controls doesn't change the core concepts discussed. The MVVM design pattern is a very powerful design pattern that is perfect for use within data entry forms.
"There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult." - C.A.R. Hoare

Home | LinkedIn | Google+ | Twitter

GeneralConsuming a private nuget feed in an Azure DevOps build pipeline Pin
Dominic Burford2-Nov-18 6:55
professionalDominic Burford2-Nov-18 6:55 
GeneralBuild a Xamarin.Forms iOS mobile app using Azure DevOps Pin
Dominic Burford8-Oct-18 23:38
professionalDominic Burford8-Oct-18 23:38 
GeneralDeploy a Mobile app to Azure using Azure DevOps Pin
Dominic Burford21-Sep-18 5:30
professionalDominic Burford21-Sep-18 5:30 
GeneralSetting up my first build pipeline with Azure DevOps Pin
Dominic Burford19-Sep-18 4:06
professionalDominic Burford19-Sep-18 4:06 
GeneralChoosing a mobile application development platform Pin
Dominic Burford4-Sep-18 1:36
professionalDominic Burford4-Sep-18 1:36 
GeneralExecuting an AJAX request from an ASP.NET Core querystring parameter Pin
Dominic Burford20-Aug-18 5:05
professionalDominic Burford20-Aug-18 5:05 
GeneralBuilding a Document Manager with ASP.NET Core 2.1 Pin
Dominic Burford19-Aug-18 22:38
professionalDominic Burford19-Aug-18 22:38 
GeneralReducing the surface area of the client Pin
Dominic Burford26-Jul-18 21:32
professionalDominic Burford26-Jul-18 21:32 
GeneralUnderstanding what you're doing Pin
Dominic Burford26-Jul-18 3:24
professionalDominic Burford26-Jul-18 3:24 
GeneralSetting environments in ASP.NET Core Pin
Dominic Burford16-Jul-18 21:29
professionalDominic Burford16-Jul-18 21:29 
GeneralCreating a zipped deployment for an ASP.NET Core web application Pin
Dominic Burford28-Jun-18 23:59
professionalDominic Burford28-Jun-18 23:59 
GeneralI’m turning into a Microsoft fanboy Pin
Dominic Burford8-Jun-18 5:45
professionalDominic Burford8-Jun-18 5:45 
GeneralAdding a confirmation dialog to an ASP.NET Core 2.0 form page handler Pin
Dominic Burford7-Jun-18 4:34
professionalDominic Burford7-Jun-18 4:34 
GeneralUploading a file in ASP.NET Core 2.0 Pin
Dominic Burford1-Jun-18 4:07
professionalDominic Burford1-Jun-18 4:07 
GeneralASP.NET Core 2.0 Razor Page Handlers Pin
Dominic Burford15-May-18 0:01
professionalDominic Burford15-May-18 0:01 
GeneralMocking the HttpContext Session object in ASP.NET Core 2.0 Pin
Dominic Burford30-Apr-18 4:31
professionalDominic Burford30-Apr-18 4:31 
GeneralUsing ViewComponents in ASP.NET Core 2.0 Pin
Dominic Burford16-Apr-18 22:49
professionalDominic Burford16-Apr-18 22:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.