Web API Tutorials Part 3 : Translation Abstraction

There’s a famous quote in the world of Software Development:

“We can solve any problem by introducing an extra level of indirection.”

In my experience, this is almost certainly correct, this post will see us adding in an additional layer of Abstraction to allow us to simplify our Controller(s) and manage our Dependencies in a more straightforward manner.

Outcome

Last post saw us implement our Translation PCL into our Web API using Dependency Injection.  The problem is that our ITranslator Interface only handles a single Translator Implementation, such that when we inject from our Container we can’t currently translate more than one direction.  We’ll look into the why’s shortly, but by the end of the post we will have created :

  • ITranslatorService Interface;
  • TranslatorService Implementation and Unit Tests.

Continue reading “Web API Tutorials Part 3 : Translation Abstraction”

Web API Tutorials Part 2 : Translation PCL with Dependency Injection

Portable Class Libraries afford great benefit when it comes to sharing code across platforms/usages.  We can share a single library across our UWP App where it’ll run locally and on our Web API where it’ll execute behind our endpoint.  Dependency Injection has been made very accessible with the latest ASP.NET MVC Web API.

Outcome

The current MorseCoder.PCL targets only Windows 8.1 as it’s point of API Reference.  We’ll need to change that to extend it to the wider .NET Framework (we’re not doing anything prohibitive, so this isn’t a problem).  By the end of the post we’ll have updated our PCL to target what we require, and integrated it into the Web API Project using Dependency Injection to pull in an instance of our Translator from the IServiceCollection container.

Continue reading “Web API Tutorials Part 2 : Translation PCL with Dependency Injection”

Web API Tutorials Part 1 : Web API

ASP.Net MVC Web API provides a straight forward controller based approach to creating RESTful HTTP based web services.  It should be quite familiar to anyone with an ASP.NET MVC background.  This tutorial won’t be focussing on what is and what is not RESTful, (there’s plenty of that already, and can get a little religious!).

Outcome

By the end of this post we’ll have created an ASP.Net MVC 5 Web API Project, and a new Controller ready for implementation.

Continue reading “Web API Tutorials Part 1 : Web API”

Development Team Leadership First Steps : Part 12

Bugs

Despite what your boss might like to think, Bugs are a fact of Software.  There’s a number of things you can do to minimise the occurrence, the severity and the impact bugs might have, mostly centring around having a reliable set of Unit Tests.  Regardless of your best efforts, they will still find a way through the net, it’s how you handle them that matters.

Be Honest

My first piece of advice would be to be honest about them, and the root cause, however embarrassing to you or your team it might be.  It’ll be too late to cover it up, so don’t waste your time thinking of excuses.  Get to the root cause and come up with a plan to resolve it.  If it’s a major problem in Production it’ll be on your shoulders to come up with a strategy to expedite a resolution. Continue reading “Development Team Leadership First Steps : Part 12”

Development Team Leadership First Steps : Part 11

Fear-Of-The-Dark.jpg

I recently read The Software Craftsman, as mentioned in the review, one of the areas that struck a chord with me was the viewpoint on Legacy Code.  I deal with a lot of Legacy Code in my day job, I’ll share a few of my own thoughts and experiences on the matter.

Legacy Code – Respect

It’s important to treat Legacy Code with Respect, from all angles.  Treat it with respect regardless of how poorly some of the code may have been written, or how antiquated the technology may now be.

Continue reading “Development Team Leadership First Steps : Part 11”

Review : The Software Craftsman by Sandro Mancuso

The term Software Craftsmanship seems to be rather divisive in its support, with, as mentioned in the book numerous times (along with retorts) the fact that the movement can come across as elitist.  At it’s core it’s another manifesto, a fairly open-ended one at that, but having read the book it extends far beyond this.

In much the same way as Agile, in the pure sense, is more of a mindset than a prescriptive set of rules, the ideas behind Software Craftsmanship conveyed in the book really lean towards achieving excellence, building on and complementing a lot of the practices outlined under XP and Agile.

TheSoftwareCraftsman.jpg
The Software Craftsman

Continue reading “Review : The Software Craftsman by Sandro Mancuso”

Development Team Leadership : First Steps Part 10

Don’t take requirements on Face Value

Often your requirements can overstep outlining the business need and into murky waters of business users defining technical solutions; which are rarely the way we would choose to do it, or in some cases even technically feasible.

“Has the world gone mad; or is it me?” – Ben Howard

As professionals it’s our obligation to probe these requirements until we’re left with something that makes sense that all parties are happy with.  It’s always worth asking why, sometimes a requirement can disappear altogether as a result.

This isn’t doing yourself out of work, it’s enabling you to do the “right” work, this is mutually beneficial; we’re paid not only to write software but to provide a service, probing will prove your understanding of the business and ultimately build trust.

Bigger Picture

Make sure you understand how the component you are writing fits in with the architecture as a whole.  As the Development Lead you’ll be expected to be capable of participating in conversation with all areas of your team and all levels of the business, from those with a vested interest in a particular piece of functionality, all the way up to those who aren’t interested in the minutiae, just the fact that the system works.

If you don’t understand how your software fits in with the wider Organisation you won’t be able to fulfil this.  Again, if you can prove your understanding you’ll gain trust, but it’ll also enable you to more conclusively understand requirements if you understand for example what impact your validation (or lack of!) may have on downstream systems.

Are we there yet?

You’ll inevitably be asked (“probably” by Project Managers, and “probably” numerous times) whether you’ve finished a Task, it’s nice to have an answer to hand about not only your own work, but that of the team.  Having a visible board to track progress on is really part of the Agile process, having one of these can ease the pressure, (but that doesn’t mean you won’t be asked!).

Not only is it good to have an answer to questions, but if you have an idea of whether your team is likely to finish all of the tasks on your current sprint then it will allow you to raise the alarm early, or re-prioritise workload within the team.