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.
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”
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.
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.
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.
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.
UWP apps, like the Windows Phone 7 and 8 platforms before them can have Background Tasks, while a background task for the Morse Coder app might not be enormously useful at this stage, let’s take a look at how to create one. In a further post we will look at updating the Live Tile from our Background Task.
Outcome
By the end of this post we’ll have a Background Task running on a schedule. It won’t do anything, but we will have set up the permission in the manifest, created the project, and our task class and registered it with the application. We will then be ready to implement the task.
Dependency registration in SimpleIoc, by default uses Lazy Instantiation, meaning the object won’t be created until it is requested, in this case, via the property on the ViewModelLocator class.
Due to configuring subscription of a message type in the Constructors of my ViewModels in MVVM Light I recently came across a situation whereby messages were being published prior to them having been subscribed to, meaning that the messages disappeared into the void unhandled. The ViewModels relating to the pages I had navigated to were available in the ServiceLocator, but the pages that I hadn’t navigated to were not being instantiated.
Using Styles to create a consistent User Interface is generally considered to be a best practice. In much the same way as CSS is used on the Web, Styles in XAML provide a similar development experience.
Outcome
By the end of this post we will have implemented a Style to target our About and Settings Buttons on the Home Page. removing some of the duplication in the XAML definitions.