Football Application – Preparing to code

Posted on 18th July 2008 in development

A Domain Model?

I don’t know. I have only read the first chapter of Eric Evans’, Domain Driven Design so far, so I might be on the right track here.
From what we have figured out so far from the requirements we have the following entities.
  • Club
  • Member
  • Team
  • Manager
  • Player
  • Staff-Member
This is where I am starting from. It might not be the right place, but it seems as good as any right now. I believe that with these concepts I should be able to start building an application that the users will understand.
Some more detailed requirements

Further discussions with people related to the club highlights the fact that the system should be available outside of office hours and over the internet, apparently the managers/coaches of the kids teams are volunteers who have day jobs. It should be secured in some way so that club information stays private. This leads me to the decision to build the application as a website. The website will be hosted on a windows server machine with IIS and ASP.NET available.
(Ok, so that is a little staged, but isn’t all of this?)
I decide to leverage what I can of the Membership, Roles, Profile and Personalization features offered by ASP.NET. (Learning about the ASP.NET MVC or Monorail is a step too far right now, I might do that on the second iteration.)
After this decision is made I need to figure out what to do first. As the club secretary is the person who will be in acting as the administrator of the software I need to make sure that they have the features that they want as soon as possible. We need to get them familiar with the system and allow them to get the initial sets of data entered.
Somehow I manage to get in touch with the club secretary again to talk through some features of the system. This is what I got out of the conversation.
(This is going to make BDD people cry, please let me know what I can do to make this better)
When I try to access data in the system, I should not be allowed to, unless I have logged in.
Given that a user is not logged in,
When sensitive data is accessed,
Should be shown the login screen.
When I want to contact a member, I need to be able to see a list of all members, so that I can see the ones I want.
Given that there are members in the system,
When the member list page loads,
A list is populated with all the members of the club.
When a member joins the club, they need to be added to the system, so that I can make sure they are organised.
Given the member does not already have details in the system,
When I enter their details,
They appear in the list of members for my club.
Given the member is already in the system,
When I enter their details,
I should be made aware that they already exist
And I should have the choice to duplicate the entry

When a member leaves that club, I need to be able to remove them from the system, so that I don’t end up with lots of out of date information.
Given that a member exists in the system,
When I delete their information,
They are removed from all lists of members,
And they are removed from all Teams

As I am leaving the club owner wants to find out how things are going, so we go through the list of requirements that I have gathered so far and he is quite happy with them. In fact he thinks that it sounds so good that we should make this available to other clubs to use, at a price of course. This introduces another concept, multiple clubs active in the system at the same time. We might consider setting each club up with their own system, but lets not go there until we know that it is a problem.
I think that this will do for now. There is actually quite a lot of work involved in getting to this point. Some infrastructure needs to be in place to handle some of the non-functional requirements that we have.
  • The system needs to be stable.
  • If there is a problem we need to be able to find out what happened.
  • The system need to be responsive.
Lets jump in and start coding. I will be trying to do as much as I can in a TDD style, no sure how the database interaction part is going to go yet, I always hate writing tests that hit the database.
As the title of the first post suggested, I will be using NHIbernate for data access and other goodies that object relational mappers offer. Ninject will be used for any dependency injection needs, I am sure that there will be some somewhere. jQuery will be used for the web UI and any ajax capabilities. What about the iPhone? Well I am not sure about that yet, all I know is that I have an iPod Touch, a usb cable, a Mac Book Pro and an iPhone developer account. I am sure that I can come up with something for remote administration, even if it is just an iPhone Web Application.
I’ll be back when I have something interesting to show.
comments: 1 »

NHibernate, Ninject, jQuery and the iPhone?

Posted on 17th July 2008 in development

Background

I am intending on writing a small application over the next day or two that will help me understand, at a reasonable level, some interesting technologies.

The software will be a fictional Football Club organisation application; that is Football, the game where you kick the round ball with your feet, not whatever this soccer thing is, never seen someone playing a football game in their socks ;) That can be used to manage club members, teams, management staff, fixtures and whatever else comes up along the way.

The reason for doing this is to delve into some of the technologies that I have been meaning to learn for some time. After reading through documentation, articles, blog posts, tutorials and whatever text I could get my hands on, I am ready to start attempting to implement something. If anyone does find this series then be warned, it is more of a learning experience than a manual. Something that I say/do in the first post may later be ripped out and done in a different way later on. Also if you spot something that isn’t right, let me know, that’s what comments are there for.

Requirements

So lets get going then. The first thing we need is a set of requirements. I am going to use a style that might be similar in style to BDD requirements, although I’ve never really done any BDD before.
Requirements gathering can be quite boring, so I’m going to tell a story.

I set off in search of some people with a vested interest in the software. The first person I meet is the club owner.
  • As a club owner, I want my club to be well organised, so that we run efficiently.
That’s it, that is the only requirement he has, after that he gets on his phone and I leave quietly. Don’t you just love requirements. Ok, lets try and get some more out of the people at the club. I will assume that they have agreed that a software solution will be created that has some sort of data storage ability. I’m certainly not going to go through this exercise and tell them to go and buy everyone their own leather bound diary!

