Clarksons | Arc
- Project Category: .Net | Bootstrap | AngularJS
- Client: Clarksons Platou
- Start Date: April 2015
- End Date: August 2015
- Multi-vessel and destination voyage estimation
- Distance calculation
- Complex ETL synchronisation with poor data sources
- Responsive design for use on multiple form factors
Clarksons are a very old shipping brokerage, about 180 years old. However their development team is relatively new, about 6 years old. Over the years they have collected a disparate set of legacy desktop application to support both voyage estimation and fixtures. In addition each department had their own set of these applications. Arc is the replacement for all of these.
When I joined the project it had already been up and running for a year with a live system supporting about 100 users. However in the rush to fulfill business need and with the previously tech lead leaving the code base in a sub-optimal state there were going to be some very large refactors in order to reduce cost of ownership and leave the code base in a malleable state.
After spending sometime assessing the state of play, the first port of call was identifying the baby from the bath water and ensure the right one was disposed of. The general architecture and framework selection was sound but there were no use of SOLID and the onion separation of DDD had was completely ignored. In addition to this the EF implementation was using an EDMX causing collisions between engineers in the team. Because of the EDMX the domain was split over 2 assemblies using partial classes. This had lead to application service logic being place in the web api controller where repositories were called directly.
The EDMX had to go. It was the root of all evil but with 136 domain entities and all the places these were used it was not easy. In fact it was one of the biggest and most complex refactors for me to date. The code was littered with code smells but arrow code was by far the largest with lots of methods over 800 line and a couple over 1500. These were broken down and in some case a single method became multiple classes. Before an individual refactoring took place any test that could be put in were but because the poor code design this was rarely possible. However as a method became multiple public classes, meaningfull AAA unit tests were implement in a red green manor if possible. Over my time the test cover increased 4 fold.
Next step was to have a look at the Angular/TypeScript implementation. This was in a better shape but some golden rules had been broken that was stopping unit testing being implemented. It was obvious this was due to some global variables and while test could have been put in the set up for each BDD fixture made this prohibitive. Once removed the jasmine/karma implementation went pretty smoothly.
- .Net 4.5
- Web Api 2.2
- Entity Framework 6
- Sql Server 2012
- AngularJS 1.3
- Windows Service
- Fake It Easy
Here are some projects that use similar technologies