stevenkuhn.net a special blend of windows, linux, and .net with a touch of randomness

27 Jul 10 2

myLeagueTracker - Requirements and Initial Domain Design

This is an ongoing series on the development of myLeagueTracker: an ASP.NET MVC web application that helps manage online FPS gaming leagues. You can read my first post on this project to get more background information.

The first step to building an application that will manage online gaming leagues is was to come up with a list of basic requirements that it should perform. I thought of a few requirements that would get development started, but certainly not an exhaustive list:

  • Manage games and leagues for a particular game.
  • Manage seasons for a league, teams for a season, and players on each team.
  • Create matches between teams and coordinate schedules, maps, and results for each match
  • Track wins, loses, ties for each team for any given season
  • Ability to view past season’s teams, scores, and players

While there are more things I want to add, I want to start small and iteratively add functionality over time. Using those requirements, I came up with the following domain designs:

Leagues Matches

As you can see, each one of those classes derives from a abstract base class called Entity<int>. Using concepts I learned after reading a couple books about Domain-driven design, each class in the model above is not defined solely by its attributes (definition of a Value Object) but instead by its identity (the basic definition of Entity). The code sample below shows that the entity base class and underlying interface contain an Id property which is used to compare equality between two objects of the same entity type.

public interface IEntity { }

public interface IEntity<T> : IEntity
{
	T Id { get; }
}

public abstract class Entity<T> : ObjectBase, IEntity<T>
{
	public T Id { get; private set; }
}

You may wonder what is the purpose of ObjectBase. For now it has no implementation, but my next post will cover the details on making it provide the primary facilitation for comparing equality of both entities and value objects. Additional posts will also discuss the concepts of persistence with nHibernate, domain model validation with Data Annotations, unit testing, and the implementation of the UI layer involving ASP.NET MVC 2 and jQuery.

Feel free to leave questions and comments! :)

Comments (2)
  1. Look who decided to write a blog post!

  2. I know, it's been a while. I even have the next one half-way done! :)


Leave a comment