Pretty sure twitter will give you the complete story@stuartm9999 @sconve yes.. our objects maintain all logic— Shay Doherty (@shaydmusic) November 2, 2016
Wednesday, 2 November 2016
The EF Conversation with @shaydmusic
Tuesday, 1 November 2016
Because I like a bit of schema
Great sketch eh!
OK - a route can be used in an event many times - usually every year but maybe more often. (The route itself may actually change but I don't think were actually concerned with that in this model).
Each event has a bunch of Participants who are made up of the riders. A rider can participate in multiple events.
The riders details are pretty much static except they get a new licence number each year.
Obviously they move and so on, but I don't see any particular need to track that against the events - just the current details should do.
Events have organisers - or maybe rides do - they can have more than one so I've just realised the model is wrong - need a join table.
Did think that the organisers were against the ride - but there not as they sometimes change year to year as the route gets passed from person to person.
Riders and organisers are users of some sort - but the chances are I'll pick up this bit of schema from the standard ASP.NET authentication database - or whatever those clever people at Redmond use these days.
I can smell the code ...
OK - a route can be used in an event many times - usually every year but maybe more often. (The route itself may actually change but I don't think were actually concerned with that in this model).
Each event has a bunch of Participants who are made up of the riders. A rider can participate in multiple events.
The riders details are pretty much static except they get a new licence number each year.
Obviously they move and so on, but I don't see any particular need to track that against the events - just the current details should do.
Events have organisers - or maybe rides do - they can have more than one so I've just realised the model is wrong - need a join table.
Did think that the organisers were against the ride - but there not as they sometimes change year to year as the route gets passed from person to person.
Riders and organisers are users of some sort - but the chances are I'll pick up this bit of schema from the standard ASP.NET authentication database - or whatever those clever people at Redmond use these days.
I can smell the code ...
Sprint One - Still sharpening the sword
Not a single line of code has been written and Abe Lincoln is fast approaching his time to get the axe out.
So, whilst cycling of course, I went over my previous brief:
Then I'm going to upload the data from the excel files I have. This should give me a list of riders, existing entries and previous brevets.
I'm going to do all this in SQL Server management studio straight on the database
So, whilst cycling of course, I went over my previous brief:
As "Stuart McLean" I want to be able to get a csv list of entrants for a brevet.
"I'm going to create a database - whoop whoop - to store:
Riders,
The Brevets,
Entrants to a brevet - i.e. the relationship between the Riders and the Brevets.
Then I'm going to upload the data from the excel files I have. This should give me a list of riders, existing entries and previous brevets.
This should validate my data model.
I'm going to do all this in SQL Server management studio straight on the database!"
A couple of worries - in one hour.
- I have duplicates in my spreadsheets - not sure I'll have time in the hour to sort out these duplicates.
- Should I be starting with a database project?
I guess a "database project" is one of my technical user stories - after all I said in my first blog on this that doing some coal face work is part of the aim.
But I've never used the DB projects in anger. I know they've been around for ages but scripts have been around even longer.
In an hour!
OK - so heres another breakdown -
"I'm going to create a database - whoop whoop - to store:
Riders,
The Brevets,
Entrants to a brevet - i.e. the relationship between the Riders and the Brevets.
I'm going to upload the data for one of the previous brevets.
This should validate my data model.
I'm going to use a database project to create the schema and any procedures etc,
I'm going to create my brevets for 2016 - because I have them.
I'm going to use ssms to put the data in and out.
!"
Big question here that I need to address - how the heck am I going to get testing (system/uat) in in the hour?
Sunday, 30 October 2016
Sprint One - As "Stuart McLean" I want to be able to get a csv list of entrants for a brevet.
The physc evals tell me I'm an implementer - which means I get cracking on things but, as many around me know, rarely finish. You need a completer finisher for that.
So, I thought a lot and put one thing on the backlog that I might be able to achieve in an hour.
Let's start with the actor.
Well - there is a whole bunch of stuff that needs doing do secure the average online applicaiton - authentication, authorisation, deployment, hosting etc. As "Stuart McLean" I can circumnavigate all of these and focus on the data!
So, I thought a lot and put one thing on the backlog that I might be able to achieve in an hour.
Breaking down the user story
It looks pretty innocuous - right - but - believe it or not, there has been a fair amount of thought into such a simple story.
Let's start with the actor.
"Stuart McLean" - why not a brevet organiser.
Well - there is a whole bunch of stuff that needs doing do secure the average online applicaiton - authentication, authorisation, deployment, hosting etc. As "Stuart McLean" I can circumnavigate all of these and focus on the data!
Get a list of csv entrants
So as I said in my last blog - I already have a way of using excel to do lots of the admin. The big task is to get the data in a spreadsheet.
For a brevet
Well - I guess it's really for the next brevet!
What I have
Well - I guess I already have a list of previous people and brevets.
I also know what brevets are coming up.
Solution Overview
I'm going to create a database - whoop whoop - to store:
Riders,
The Brevets,
Entrants to a brevet - i.e. the relationship between the Riders and the Brevets.
Then I'm going to upload the data from the excel files I have. This should give me a list of riders, existing entries and previous brevets.
This should validate my data model.
I'm going to do all this in SQL Server management studio straight on the database.
Can I Sprint in an hour?
It seems the more I know, the less I get to do. I'm currently a technical architect for 6 sprint teams - which is exciting and challenging but I'm getting less and less (read no) time at the coal face.
The pace of change in IT seems to be exponential and I like to keep my toes on the edge of the programming curve.
OK - so I'd love to get back into Unix, c++, java and all that stuff - but it's been 15 years or so so I'm going to stick with the Microsoft stack.
The Challenge
Deliver a user story in one hour. That's one hour to code, test and release.
"Give me six hours to chop down a tree and I will spend the first four sharpening the axe."
Abraham Lincoln
I am going to allow - outside of the hour - study and plan. Hopefully this will make the hour super productive.
The project
The project is simple - and combines programming with my other passion - cycling. You can read about some of my cycling here. Every year I organise a few "Brevets" - long distance cycle rides for Audax Ireland. There is a bit of admin involved:- Collect details of participants - currently they email or post a form with name, address etc.
- Collect money - I accept PayPal or cash on the day. Not all organisers accept cash and some push the PayPal through the clubs. Different events cost different amounts. Payment can be made in € or £.
- Print "Brevet Cards" with the event details, riders details and control points.
- Sign on sheet for Cycling Ireland (CI) with list of riders to collect signature at start.
- One day licence form for riders who aren't members of cycling Ireland.
- On completion - fill in finisher details on spreadsheet for Audax Club Parisien to homogolate the rides and order medals where required.
- Submit accounts and pay balance toe Audax Ireland (AI).
- When homogolation stickers and medals arrive, post with brevet cards to riders.
Currently I run all this using a spreadsheet to collect the rider info on. I then have a word mail merge for the Brevet cards and cut and paste onto the other documents.
The biggest pain is actually getting the data on the spreadsheet. It is either keyed or cut an pasted depending on how the application arrives. I can also sometimes cut and paste from an old spreadsheet - but the CI license numbers change every year and other details may change.
The tech
- SQL Azure - assuming a relational database - might need other azure tech around the outside for large data or whatever.
- C#.net for business object layer, processes etc.
- MVC for serving HTML to client
- WEB API - for services
- Angular
- Visual Studio
Entity framework or ADO.NET + Strongly typed stored procedures.
Its a question that's been worrying me for about 8 years!
Currently I have projects working with ADO.NET and stored procs (most), EF and unit of work, and EF over stored procedures. I'm still torn between development speed, security, maintanence and
Strongly Typed Stored Procedures
- Tick a big security box - giving lease privilege access to the database and strong type checking - a string is a string never a piece of sql, thus adding a layer of defence against many forms of attack, SQL injection being the most obvious. OK - O know EF will have vendor backing and is paramaterised etc. etc. but believe me, when some external auditor comes in and says what layers of defence do you have against attack, the strongly typed stored procedure with least privilege (i.e. connection can only execute stored procs) is king.
- Are fast
- Do set based operations where they belong - in an engine that has been optimised over about twenty five years for performing set based operations!
- Allow provide an encapsulation layer over your data model, allowing it to be changed and maintained independent(ish) of your code.
- Allow your database to be normalised and your object model to be de-normalised as. it should be.
- Allow your interactions with the database to be as they should i.e. full control over how much data is fetched when.
- Is stable with a very long support life ahead and behond - ADO.NET.
- Can lead to business logic being scattered across code and sql depending on who wrote it!
- Can result in stored procedure mountains.
- Offer a great maintainence fix.
Entity Framework
- Is quicker to develop - though I'd argue this might only be over the first few iterations of a project.
- Supports more flexible query functionality for the application e.g. sorting, querying multiple parameters etc. without additional effort.
- Can leave you fighting the framework.
- Is not as stable
- Is not as secure
- Through web services - offers a consistent business layer for other applications e.g. reporting etc.
- May lead to compromises in the data model (de-normalised) or the business object model (too normalised).
- Requires a full code deploy.
I'm going to put this decision off a bit longer!
Project management and tools
OK - so its agile, obviously.
Agile tool/work tracking
TBD - I have visual studio online/visual studio team system and this is the obvious choice but I might look at a more "open" product - after all I'm wearing shorts right!
I guess initially it'll be this blog as my Minimum Viable Product in an hour is going to be very minimum.
Source Code Repository
To open source or not to open source, that is the question - well - I really want to open source - not that I'm expecting a million IT pros to rock up and start working on this but, like I say, I wearing shorts. I thing I need to be careful of is ideally I'd use some of Stiona Software's utility and platform code but this has IPR wrapped in it and I'm not wearing sandals. Software is my living too.
Again - with my shorts on GIT - but frankly it's something else to learn at the moment.
So - probably codeplex. I have an account and it integrates with visual studio.
Tuesday, 11 October 2016
Powershell delete all recycle bins
Get-ChildItem "D:\`$Recycle.bin\" -Recurse -Force | Remove-Item -Force -Recurse
Blatantly stolen from http://serverfault.com/questions/330776/clear-the-recycle-bin-for-all-users-in-windows-server-2008-r2
Monday, 10 October 2016
Powershell Azure - when you have multiple "directories"/ tenants.
Documentation didn't really cover this too well but when I tried to use powerhell to move items between subscriptions I kept getting an invalid subscription id. I eventually deduced it was because I have two directories/tenants and was in the wrong one.
List subscriptions using
then select one in the right tenant making sure you specify the TenantID too.
Once you've done that, moving subscriptions etc. works for that Tenant.
List subscriptions using
Get-AzureRmSubscription
then select one in the right tenant making sure you specify the TenantID too.
Select-AzureRmSubscription -SubscriptionId xxxxx -TenantId yyyyyBasically it seems if you've multiple "Directories" / tenants you have to specify the tenant id.
Once you've done that, moving subscriptions etc. works for that Tenant.
Subscribe to:
Posts (Atom)

