MVC planning poker – First vertical – security – part 3

Let’s read the Use Case 3, Boot from table:

Use Case 3: Moderator can boot from the table
Moderator can boot from the table( permanently of just for this session ) any participant.
If permanently, the participant with this name can not join anymore

 

The following code is written , for adding a participant to be booted from table

public void UseCase3RightPath()
        {
            var ModeratorName = "ignat andrei";
            string newParticipantName = "new participant";
            var roundName = "UseCase2 - Join Table";
            var table = TableFactory.CreateTable(ModeratorName);
            table.AddParticipant(newParticipantName);
            table.BootParticipant(table.ModeratorName, newParticipantName);

        }

And after that? How do I recognize that is a Moderator from a participant?

I must have a layer that recognize that, either from name, either from an ID (because I said that the software is to be put on AD/LDAP , then the name will be unique). However, if I wrote code like that:

 

 table.BootParticipant(ModeratorName, newParticipantName);

Then any part of the software that can find the moderator name could boot any participant – even in the participant the code can be written like this:

table.BootParticipant(table.ModeratorName, newParticipantName);

I need to create a security layer to recognize moderator from participant and , when first adding a moderator, unique identify this moderator over the whole table.

So on the moderator the code will be:

moderator.BootParticipant(table.id, newParticipantName);

So I need now a User class –and a Moderator class – with a function that says: BootParticipant.

The problem is that a regular user is promoted as Moderator in this instruction

var table = TableFactory.CreateTable(ModeratorName);

How this is translated into code ? I am thinking and I will come with a solution next time.

MVC planning poker -Test driven development and Version control and Continuous Integration– foundation – 2

After setting the use cases, I have now think about code. ( Ok, maybe it should be first architecture, but I am a programmer first )

So I start to code the first Use case :

 
public class UseCase1CreateTable
    {
        [TestMethod]
        public void UseCase1RightPath()
        {
            var ModeratorName = "ignat andrei";
            var roundName = "UseCase1 - Create Table";
            var table = TableFactory.CreateTable(ModeratorName);
            table.AddDuration(1);
            table.AddDuration(2);
            table.AddDuration(3);
            table.AddRoundName(roundName);
            
            Assert.AreNotEqual(0,table.Id.Length);
            Assert.AreEqual(true,table.CanAddUser);
            Assert.AreEqual(ModeratorName,table.ModeratorName);
            Assert.AreEqual(1,table.Rounds.Length);
            Assert.AreEqual(roundName, table.Rounds[0].Name);


        }
    }
 

Running the test was a no-brainer – it does not even compile. And it is good, according to https://msdn.microsoft.com/en-us/library/aa730844(v=vs.80).aspx 

Now I want to test the code, so I created the classes and now the  tests were all red (because there is nothing implemented yet, just compiling) . A hour and all is going smoothly until the test was green – http://en.wikipedia.org/wiki/Test-driven_development

Now the point is to enforce this behavior every time the programmer checks in some code.

So I think about Visual Studio Online – to test if , aside Version Control, it can help me with running test.

And yes, they have builds.And, being the single contributor to this project, I choose Gated Checkins

image

 

Now every time I check-in some code, the build will start and see what’s happening.

The code is at https://ignatandrei.visualstudio.com/DefaultCollection/MVC%20Planning%20Poker 

Exercise  for home:

Do you spot what is missing from
this test code ?

 
public class UseCase1CreateTable
    {
        [TestMethod]
        public void UseCase1RightPath()
        {
            var ModeratorName = "ignat andrei";
            var roundName = "UseCase1 - Create Table";
            var table = TableFactory.CreateTable(ModeratorName);
            table.AddDuration(1);
            table.AddDuration(2);
            table.AddDuration(3);
            table.AddRoundName(roundName);
            
            Assert.AreNotEqual(0,table.Id.Length);
            Assert.AreEqual(true,table.CanAddUser);
            Assert.AreEqual(ModeratorName,table.ModeratorName);
            Assert.AreEqual(1,table.Rounds.Length);
            Assert.AreEqual(roundName, table.Rounds[0].Name);


        }
    }
 

