Click here to Skip to main content
15,881,613 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.


 
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 
GeneralWeb application metrics with Application Insight Part 2 Pin
Dominic Burford10-Apr-18 22:50
professionalDominic Burford10-Apr-18 22:50 
GeneralWriting flexible code in ASP.NET Core 2.0 Razor Pages Pin
Dominic Burford3-Apr-18 5:06
professionalDominic Burford3-Apr-18 5:06 
In a previous article I demonstrated how to write flexible code[^] for n-tier designed applications. In this article, I want to describe how I approached designing my code for our ASP.NET Core 2.0 Razor Pages application. My key goal was to separate out the various concerns, and in particular keep the UI code separate from the business logic code.

We are using Razor Pages in our current app, and all the business logic is encapsulated within our ASP.NET Web API services which are invoked by the Razor Pages. A Razor Page is backed by a PageModel class which supplies much of the "plumbing" logic behind the Razor Page. For example, the PageModel class contains such things as the Response, the Request, ViewData, PageContext, HttpContext. But no business logic. So this article will describe how I have approached surfacing business logic within my Razor Pages.

It is worth noting that I have deliberately used a very simple example for clarity and to keep the article nice and simple.

The first thing I did was to create a base PageModel class for the Razor Pages. As stated earlier, all Razor Pages are backed by a PageModel class as in the following code.

public class IndexModel : PageModel
{
    //rest of code goes here
}
So I created a base PageModel class that I would use instead. My base PageModel class inherits from the default AspNetCore.Mvc.RazorPages but adds the ability to specify a completely different class which will contain all the business logic.

public class PageModelBase<T>: PageModel where T : PageModelService, new()
{
    public readonly T Service = new T();
}
I wanted consistency in my design, so I created a base service class that would be instantiated by the PageModel classes. I have called this class PageModelService class. In the example code above, I am creating an instance of this backing service class in my PageModel. The PageModelService class is where I will place all my business logic code (which in my case are my ASP.NET Web API services). This separation ensures that the business logic code is separated out from the UI code, and is therefore also unit-testable.

Here's my PageModelService class definition.

public abstract class PageModelService
{
    protected abstract string ModuleName { get; }
}
I only have one property defined (the name of the module to which the Razor Page belongs), but you can define as many properties, methods etc as your applications needs. Remember, this is the base PageModelService class, so only place code here that is applicable to all your Razor Pages.

Here's an example class definition for a PageModelService that sets the ModuleName property in the constructor.

public class ExamplePageModelService : PageModelService
{
    public ExamplePageModelService ()
    {
        ModuleName = "Example Module;
    }
    protected override string ModuleName { get; }
}
Finally, here's a Razor Page using the new PageModelBase class and setting the name of the backing service (which will be instantiated by the class).

public class ExamplePageModel : PageModelBase<ExamplePageModelService>
{
    public OnPost()
    {

    }

    public void OnGet()
    {
            
    }
}
This very simple design pattern allows us to separate the UI code from the business logic code within the Razor Pages and allows the business logic code to be unit tested also. So if you're building Razor Pages and want to keep your UI code separate from your business logic code, then give this design pattern a try. You are encouraged to amend the code to suit your own specific requirements, but feel free to use the code as a starting point.
"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

GeneralPerforming Code Coverage for .NET Core 2.0 applications Pin
Dominic Burford23-Mar-18 4:54
professionalDominic Burford23-Mar-18 4:54 
GeneralRe: Performing Code Coverage for .NET Core 2.0 applications Pin
Slacker00723-Mar-18 5:12
professionalSlacker00723-Mar-18 5:12 
GeneralRe: Performing Code Coverage for .NET Core 2.0 applications Pin
Dominic Burford23-Mar-18 5:15
professionalDominic Burford23-Mar-18 5:15 
GeneralBuilding ASP.NET Core 2.0 web applications Pin
Dominic Burford21-Mar-18 5:39
professionalDominic Burford21-Mar-18 5:39 
GeneralObtaining the authentication token returned from Azure AD B2C in ASP.NET Core 2.0 Pin
Dominic Burford16-Mar-18 2:03
professionalDominic Burford16-Mar-18 2:03 
GeneralVersioning a .NET Core 2.0 application Pin
Dominic Burford13-Mar-18 2:34
professionalDominic Burford13-Mar-18 2:34 
GeneralThe next generation technical stack Pin
Dominic Burford12-Mar-18 4:43
professionalDominic Burford12-Mar-18 4:43 
GeneralWriting flexible code Pin
Dominic Burford22-Jan-18 23:58
professionalDominic Burford22-Jan-18 23:58 
GeneralA cautionary tale of over-confidence in your own opinions Pin
Dominic Burford22-Dec-17 1:57
professionalDominic Burford22-Dec-17 1:57 
GeneralWhat lies ahead in 2018 Pin
Dominic Burford21-Dec-17 0:18
professionalDominic Burford21-Dec-17 0:18 
GeneralTemplated HTML emails using RazorEngine Pin
Dominic Burford30-Nov-17 4:49
professionalDominic Burford30-Nov-17 4:49 
GeneralSending emails using Azure Sendgrid service Pin
Dominic Burford29-Nov-17 11:18
professionalDominic Burford29-Nov-17 11:18 
GeneralBuilding native enterprise apps is (probably) the wrong approach Pin
Dominic Burford28-Nov-17 1:05
professionalDominic Burford28-Nov-17 1:05 
GeneralAppropriate vs Consistent Pin
Dominic Burford9-Nov-17 3:24
professionalDominic Burford9-Nov-17 3:24 
GeneralCreating Generic RESTful API Services Pin
Dominic Burford20-Oct-17 5:01
professionalDominic Burford20-Oct-17 5:01 
GeneralIs your software team a democracy or a dictatorship? Pin
Dominic Burford16-Oct-17 21:44
professionalDominic Burford16-Oct-17 21:44 
GeneralSimplifying updating data Pin
Dominic Burford21-Sep-17 22:46
professionalDominic Burford21-Sep-17 22:46 

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.