I find the club secretary who is responsible for looking after the smooth running and organisation of the club.
  1. As club secretary, I want to be able to know who the members of the club are, so that I can contact them when I need to.
  2. As club secretary, I want to be able to control which managers have access to which teams through the system, so that they are not overwhelmed by the amount of information.
  3. As club secretary, I want to be able to send emails to our members, so that I can send out reminders or newsletters.
Wandering around the club offices I find the treasurer, who is responsible for the finances of the club. Far too busy to talk I only get a few requirements.
  1. As club treasurer, I want to be able to keep track of membership fees, so that I can balance the books.
  2. As club treasurer, I want to be able to keep track of any fines awarded to players or staff, so that we can ensure they are paid in time.
Later on I manage to get a meeting with a few of the team managers associated with the club. Ok, so all I managed to do was catch up with a manager during half time at a game.
  1. As a team manager, I want to know who is available to me for selection, so that I can pick the best team.
  2. As a team manager, I want to know which members of the club’s ‘back room’ staff have been assigned to my team, so that I can make sure the players are well looked after.
  3. As a team manager, I want to be able to access my fixture list whenever I need to, so that I can make sure everyone knows who we are playing next.
While I’m at the game, I decided to talk to some of the substitutes, they had some requirements too.
  1. As a player, I want to be able to access the fixtures, because the manager sometimes forgets.
  2. As a player, I want to be able to let the manger know when I am on holiday, so that he doesn’t put me in the team.
  3. As a player, I want my personal information to be secure, so that I don’t wake up to find someone has stolen my identity.
As I am thanking the players and setting off to get back to work, (doesn’t everyone work on a Saturday evening?), one of the team’s fanatics fans confronts me. “You making a website for this lot? Well I got things I want on it too!”
Oh well, might as well humour him.
  1. As a fan, I want to be able to see the fixtures, so that I don’t miss a game.
  2. As a fan, I want to be able to see the results of the games, so when I miss one I know what the score was.
  3. As a fan, I want to be able to read news stories about the team, so that I am never out of the loop.
  4. As a fan, I want to be able to talk on the internet with other fans, so that we can make up new chants.
After that I switched off and drew fluffy clouds all over my notes.

Overall I think that we have a good enough set of feature requests to get us going. As everyone in the club is too busy to talk to us now, we are going to have to work out priorities by ourselves. We have a week day to get something together to show the club owner. The intention of the software is to help organise the club, so the fan’s website requirements can probably be put deep into the product backlog!
Now that you have some background to what I am trying to do, the next post will hopefully start getting into some technology.

comments: Comments Off

Update on Blogo

Posted on 17th July 2008 in blogging

Last week I posted about trying out Blogo, a blog authoring application for the Mac.

I contacted the support team at brainjuice explaining my problems, and mentioned that I missed the ability to have a link history/glossary.

A few hours later I received a reply. I found out that the issue I had with style on the

tags will be addressed in an upcoming release. They had added the inline styles to avoid float bugs on some weblog systems, when posting through Blogo.

The link typing problem is a known WebKit issue and is being worked on.
The auto-completion for links is on the list of features to be implemented.

They weren’t too sure about the issue that I as having with editing my posts and I said that I would try and get DasBlog setup locally to try and debug it.
I tried running DasBlog on my VM whilst connecting to it using Blogo. There were various issues caused by settings that I have never touched and basically I gave up trying to get them talking after about 30 minutes.

I left it at that, then 6 days later I received another email from the Blogo team informing me that they were working on the same issues with another DasBlog user. At least that proves that it wasn’t me doing something silly.

I look forward to seeing an update on this, as I have to say I love the interface of Blogo. It is clean and simple. Perfect for my not so often blogging on my little site here.

This is my first try at update with a new version of Blogo on 27th July.


comments: Comments Off

FC United of Manchester Fixtures and Google Calendar

Posted on 12th July 2008 in Football

I have just finished entering the FC United of Manchester fixtures, for the first half of the season, into a google calendar.

The official fixtures can be found at either FC United of Manchester’s official website, or at the Unibond League’s official website.

These are the URLs for the different ways to access the calendar.

If you are using a Calendar application that supports the iCal format, use the first link to subscribe to the calendar.

If you want the calendar to appear in your Feed Reader application, use the XML link.

If you want to view the calendar online, or add it to your own google calendar, use the Web link.

I will try my best to keep the fixture list up to date, if it is anything like last year it is going to be hard going.

I have added the results of the first friendly to the calendar.

comments: Comments Off

Using Ninject in a Web Application

Posted on 10th July 2008 in development, ninject

I have been meaning to look at Ninject for a while now, and today I finally got my chance.
I am only using some basic features of Ninject to replace my normal use of Constructor Injection that I tend to favour.

This first example is based on the code needed to drive my jQuery examples. When I reached the point of requiring server side data, I decided that I wanted to try out Ninject.

I wanted to load some data using an HttpHandler. I used a handler as I wanted to also save data using the same URL.
The handler has what might be a PageController, which will determine the action to take based on the request being an HTTP GET or POST.
The controller itself relies on an implementation of IDataLayer which handles the data access.

