Comments

The add recipe feature is the first feature that will added to the site. This task can first be broken down into 4 subtasks:

  1. Add a recipe summary
  2. List / add ingredients
  3. Add recipe ingredients
  4. Add a recipe cooking method

However, the sharp architecture framework is designed for Test Driven Development. These are the TDD steps listed in the sharp architecture reference guide (in the docs folder of the SVN project):

  1. Write your test as if the target objects and API already exists.
  2. Compile the solution and see it break.
  3. Write just enough code to get it to compile.
  4. Run the test and see if fail.
  5. Write just enough code to get it to pass.
  6. Run the test and see it pass!
  7. Refactor if necessary!

Taking another look at the feature subtasks from a TDD perspective, the breakdown for each domain object looks more like this: Ingredient

  1. Add tests for the ingredient domain object and controller
  2. Implement the ingredients domain object and controller to make the tests pass
  3. Add Ingredients views for List and Create

Recipe

  1. Add tests for the recipe domain object and controller
  2. Implement the recipe domain object and controller to make the tests pass
  3. Add Recipe views for CreateSummary, CreateIngredients, CreateCookingMethod

Currently I just need to implement the Create view for the Ingredient object, then I can move onto recipes.

Comments

I’ve setup the project using the default ’S#arp architecture Application’ template. I won’t go into detail about the steps taken to do this as it is all covered in the Sharp Architecture documentation. However I did hit a snag setting up the NUnit project so I’ll expand on that in this post.

The Sharp Architecture template is setup for TDD (Test Driven Design) and this is the approach I will be taking to the development. Having installed TestDriven.Net, the tests can be run through visual studio, however I prefer the interface of the NUnit GUI. After each test run the results are displayed as a set of pleasing green ticks and/or nasty red crosses. Once you have a nice set of green ticks it becomes a bit of a fixation to keep it that way!

The unit tests for the visual studio project can be easily loaded into the NUnit GUI. All you need to do is go to File –> Open Project and navigate to the bin folder of the test project. Opening the compiled assembly (dll) of the test project will load all the unit tests into the GUI. Hitting the run button returns a nice list of green ticks as expected. However after saving the NUnit test project something alarming happens on the next test run. The standard Sharp Architecture Data tests all fail and nasty set of red ticks appear!

The following error message is reported:


SharpArch.Core.PreconditionException : Please add an AppSetting to your app.config for ‘nhibernate.mapping.assembly.’ This setting takes a comma delimited list of assemblies containing NHibernate mapping files. Including ‘.dll’ at the end of each is optional.

The error is pointing to a missing setting in the app.config file, however on checking the file the setting is present. Also the tests worked just fine before saving the NUnit project so why would they suddenly start to fail?

The cause of the test failures appears to have been saving the NUnit project, this pointed to some settings changes which NUnit may have made during the save. Taking a look at the NUnit project settings the possible cause of the problem became clear. There are a couple of directory and file paths in the settings, of particular interest are a ‘Configuration File Name’ and ‘ApplicationBase’ settings.

Configuration File Name When the test project assembly is first loaded this setting has a value of RecipeBook.Tests.dll.config, however after saving the NUnit project the .dll part of the filename disappears. So NUnit is no longer able to find the config file and read the settings from it.

ApplicationBase The ApplicationBase setting remains blank, however if you have saved the NUnit project in a different directory to the test project assembly you will need to change this. The path needs to be the relative path from your test project base to the test assembly location.

Below is an image of the settings for my project:

After updating these settings NUnit was able to read the settings for the config file and the GUI happily reported a lovely set of green ticks :)

Comments

I’ve now generated some initial wire frames for the site… mere minutes after my last post, amazing eh ;)

The following features have been wire framed so far:


  • Add/Edit Recipe (3 views)
  • Search page
  • Recipe book (list and details)

Alas, only the Add/Edit recipes wire frames are online. The good old pencil and pad was proved best for the others, not nearly so high tech but certainly faster!

I’ve used an online application called Gliffy to create the add / edit recipes wire frames. The application is pretty well featured for a ‘free’ online app. Actually it is only free to use after 30 days if you publish the wireframes online, so maybe not ideal for a top secret ‘best idea ever’ type of development, but for my needs its just fine!

Below are the posts of the wire frames. You can click the links in the titles if the text is too minuscule to read on the images:


Step 1 – Add Summary page
 


The add summary page needs to be simple and quick, I don’t want users getting bored on the first screen!

 
Step 2 – Add Ingredients page
 


This page will be tricky to keep simple, early users will have to add each of the ingredients but once they are in the database and approved then anyone can use them. I’d like some kind of self approval mechanism as I doubt anyone would want to moderate this (I know I certainly don’t!)


Step 3 – Add Method page
 


Will need to make sure that the Rich Text editor options are limited here to prevent users mucking up the site styling. Each of the above steps will be reused for the edit interface with the controls pre-populated with data.

Now I’m almost ready to fire up Visual Studio (finally!) however before that I will need to sort out an overall layout and styling to tie the site together. If I was American (and whooped a lot) I’d probably says that the templates could do with some jazzing up to make them more punchy. As I’m English and hardly ever whoop (intentionally) I’d say that the site could do with some prettifying. I will most likely customise an existing CSS template (open source of course) which is close to what I am looking for.

Comments

I will be looking to develop the website iteratively and introduce fully working features 0ne at a time. With this in mind I have drawn up list of the minimum set of features the site will need for it to work:

  • Add / Edit ingredients
  • Add / Edit recipes
  • Search for recipes + bookmark
  • User registration / authentication
  • Recipe book (View own recipes + bookmarked)

I will first be focusing on developing these features to try and keep some momentum on the development. Once these features are completed I can either further develop the initial feature set or introduce more. Some ideas for more advanced features are:

  • Recipes reviews and ratings
  • New recipes ‘you might like’ notifications by email / rss feed
  • Generation of shopping lists from a set of recipes
  • Multiple region support (different languages)

Thats quite enough to keep me busy for now! Next up are the wireframes.

Comments

I’ve started this blog to record my progress making a website in ASP.NET MVC. I am hoping that writing a blog about the experience will help keep the development moving forwards. The motivation for making the website is to get a better understanding of the technologies that are used to build it. Therefore it is not so important that the site is unique, more that I can implement interesting and challenging features on the site to stretch the framwork. I don’t expect many people will read the blog but maybe one day it will have some interesting content!

A summary of the progress so far:

  • Run through tutorials on ASP.NET MVC, primarily the excellent NerdDinner tutorial.
  • Checked out Sharp Architecture to use as project architecture
  • Initial idea about making the site on an online recipe book, where users can add and store their own recipes

Future targets:

  • Draft some wireframes for the website
  • Draft an initial class diagram for the project
  • Build a prototype using Sharp Architecture

I think wireframes will be useful to help clarify what I want in terms of the sites appearance and functionality. So, I’ll be putting on a designers hat (if I can find one) for a brief time and bash something out. It might not be pretty at this stage but I don’t want it to delay me too much on starting the development.

Copyright © 2016 - Hook Technologies Ltd - Powered by Octopress