Wednesday, 25 September 2019

NET Core 3.0: SDK, Runtime and Set up for Development

1. Introduction

.NET Core 3 was just released recently, along with C# 8, with poweful features and improvements. As I am planning to write a couple of articles about .NET Core and its interactions with different kinds of software packages, this is a good time to do so. This is likely to be the first of many articles about the .NET Core in my blog.

I will concentrate first on the topic of the .NET Core SDK and Runtime Versioning, and the Set up on a development machine in this article. .NET Core evolution has gradually resulted in many SDK and runtimes and installing the latest SDK and Runtime sometimes is not sufficient in my experience. Without a strong foundation and a good understanding of various things, a little hiccup is likely to throw us into confusion. This article is my attempt to demystify this kind of experience through many trials and errors and hopefully put us in a strong foot to start a .NET Core journey going forward. Potentially there are many things I may have missed along the way, please free to comments and I am happy to rectify after some double-checking.

Sunday, 15 September 2019

Working in an agile Team

When I first joined my current company, as a software developer, I worked in a waterfall engineering process environment. I had a team lead which would give some job to do, and for the rest of the time, I could spend a number of days without interaction with other people. Working in those days was soul-sucking, draining my energy and motivation bit by bit. Things improved a little bit when I was moved to a larger team, and the situations were pretty much still the same, but with harder and complex problems to solve and this gave me a bit more motivation to work.

FHIR Path Validation with SpecFlow

I worked on a project related to FHIR (Fast Health Interoperability Resources), and I was temporarily moved to the test automation team to help them with their workload. I learned soon that they wrote a lot of validators code to interrogate and validate different part of FHIR resources. For example there were ObservationValidator, ImmunizationValidator and the list went on.

I was thinking this was not effective as it did not conform DRY (Don’t Repeat Yourself) principles. I did my research and considering different alternative ways to replace the framework such as using JSON path, XPath and lastly FHIR Path. FHIR Path seems to be no brainer solution to choose from as it is written especially for navigating FHIR resources.

The full specification of the FHIR Path can be found here . Here is some snippet from the web page explaining what FHIR Path is.

Friday, 21 December 2018

End of 2018

The end of 2018 is on the horizon now. Joining with many other in the world, this is the best time of the year to reflect and make a resolution for the year to come.

Reflecting my life in 2018

At the beginning of the year, I was promoted to a Senior Developer role within my company after a successful internal interview process. The process pretty much the same as if you are going to be interviewed by an external company, which comprised of corporate value interview, behavior interview, and technical skills interview.

The first two interviews were using STAR model (Situation, Task, Activity, Result) approach, while technical skills interview include take-home application development, presentation, and interview. The take-home application was weather API application development. I only have less than one week to prepare, so I focus on the backend side of the application and only a slight touch on the front end. The complete code can be seen in the my gitHub repo here . The overall process going pretty smooth for me.

This year I also learned how to look after what I eat daily. Diet is important, and become very important after 40-an. Initially, I opt-in for low carbohydrate diet, my gradually add some carbohydrate back to my diet. I end up with DASH diet, which comprises half vegetables and fruit, a quarter of protein and quarter of carbohydrate. I also exercise regularly by running to/from work which takes about 30 minutes one leg of the journey.  Having done it for two months, my blood pressure gradually dropped to the borderline of normal range 120/80.

During this time, I also realized that a healthy lifestyle is VERY important, I do a lot of research about healthy lifestyle and become more aware of it, and became my first priority during this time. I put a list about healthy food I can consume daily, and I also start to avoid certain food. There are still many things to do on my list to acquire a healthy lifestyle, which  I am going to make a resolution for next year.

The other thing that happened to me this year was I got my residence permit in the UK in November. So no more visa application to stay and live in the UK, and free to work anywhere if I so wish. I applied at the same time as my wife at the PEO (Premium Service Center) in Liverpool and got approval on the same day. We overjoyed and spent the rest of the day sightseeing in the city.

At the end of the year, we are getting a family visit from my wife side and we will travel around the UK.

Friday, 15 December 2017

Clean Factory Design Pattern with IoC container

Audience


This article expects audience have familiarity with Dependency Inversion Principle (DIP) and Factory Design Pattern. For simplicity, the code is not defensive and there is no guarded statements. The code is using Simple Injector, but the described principles applies to other IoC container frameworks as well. The source code of the examples can be found in github by following this link


Problem


When implementing a factory class in a project which uses a Inversion of Control (IoC) container, and you arrive to the solution described below, then this article is for you:
using System;
using DirtyFactory.Dependencies;

namespace DirtyFactory.Processors
{
 internal class ProcessorFactory : IProcessorFactory
 {
  private readonly IDependencyOne _depOne;
  private readonly IDependencyTwo _depTwo;
  private readonly IDependencyThree _depThree;

  public ProcessorFactory(IDependencyOne depOne, IDependencyTwo depTwo, IDependencyThree depThree)
  {
   _depOne = depOne;
   _depTwo = depTwo;
   _depThree = depThree;
  }

  public IProcessor Create(RequestType requestType)
  {
   switch(requestType)
   {
    case RequestType.Internal:
     return new InternalProcessor(_depOne, _depTwo);
    case RequestType.External:
     return new ExternalProcessor(_depOne, _depThree);
    default:
     throw new NotImplementedException();
   }
  }
 }
}

Monday, 21 August 2017

Deep Dive into OWIN Katana and Web API


I was asked to give a presentation about OWIN and Web API to a different development team, as they wanted an introduction to the technology and no one in the team had exposure to that technology before. Prior to that, I have developed a number of internal API for our company. With the presentation slides and materials, I decide to write them down as a blog post as well, so it will be documented properly. I put a lot of extra information compared to the original presentation to cover a broader audience in the internet.

Saturday, 25 March 2017

Generic Pattern: How to do Fluent-API on both Derived and Base classes

I would like to share a lesson learned from work. I am working on a FHIR (Fast Healthcare Interoperability Resources) project. The task at hand was to create builder classes, which basically populate properties of different kinds of resource objects (e.g Patient, Order, Schedule , etc). All these resources are derived from the same object called Resource, which comprises properties such as Id, Meta (contains VersionId and Profile). The derived classes may have their own specialization properties/fields.