Currently I have only explored the basic binding techniques in Ninject. This involves creating a class that specifies the bindings, then registering it with the Kernel.

    using System;
using Ninject.Core;

namespace Core.NinjectModules{
public class PeopleModule : StandardModule{
public override void Load(){
Bind().To();
Bind().ToSelf();
}
}
}

This is the binding module for specifying the dependancies of my People class.

    using System;
using System.Text;
using Ninject.Core;

namespace Core{
public class People{
IDataLayer _dataAccess;

[Inject]
public People(IDataLayer dataAccess){
_dataAccess = dataAccess;
}
...
}
}

This is the People class and with the single attribute needed to identify to ninject what to use for injection.

It is using the constructor injection feature. I have removed the rest of the implementation of the class to help with reading.

Ninject offers a set of features specifically for web applications. They can be found in the Ninject.Frameworks.Web namespace.

From this namespace I used the NinjectHttpApplication and HttpHandlerBase classes.

The NinjectHttpApplication provides the implementation required to attach a ninject Kernel to your HttpApplication.

It is an abstract class that requires the user to implement a CreateKernel() method, in which the user initialises the Kernel.

    using System;
using Ninject.Framework.Web;
using Ninject.Core;

namespace jQueryExamples
{
public class Global : NinjectHttpApplication{
protected override Ninject.Core.IKernel CreateKernel(){
IKernel kernel = new StandardKernel(new Core.NinjectModules.People());
return kernel;
}
}
}

This is all that I needed to register my People module with the ninject Kernel.

I then needed the People controller to be injected into my handler. This is where the HttpHandlerBase comes into it.


using System;
using System.Web;
using System.Web.Services;
using Core;
using Ninject.Core;

namespace jQueryExamples.handlers{

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class people : Ninject.Framework.Web.HttpHandlerBase{
private People _people;

[Inject]
public People PeopleController{
get { return _people; }
set { _people = value; }
}

protected override void DoProcessRequest(HttpContext context){
_people.RequestType = context.Request.RequestType;
string responseText = _people.Process();
context.Response.Clear();
context.Response.Write(responseText);
context.Response.ContentType = "text/xml";
context.Response.StatusCode = 200;
}

public override bool IsReusable{
get { return false; }
}
}
}

This is the entire implimentation of my handler. The People class will be injected into the handler when it is needed.

That is it for now for ninject. I can do the basics, next I need to learn about the context specific bindings etc

comments: Comments Off

Second (Actually 3rd) Post from Blogo

Posted on 9th July 2008 in blogging, dasBlog

The engine running this blog is DasBlog which does not appear on the list of supported systems for Blogo (FAQ), so I was expecting a few things not to work.

I am making a second third test post from Blogo. The first time I posted it seemed that there was a style added to the initial paragraph which caused my blog to look strange. This second third post is to confirm that it was in the markup sent from Blogo.

I was tempted not to post this as I could see from the preview that it was going to do the same thing. I decided to go ahead anyway, so that I had an example of the markup that it is sending and so that I could figure out how I can save drafts.

This part of the post was written after saving as a draft. Drafts are posted to DasBlog without publishing them. This is perfect for me, apart from one small problem when it comes to editing the saved draft. Well technically the editing of the draft is nice and simple. Blogo will let you list all of the posts on your blog and allow you to change the text. The intention is then of course to re-post to the blog and have the content altered.

On submitting the edited post I see this error.
I can only assume that something in the DasBlog editing system is not playing well with Blogo. I have emailed the authors of Blogo to let them know and to find out if there is any prospect of DasBlog support in the future.

Not being able to edit my posts from Blogo doesn’t completely rule it out right now as the application seems very nice to work with. It is the first one that I have tried on the Mac, so I will see how it stands up to the others that I use.

The old saying “You only miss it when its gone” applies to a feature that I didn’t realise I was using all that much in Windows Live Writer. Whilst trying to go back through this post and link up the various references that I could. I found that I was missing the way that Windows Live Writer handled links. Using the link glossary had obviously become something that I did without thought. So when trying to link up all instances of the word Blogo I found myself re-typing the informatin everytime, rather than selecting the information from a list, which is what I was used to.

A slight annoyance was that when trying to add links whilst going along, I found that I would select the word that I had just typed, add the details for the link, then carry on typing, it would still think that I was typing the link.

Something strange has just happened and I am not sure what the result of posting this is going to be now. I previewed my post to see what it would look like and it looks like it is not going to break the layout. Maybe it is because I have images in this post. More investigation is needed.

[edit:from DasBlog editor]Looks like there are no styles on the paragraphs this time. A little confusing. Also the images didn’t quite upload correctly. I was expecting them to be thumbnails linking to the full images.

comments: Comments Off

Testing Post from Blogo

Posted on 9th July 2008 in Uncategorized

I am currently trying to find some blogging software for my Mac. Even though I had not used it very often, as you can tell from my lack of posts, I had found Windows Live Writer to be very nice to use.
I will be posting a number of test posts over the next couple of days, in preparation for my second attempt at blogging.

comments: Comments Off