Friday links 105

  1. How Google Unified Its Products With A Humble Index Card | Co.Design | business + design
  2. The Hidden Cost Of Estimation | Agile Zone
  3. Fredkin’s paradox – Wikipedia, the free encyclopedia
  4. HTTP 206 Partial Content In ASP.NET Web API – Video File Streaming – CodeProject
  5. johnpapa/angularjs-styleguide · GitHub
  6. Exciting Things About ASP.NET vNext Series: The Ultimate Guide – Tugberk Ugurlu’s Blog
  7. Everything SQL Server Compact: Entity Framework 6 (& SQL Server Compact) (5)–Entity Framework 6 extensions
  8. Everything SQL Server Compact: Comparison of SQL Server Compact, SQLite, SQL Server Express and LocalDB
  9. Home | Mikael Eliasson
  10. Noda Time | Date and time API for .NET
  11. Logging SQL Queries in MVC With Entity Framework 6 – Sam Jenkins’ Blog
  12. MiniProfiler: A simple but effective mini-profiler for .NET and Ruby
  13. NodaTime: What date time is it? – Sam Jenkins’ Blog
  14. Magic Strings: How to avoid them in C# – Sam Jenkins’ Blog
  15. Core types quick reference
  16. Building Cross-Platform iOS/Android Apps with Xamarin, Visual Studio, and C# – Part 1 – Pluralsight Training
  17. Set-ExecutionPolicy
  18. Greatest Hits – Scott Hanselman
  19. Tips for Preparing for a Technical Presentation – Scott Hanselman
  20. Code Converter | Provided by Telerik
  21. Spring MVC REST Exception Handling Best Practices (part 1) – Stormpath User Management API
  22. www.projectsatwork.com/content/Articles/287265.cfm
  23. www.projectsatwork.com/content/Articles/285996.cfm
  24. Common Agile Anti-Patterns at Scale Along with Their Causes and Solutions | Net Objectives
  25. The Magical Number Seven, Plus or Minus Two – Wikipedia, the free encyclopedia
  26. SOA Bits and Ramblings: Error handling considerations and best practices
  27. Best Practices for building JSON REST Web Services | Building Feedly
  28. cdn.oreillystatic.com/en/assets/1/event/80/Get Some Rest_ Best RESTful API Practices Presentation.pdf
  29. 10 Best Practices for Better RESTful API | Thinking Mobile
  30. Best Practices for Designing a Pragmatic RESTful API | Vinay Sahni
  31. Validating your model with Web API | Ducas’ World
  32. Pablo M. Cibraro (aka Cibrax) – Validating your models in ASP.NET Web API

MVC planning poker – use cases and mockups – 1

 

I have decided to start a new project – MVC planning poker . This is inspired by http://en.wikipedia.org/wiki/Planning_poker  – and it is a program to sharpen my skills

The project is aimed to software enterprises using Active Directory – however, it can be used by any organization.

 

UseCase 1: Create table
Moderator identified by Name -  creates the table and the duration times(1,2,3,5,10) and optional the round name.

He has an ID to share to the next participants

UseCase 2: Participants join the table
Any user can join the table by entering the ID + name .

Use Case 3: Moderator can boot from the table
Moderator can boot from the table( permanently of just for this session ) any participant.
If permanently, the participant with this name can not join anymore

Use Case 4: Estimation saved
Moderator enters a round name (?) .
Participants choose a value.
When all participants have choosen the value, the cards are shown
The cards with  high estimates and low estimates are highlighted
Host press "create new estimation" and create new estimation
The old estimation is saved in history

Use Case 5: Round reset
Moderator enters a round name (?) .
Participants choose a value.
Host press "reset round " and a fresh new round is created
The old one is not saved

Use Case 6: Round save
After a round is saved, the users can see the history round names and picked value
They can see also a total

Use Case 7: Export
Participants can choose if they download the results in CSV / EXCEL / Word /PDF format

Use Case 8: Round delete
The host can delete a round previously saved

 

The mockups are the following:

 

create_table table

Friday links 104

  1. Performance is a Feature
  2. 10 User Interface Design Fundamentals – Treehouse Blog
  3. https://dncmagazine.blob.core.windows.net/edition14/DNCMag-Issue14.pdf
  4. AspPathGuru: A little T4 love for ASP.NET WebForms – Angle Bracket Percent – Site Home – MSDN Blogs
  5. gmanny/Pechkin · GitHub
  6. A universal PredicateBuilder | Monty’s Gush
  7. 10 key technology items for your 2015 budget – TechRepublic
  8. Introducing GraphDiff for Entity Framework Code First – Allowing automated updates of a graph of detached entities – Software Development Blog. AngularJS, C#, .NET, EntityFramework, NodeJS, MongoDB. Tips, Tricks & Gotchas.
  9. How to Create Bootable Windows 8 USB Drive from ISO Image
  10. Create Bootable USB Flash Drive From ISO To Install Windows 7
  11. How to be the most productive person in your office — and still get home by 5:30 p.m. – The Week
  12. How to be the most productive person in your office — and still get home by 5:30 p.m. – The Week
  13. The science of sex: 4 harsh truths about dating and mating – The Week
  14. Programming Sucks
  15. Ig Nobel Prizes Celebrate Jesus Toast and Other Silly Science – NBC News.com
  16. Little Big Details – Your daily dose of design inspiration
  17. Entity Framework (EF) Documentation
  18. Entity Framework Pre-Generated Mapping Views
  19. Avant Prime – ASP.NET MVC image map helper
  20. Troy Hunt: 10 things I learned about rapidly scaling websites with Azure
  21. Over 100 ASP.NET Web API samples – StrathWeb
  22. Web API Documentation Tools — Visual Studio Magazine
  23. StyleCop – Wikipedia, the free encyclopedia
  24. StyleCop – Home
  25. List of tools for static code analysis – Wikipedia, the free encyclopedia
  26. Stop using AutoMapper in your Data Access Code

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.